Search code examples
pdfgenexus

Write text in existing PDF file


I'm developing a WebPanel with GeneXus. I need to write text in a specific position of a pdf file uploaded by the user. How I can do that? I saw "PDF Tools" library but seems that I can add only images to PDF with this library.


Solution

  • I wrote to PDF Tools developer, he helped me and developed a new version of the library with a new method "AddText" available. With this new method it's possible to write text in existing PDF files. This is the link for download:

    LINK

    A code example:

    &result = &PDFTools.AddText(&PDFIn, &PDFOut, &X, &Y, &PageNumber, &Text, &fontSize)
    

    where:

    &PDFIn: initial PDF &PDFOut: output PDF &X: start X position from left to right &Y: start Y position from bottom to top &PageNumber: page number where the text will be included &Text: text to be inserted in the desired (X,Y) location and the specific PageNumber. &fontSize: font size