Create, Convert and Manipulate PDFs using jRuby and Java PDF Library

Here is a jRuby script sample showing how to use Qoppa’s PDF library jPDFProcess to add text to an existing PDF document and write “Hello World” on the document. Using the flexible Java PDF library jPDProcess, any of the following functions could be performed: Add text and images to a PDF, print a PDF, convert […]

Read More

Preserving text as selectable characters when creating PDF from RTF

Q: We use com.qoppa.pdfWriter.PDFPrinterJob class in Qoppa’s jPDFWriter library to convert an RTF document to PDF. The converted PDF does not seem to contain standard text content. The size of the output PDF (220 KB) is larger than the original RTF (40KB). Is there any way to convert to real text that can be selected […]

Read More

GradientPaint and TexturePaint supported when creating PDFs with jPDFWriter

Qoppa PDF Library jPDFWriter defines a PDFGraphics class which extends Java Graphics2D. Many of the Graphics2D functions are supported (though not all), allowing users to get a graphics object from a PDF page (calling page.createGraphics()) and then drawing onto the page in the same way you would draw to Graphics2D. Graphics2D has a setPaint() method […]

Read More

Paint / print a panel and other Swing components to a PDF document

You can use the free library jPDFWriter to print or paint a JPanel and other Swing components to a PDF document. Here is sample java code to do so: public class PrintPanelToPDF implements Printable { public static void main (String [] args) { try { // create a PDF Printer Job PDFPrinterJob printer = (PDFPrinterJob)PDFPrinterJob.getPrinterJob […]

Read More

v2016R1 jPDFWriter Build Notes

Below are the release notes for the v2016R1 fix branch / minor releases for Qoppa’s Free PDF Library jPDFWriter. Java PDF Library: jPDFWriter v2016R1.03 – January 04 2016 JPDF-934 – Missing content on last row in HTML to PDF Conversion due to location offset issue when creating new pages v2016R1.02 – December 14 2016 JPDF-926 […]

Read More

Is there a way to get support for jPDFWriter?

Q: Do you offer support for jPDFWriter? A: There is no way to subscribe to a support contract for jPDFWriter. Since Qoppa Software team is interested in providing a good collection of Java sample programs that demonstrates the capabilities of jPDFWriter, we try our best to answer questions regarding the free library in this context. […]

Read More

Code Sample: Create your first PDF document “Hello Word” in Java

Java Program to creates a simple PDF document with the text “Hello World” on it using Qoppa’s Free Java PDF library jPDFWriter. /** * Qoppa Software – Source Code Sample */ package jPDFWriterSamples;   import java.awt.Graphics2D; import java.awt.print.PageFormat; import com.qoppa.pdfWriter.PDFDocument; import com.qoppa.pdfWriter.PDFGraphics; import com.qoppa.pdfWriter.PDFPage;   public class HelloWorld { public static void main (String [] […]

Read More

Print method only called once in jPDFWriter

Q: When I am printing to a physical printer with Java, the print method in my Printable gets called several times. When I am printing using Qoppa’s library jPDFWriter to print directly to PDF from Java, the print method only gets called once. Why is this? A: When printing to a physical printer, the Java API can […]

Read More

jPDFWriter Java API

Q: Where can I find jPDFWriter javadoc API? A: You can find the API specification for the latest version of our library jPDFWriter on our website at this link. jPDFWriter is a java library to create PDF documents from Java.

Read More

How to set the blend mode to the PDFGraphics object

We have added a new method to our PDFGraphics object called setBlendMode() that takes a string as an argument (available in our beta build as of November 2011 and will be released in the next official version). The possible blend modes are defined in the PDFGraphics object as public final statics: BLEND_NORMAL, BLEND_MULTIPLY, BLEND_SCREEN, BLEND_OVERLAY, BLEND_DARKEN, BLEND_LIGHTEN, […]

Read More

How to set a font to the PDFGraphics object?

Q: How can I set a specific font to the pdf graphics in jPDFWriter? A: – There are three basic fonts that are supported by all PDF viewers that do not need to be embedded in the document, they are Helvetica, Courier and Times Roman.  To use these fonts, you should use the pre-defined objects […]

Read More

Code Sample: Draw data table to PDF document

Java program to create a PDF document from a data table using Qoppa’s Free Java PDF library jPDFWriter. The program draws the data to the document in a table form, with an optional grid. /** * Qoppa Software – Source Code Sample */ package jPDFWriterSamples;   import java.awt.Graphics; import java.awt.print.PageFormat; import java.awt.print.Printable; import java.awt.print.PrinterException; import […]

Read More

How to convert RTF documents to PDF using jPDFWriter

Q: Can jPDFWriter be used to print RTF documents to PDF? A: Yes, you can use jPDFWriter to do this. Take a look at the loadRTF document method in the PDFDocument class. jPDFWriter does not do the actual rendering of the RTF files. The library uses standard Java classes to load and render rtf documents: […]

Read More

Convert HTML to PDF in Java using Free jPDFWriter

Q: Do you have any sample code that takes an HTML page and outputs it as a PDF file using jPDFWriter? A: We provide a static method to load an HTML document in Qoppa’s Free Java PDF library jPDFWriter. The support for HTML is limited to the support offered by Java classes to load and […]

Read More

Code Sample: Create a PDF from a Text File

This sample program reads a text file and converts it to a PDF document. using Qoppa’s free Java PDF library jPDFWriter. This sample uses the PDFPrinterJob object to “print” the text to the PDF file. /** * Qoppa Software – Source Code Sample */ package jPDFWriterSamples;   import java.awt.Graphics; import java.awt.print.PageFormat; import java.awt.print.Printable; import java.awt.print.PrinterJob; […]

Read More