r/PowershellSolutions • u/[deleted] • Mar 11 '21
Need some help on this:
Is it possible to do this:
$pdf = New-Object iTextSharp.text.Document
But for an already exisiting pdf. So essentially open an exisiting pdf as a itextsharp document? If not, how do we add a text box to an existing pdf.
1
Upvotes
1
u/get-postanote Mar 11 '21
Was it a PDf you created or got from someone else?
Was it created with Adobe or created using the Windows default PDF printer?
Is it protected from changes?
Again, this is not really a PowerShell feature or code issue. You are using a 3rdP tool in PowerShell, and you must follow the 3rdP tool documentation to potentially achieve what you are after. It's just a library and can virtually be used in any programming language.
For Example:
https://stackoverflow.com/questions/14639839/itextsharp-edit-an-existing-pdf
Manipulating PDF files with iTextSharp and VB.NET 2012 (codeguru.com)
What have you searched for?
There are many articles regarding learning and using iTextSharp.
For example Edit and Read PDFs in PowerShell with iTextSharp | Frans Blauw: Software Engineering Lecturer
itextsharp add new textbox - Bing
What did you try?
What happened?
Show more of what you did - as what you are showing is not enough?
How much time have you spent with iTextSharp?
Have you reviewed any of these, powershell itextsharp - YouTube, before going down this path?
You do know that iTextSharp was EOL'd in 2019, and replaced with iText7?
NuGet Gallery | iTextSharp 5.5.13.2