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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Merging PDF Pages: Empty FormFields
  FAQ FAQ  Forum Search   Register Register  Login Login

Merging PDF Pages: Empty FormFields

 Post Reply Post Reply
Author
Message
Skandinavier View Drop Down
Beginner
Beginner


Joined: 27 Nov 20
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Skandinavier Quote  Post ReplyReply Direct Link To This Post Topic: Merging PDF Pages: Empty FormFields
    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! 

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 20 Jan 25 at 11:17PM
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

Back to Top
Skandinavier View Drop Down
Beginner
Beginner


Joined: 27 Nov 20
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Skandinavier Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 25 at 10:18AM
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
Back to Top
noramila View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Aug 23
Location: India
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote noramila Quote  Post ReplyReply Direct Link To This Post Posted: 23 Jan 25 at 1:17PM
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.

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 23 Jan 25 at 9:23PM
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

Back to Top
noramila View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Aug 23
Location: India
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote noramila Quote  Post ReplyReply Direct Link To This Post Posted: 24 Jan 25 at 12:19PM
Thankyou For the info.
Back to Top
Skandinavier View Drop Down
Beginner
Beginner


Joined: 27 Nov 20
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Skandinavier Quote  Post ReplyReply Direct Link To This Post Posted: 31 Jan 25 at 9:57AM
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!
Back to Top
Skandinavier View Drop Down
Beginner
Beginner


Joined: 27 Nov 20
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Skandinavier Quote  Post ReplyReply Direct Link To This Post Posted: 03 Feb 25 at 2:38PM
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).
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store