Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Jan 04, 2023 6:08 pm

I am trying to create a PDF which comprises of a cover page and one of more detail pages. The detail pages contain a mixture of text fields and radio buttons. I have taken two approaches, adding pages and appending pages.

Append pages

Copy the cover page to a new PDF document and append 1-n detail pages. The cover page is added successfully, as is the first detail page but all subsequent detail pages do not display correctly in Acrobat. I believe this is because on each detail page the field names have the original names and so the pdf contains multiple fields with the same name. The result can be seen in the attachment FinalPDF(AppendPage)

Code: Select all
My.Computer.FileSystem.CopyFile(
                "E:\Development\PDF Booking Forms\Booking Form (Cover).pdf",
                "E:\Development\PDF Booking Forms\FinalPDF.pdf", overwrite:=True)

        Dim doc1 As PdfDocument = New Spire.Pdf.PdfDocument("E:\Development\PDF Booking Forms\Booking Form (Detail).pdf")
        Dim FinalPDF As PdfDocument = New Spire.Pdf.PdfDocument("E:\Development\PDF Booking Forms\FinalPDF.pdf")

        FinalPDF.AppendPage(doc1)
        FinalPDF.AppendPage(doc1)
        FinalPDF.AppendPage(doc1)

        FinalPDF.SaveToFile("E:\Development\PDF Booking Forms\FinalPDF(AppendPage).pdf")
        FinalPDF.Close()



Add pages

Create a new pdf document, add the cover page and 1-n detail pages. When opening the document in Acrobat the detais pages are displayed correctly except for the radio buttons. The first detail page retains the original field names and the subsequent pages have a suffix added which makes them unique within the document. Each detail page contains two pairs of radio buttons and only one of each pair is retaining the border. This can be seen in the attachment FinalPDF( AddPage).

Code: Select all
Dim doc1 As PdfDocument = New Spire.Pdf.PdfDocument("E:\Development\PDF Booking Forms\Booking Form (Cover).pdf")
        Dim doc2 As PdfDocument = New Spire.Pdf.PdfDocument("E:\Development\PDF Booking Forms\Booking Form (Detail).pdf")
        Dim FinalPDF As PdfDocument = New Spire.Pdf.PdfDocument

        FinalPDF.InsertPage(doc1, 0)
        FinalPDF.InsertPage(doc2, 0)
        FinalPDF.InsertPage(doc2, 0)
        FinalPDF.InsertPage(doc2, 0)
        FinalPDF.SaveToFile("E:\Development\PDF Booking Forms\FinalPDF(AddPage).pdf")


Each approach only produces a partial solution. The append page produces the correctly formatted radio button on the first detail page, but all subsequent detail pages do not display correctly. The add page produces the correct detail pages but one of the radio buttons is not correctly formatted.

highcroft
 
Posts: 3
Joined: Tue Nov 22, 2022 9:03 am

Thu Jan 05, 2023 8:38 am

Hi,

Thanks for your inquiry.
I tested your pdf files and reproduced your issue, the buttons and the boarders of the textbox are not displayed correctly. I have logged this issue into our bug tracking system with the ticket number SPIREPDF-5703, our developers will investigate and fix it. Sorry for the inconvenience caused. Once the issue is fixed, I will inform you in time.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.PDF

cron