This sample java program uses jPDFWriter to create a new PDF file, add a page to it and draw an image and text on the page. // create document PDFDocument pdfDoc = new PDFDocument (); // create a PageFormat of standard letter size // with no margins Paper p = new Paper (); p.setSize(8.5 […]
Articles Tagged: add text
Embed a font in a PDF and write text content with the new font
This little sample code shows how to add a font to a PDF document and than add some text content to the PDF using this newly embedded font, using Qoppa’s PDF library jPDFProcess. // Create a blank document and add a page PDFDocument pdf = new PDFDocument(); PDFPage newPage = pdf.appendNewPage(8.5 * 72, 11 * […]
Create a PDF with a page and draw text and image on it using jPDFProcess
Sample program showing how to create a PDF using jPDFProcess. You first create a PDF, add a page to it then use the Graphics object form the page to draw onto it. On the page we draw text and an image. In this little snippet, the compression used for the image within the PDF document […]