What PowerShell command can edit the text inside a PDF document and replace a text string with another text string?

frob 4,261 Reputation points
2022-07-07T19:45:34.45+00:00

Hi there
What PowerShell command can edit the text inside a PDF document (hosted on SharePoint Online document library) to replace a text string with another text string?

Thanks.

Microsoft 365 and Office SharePoint For business Windows
Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 47,901 Reputation points
    2022-07-07T21:31:08.727+00:00

    PowerShell alone cannot edit PDF files. Your best bet would be a 3rd-party library. A product that has a "community " (i.e., "open-source") license is iText: itextpdf.com. It has a .Net version of its code that PowerShell can easily use.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. 2022-07-07T20:00:52.12+00:00

    PowerShell command can edit the text inside a PDF document

    1 person found this answer helpful.
    0 comments No comments

  2. Limitless Technology 39,916 Reputation points
    2022-07-11T09:56:19.027+00:00

    Hello Frob,

    By default there is no Powershell command of script oriented to editing PDF files, however you can use Power Automate (such as power-automate-replace library) or 3rd Party tools like iText.

    For PowerAutomate information you can post directly in the PowerAutomate community at:
    https://powerusers.microsoft. com/t5/Microsoft-Power-Automate/ct-p/MPACommunity

    Reference: https://learn.microsoft. com/en-us/answers/questions/908635/is-there-a-powershell-script-to-edit-a-document-on.html

    ---------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.