Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDFModifiedPage custom handle of Annots #287

Open
devilsclaw opened this issue Oct 7, 2024 · 1 comment
Open

PDFModifiedPage custom handle of Annots #287

devilsclaw opened this issue Oct 7, 2024 · 1 comment

Comments

@devilsclaw
Copy link

I am currently working on various project that need to manipulate PDFs.

The projects I am currently working on uses a preexisting template PDF that has text forms that can be filled in. My project collects info on the form objects and then filters them out and are not part of the final output PDF. I then modifies the Content Section and adds what is needed for the text to be static text. It then adds a image to the PDF which is.

The filter out section modifies all the indirect objects related to the Annot's forms and empties them and then it completely skips the annot section with coping the content to the output object.

I noticed that PDFModifiedPage WritePage copies everything so then I have the form fields and the static text on the output of the PDF.

Is it possible to remove the annot's section before the write page so that is does not try to copy it? I know I could create my own class and overload the WritePage but I was wondering if there was a way with out doing that.

@galkahana
Copy link
Owner

back when i needed to lock a form i just wrote my own version of PDFModifiedPage combined with copying only the non widgets:
https://github.com/galkahana/HummusJSSamples/blob/master/lock-form/pdf-form-lock.js

so yeah, either recreate your own version of PDFModifiedPage or derive n pick n choose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants