I have PDF template that is a photo sheet. The sheet holds two photos and their metadata into different form fields on the pdf document. In flutter I have a list of up several hundred photos that I need to use this one PDF sheet to create a single PDF document with all of my photos. I can't seem to figure out how I can use this single pdf template to create multiple pages and fill out each form with unique data.
Currently, we are working on the sample to achieve your requirement and we will provide further details on July 11th, 2023.
Meanwhile, we request you to share code snippet/screenshot/image of the PDF template photo sheet, so that we can provide a similar sample for reference.
Please see the attached photo of the sample pdf sheet. This is a single template that needs to be replicated for a list of photos
Not*: All information in this sample photo is randomized.
Thank you for sharing the details. we are working on the sample to achieve your requirement and we will provide further details on July 11th, 2023.
We have created a sample and output document for your reference. Please check this on your end and let us know the result.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/pdf_demo_sample604418706
Output document:
https://www.syncfusion.com/downloads/support/directtrac/general/pd/EmptyTemplate351895018
Thank you for producing this for me.
This is essentially re-creating the whole pdf by redrawing each text field, and each text individually. While this works, and is the current implementation I have, it is not quite what I was hoping for.
I may receive different types of photo sheets like the example I shared. With different required fields. The PDF I receive will already have the form fields in the PDF with space for the image. This pdf will be just one page though. Is there no way to duplicate this page without redrawing the fields each time?
I can read the pdf multiple times, and create a PDFDocument each time, but this is heavy workload requiring me to read the original PDF from assets, or from a network for each page. And then I need to combine each pdf into one pdf. There seems like there might be a better way to do it this way.
Currently, we do not have support to import pages from existing PDF documents. We have logged the feature for “Support to import pages from existing PDF documents in Flutter” and added it to our feature request list.
As of now, we do not have any immediate plans to implement this feature and we will implement this support in any of our upcoming releases. We usually have an interval of at least three months between releases, at the planning stage of every release cycle, we will review all the open features and we will notify you once this support is included.
You can track the feature status using the feedback from https://www.syncfusion.com/feedback/45217/support-to-import-pages-from-existing-pdf-document.
However, to achieve your requirement, we can use the "createTemplate" method to import the required PDF template from the existing PDF document. But the created template does not contain the form field. So we will have to manually import the form fields or flatten the fields before importing the page as a template.
Kindly use the following link for reference, https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage/createTemplate.html
Kindly download the following sample for reference,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/pdf_demo_sample-262489213