Copy Pdf page to new page

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.


6 Replies

IJ Irfana Jaffer Sadhik Syncfusion Team July 7, 2023 05:53 AM UTC

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.



JI Jeremy Isenburg replied to Irfana Jaffer Sadhik July 7, 2023 09:38 PM UTC

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.

photoSheet-min.png



IJ Irfana Jaffer Sadhik Syncfusion Team July 10, 2023 06:10 AM UTC

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.



IJ Irfana Jaffer Sadhik Syncfusion Team July 11, 2023 12:07 PM UTC

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





JI Jeremy Isenburg July 11, 2023 03:57 PM UTC

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.



IJ Irfana Jaffer Sadhik Syncfusion Team July 12, 2023 12:04 PM UTC

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


Loader.
Up arrow icon