-
Hello @gettalong, I have the following use case:
Solution that I invented:
Problem: The page 3 from temp_pdf_origin is not correctly inserted in the @pdf_origin but the same values from @pdf_origin page 3 are inserted in the new concatenated page. MAIN PDF: Formulaire.AN.RD.pdf RESULT page 3 same as page 4 : test.pdf
I also tried with the merge example from the website and got the same result.. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hello @loust333, There are a few problems with the code:
There is a todo item on my list for making it easier to copy pages with form fields to another PDF. I have bumped up its priority to make that happen sooner than later. |
Beta Was this translation helpful? Give feedback.
Hello @loust333,
There are a few problems with the code:
The main reason why this doesn't work is that AcroForm fields with the same full name are deemed to be just one field. When you copy the page, the field names stay the same and thus page 4 doesn't have separate fields.
The way you copy the page in
#merge
doesn't work in the general case. You need to correctly import the page (see https://hexapdf.gettalong.org/examples/merging.html#merging-pdf-files for details), otherwise there will be problems.AcroForm fields are actually separate from their appearance on a page. This allows, for example, a single field to appear in multiple places. So when you want to copy a page from a PDF a…