How to save XFA properly to my PDF #3095
Replies: 3 comments 1 reply
-
I cannot speak for XFA as I have never used it. But
does not sound right. I suspect that the signature might become invalid, but the encryption should not be affected (if in place). |
Beta Was this translation helpful? Give feedback.
-
The encryption works if I use the |
Beta Was this translation helpful? Give feedback.
-
For anyone looking a solution for this, I decided to use iTextPDF5 in C# (alternative is itext7 in Java). The Stamping Properties and append in iTextPDF5 in C# works properly. |
Beta Was this translation helpful? Give feedback.
-
Hi PyPDF community,
I am currently creating a project where I can automatically fill up the PDF forms using Python. I stumbled upon this library which is a perfect tool for me to edit PDF.
I am currently experimenting a bit and I have two pdf I have imported, one is not filled up but the other one is. I am only targeting the datasets in XFA to copy since, that is the data that I want to fill/edit. Here's is the code that I have used.
![image](https://private-user-images.githubusercontent.com/38535701/407772729-e1996296-be9d-494e-b166-d0ff06cf7506.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNTY0OTMsIm5iZiI6MTczOTM1NjE5MywicGF0aCI6Ii8zODUzNTcwMS80MDc3NzI3MjktZTE5OTYyOTYtYmU5ZC00OTRlLWIxNjYtZDBmZjA2Y2Y3NTA2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEwMjk1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ5NjUzZjQ3ZDU4YzRkYTMxZTMyYmU1Njg1NzQxZjk4OGFkZDU4MjhkZWMyNTM4ZDQxY2FlN2MwODFmY2EzZmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.R4w0XdUnpO3gXHVvikeVyCX_TnQjGvPHtNdL3ImACGA)
Upon execution, and trying to open the file, I'm seeing warning from Adobe Reader:
![image](https://private-user-images.githubusercontent.com/38535701/407773733-e066e454-3757-45e5-988d-6658584f5f5e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNTY0OTMsIm5iZiI6MTczOTM1NjE5MywicGF0aCI6Ii8zODUzNTcwMS80MDc3NzM3MzMtZTA2NmU0NTQtMzc1Ny00NWU1LTk4OGQtNjY1ODU4NGY1ZjVlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEwMjk1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJmY2I0ODgxODRlNDNlMjE2ZmNjYzdhODM4OWE1MWNkZDZjMDQwZDA1NjEzMjMzMjFjMWRhOWQ4MTNhYTJiNTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.rLtSM4Q0VQJ6Pr3ctNsjTVHmOmABXvgsTAb5mao4lYM)
Also, if I try to fill up a form, it shows this, and I cannot save the file.
![image](https://private-user-images.githubusercontent.com/38535701/407772083-0050234d-46c0-40d4-b4ed-423aaa496e56.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNTY0OTMsIm5iZiI6MTczOTM1NjE5MywicGF0aCI6Ii8zODUzNTcwMS80MDc3NzIwODMtMDA1MDIzNGQtNDZjMC00MGQ0LWI0ZWQtNDIzYWFhNDk2ZTU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEwMjk1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI0MjkxMWMxMjM3Y2RhYTVjNjYwZjU3ZmU0NmY2YTNiN2ZhZWI0MDM5YTAxMjA5NjJiMzk0MTc1YTJkNWU5NDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.6nUE41ptMMdU0_dJ0OYhA-XaD67HWOEkEBQRTEs4K4Q)
I believe the PDF file is encrypted and signed, and when using my code to edit it, it loses it's encryption (SECURED).
I looked into the documentations and tried
incremental=True
but I cannot save any XFA changes using this method.Additionally, I can't send the PDF since it contains confidential information.
Beta Was this translation helpful? Give feedback.
All reactions