We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Can data be inserted in a PDF?

Imagine an Antique Bookstore app. One part of the app takes a pre-designed PDF and fills in some fields in the header and footer - say Name and Address, collected points and another dozen things including a place or two for signatures. These fields can be filled in from the database (except for the signatures). This I can do.

Further, imagine a large blank space covering, say, two thirds of the height of the page, that is allowed to be filled with details. We know the (X,Y) coordinates of the upper left corner of the blank space. How can we fill in, say, a picture of a book along with the title and author on each row available in the blank space? The rows are say, 3 cm. in height.

The short version: given a PDF form with several fields to be filled in from the db, and a large blank space that serves as a placeholder for writing out a list consisting of pictures and text.  How can we insert images and text into a part of a PDF?
Thanks!

2 Replies

WA Will Autio July 23, 2019 08:51 PM

Ok - so it doesn't look that bad.

// from: https://help.syncfusion.com/file-formats/pdf/working-with-text#drawing-text-in-an-existing-document

//Get first page from document
PdfLoadedPage page = loadedDocument.Pages[0] as PdfLoadedPage;

//Create PDF graphics for the page
PdfGraphics graphics = page.Graphics;

//Set the standard font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 20);

//Draw the text.
graphics.DrawString("Hello world!", font, brush, new Syncfusion.Drawing.PointF(20, 20));

And then you can see it. From there, the rest is careful reading of the docs and trying things.



SL Sowmiya Loganathan Syncfusion Team July 25, 2019 05:25 AM

Hi Will, 

Greetings from Syncfusion. 


The short version:  Given a PDF form with several fields to be filled in from the db.  
We can fill the form fields in PDF document (get data from data base and set that values to form field text). Please refer the below UG documentation link for more details, 


The short version:  A large blank space that serves as a placeholder for writing out a list consisting of pictures and text.  How can we insert images and text into a part of a PDF? 

We can insert text and image in an existing PDF document. Please refer the below UG documentation link for more details, 




Please let us know if you need any further assistance on this. 

Regards, 
Sowmiya L 


Loader.
Live Chat Icon For mobile
Up arrow icon