Pypdf2: Why Does Pdffilewriter Forget Changes I Made To A Document?
I am trying to modify text in a PDF file. The text can be in an object of type Tj or BDC. I find the correct objects and if I read them directly after changing them they show the u
Solution 1:
The solution is to assign the ContentStream
that is being iterated and changed to the page afterwards before passing it to the PdfFileWriter
:
page[NameObject('/Contents')] = content
output.addPage(page)
Post a Comment for "Pypdf2: Why Does Pdffilewriter Forget Changes I Made To A Document?"