pdfjs icon indicating copy to clipboard operation
pdfjs copied to clipboard

PDF with XFA forms

Open andrewttran opened this issue 6 years ago • 2 comments

Hello!

I noticed when trying to use pdfjs to add pages from PDFs that contain XFA forms that when the outputted PDFs are viewed in various viewers the text either isn't displayed or is displayed without any of the original fonts/styles. I've attached an example here. Are there any fixes/workarounds for this?

Thanks!

input.pdf output.pdf

andrewttran avatar Jun 23 '18 15:06 andrewttran

Thanks for reporting this issue. I'll have a look

rkusa avatar Jun 24 '18 09:06 rkusa

When adding an existing PDF document, the current implementation only adds the plain page-contents. However, AcroForms are set at document-level (Catalog dictionary). So, the current implementation has to be extended to take document-level properties into account. The main challenge here is to merge AcroForms when adding pages from multiple existing PDF documents.

Since this is not a quick implementation, it could take a while. In the meantime, the only workaround is to print the input.pdf as PDF and use this printed PDF as an input for pdfjs. This works, because it should remove the form elements. Though, I guess loosing the form elements is not what you are aiming for.

rkusa avatar Jun 25 '18 11:06 rkusa