Skip to content

Fields created by updatePageFormFieldValues do not show in Adobe Acrobat and Foxit  #300

@jamoham

Description

@jamoham

I am using the following code to update the form fields with a dictionary:

from PyPDF2 import PdfFileReader, PdfFileWriter

reader = PdfFileReader(open("template_acrobat.pdf", "rb"), strict=False)
writer = PdfFileWriter()
writer.appendPagesFromReader(reader)
writer.updatePageFormFieldValues(writer.pages[0], dictionary_of_values)

with open("pdf_out.pdf", "wb") as f:
    writer.write(f)

The outputted PDF file does not show any form fields when opened in Adobe Acrobat or Foxit.
Only when we click on a field, the data is shown. Also, It does not show when we print the PDF.

Please refer the attachment:
Open the file in Adobe Acrobat and click on the 'Name' field in the PDF

pdf_out.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    Has MCVEA minimal, complete and verifiable example helps a lot to debug / understand feature requestsis-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFworkflow-formsFrom a users perspective, forms is the affected feature/workflow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions