Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Merging PDF Pages: Empty FormFields |
Post Reply ![]() |
Author | |
Skandinavier ![]() Beginner ![]() Joined: 27 Nov 20 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() Posted: 20 Jan 25 at 7:20PM |
Hi everyone,
I’m working on merging two or more PDF pages into a single page using the "DrawCapturedPage" function. This works fine overall, but I’ve run into a problem: The form fields that I previously filled using "SetFormFieldValueByTitle" remain empty in the merged PDF page. Does anyone have an idea how I can ensure that the contents of the form fields are retained when merging the pages? Thanks in advance for your help! |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi :)
It's necessary that each form field has a unique name. If you put several pages with form fields on a new single page you should have an eye on this fact if you don't want to run into problems. Another point: What type of form fields you're using? Acro or xfa? QuickPDF doesn't offer much support using xfa. |
|
Cheers,
Ingo |
|
![]() |
|
Skandinavier ![]() Beginner ![]() Joined: 27 Nov 20 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo,
Thank you for your answer. It doesn't work even with a single field (I tested it to rule out potential issues with duplicate names). The form was originally created with LibreOffice. How can I find out the type of the form fields? I am using the DebenuPDFLibraryDLL1811. If merging the pages doesn't work this way, I’m considering how to place all fields on one page and delete the unnecessary ones before saving/printing. Greetings
|
|
![]() |
|
noramila ![]() Beginner ![]() ![]() Joined: 29 Aug 23 Location: India Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
Hi @Skandinavier,
Try flattening the form fields (turning them into static content) before merging. This should keep the filled values. You can check if the fields are AcroForm or XFA using Adobe Acrobat. If flattening doesn’t work, copy the fields to a new page first. |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
With
//... if (QP.GetXFAFormFieldCount > 0) or (QP.FormFieldCount > 0) then... //... you can check if there are acro form fields or xfa form fields. |
|
Cheers,
Ingo |
|
![]() |
|
noramila ![]() Beginner ![]() ![]() Joined: 29 Aug 23 Location: India Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
Thankyou For the info.
|
|
![]() |
|
Skandinavier ![]() Beginner ![]() Joined: 27 Nov 20 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Hello everyone, The fields are AcroForm. I choose to define all possible fields and remove the unnecessary ones before saving. However, I'm encountering a strange issue: When generating the document, I end up with the first page repeated three times—although the same code works perfectly fine with a different template. Could someone take a look at the code below and help me understand why this is happening? Dim fileName As String = "D:\....\...\Template.pdf" Dim Final_Doc As Integer Dim Used_Doc As Integer Call QP.LoadFromFile(fileName, "") '1. Page Call QP.SetFormFieldValueByTitle("Titel", "First Page") Final_Doc = QP.SelectedDocument() '2. Page Call QP.LoadFromFile(fileName, "") Call QP.SetFormFieldValueByTitle("Titel", "Second Page") Used_Doc = QP.SelectedDocument() QP.SelectDocument(Final_Doc) QP.MergeDocument(Used_Doc) '3. Page Call QP.LoadFromFile(fileName, "") Call QP.SetFormFieldValueByTitle("Titel", "Third Page") Used_Doc = QP.SelectedDocument() QP.SelectDocument(Final_Doc) QP.MergeDocument(Used_Doc) Call QP.SaveToFile("D:\....\...\Result.pdf") ' Remove document from memory QP.RemoveDocument(Final_Doc) Thanks in advance! |
|
![]() |
|
Skandinavier ![]() Beginner ![]() Joined: 27 Nov 20 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
I copied the template using Adobe Reader. With this template, I achieve the desired result with the above code, namely pages 1–3. PDFs truly are a riddle wrapped in a mystery inside an enigma (W. Churchill).
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store