Package ca.cgjennings.apps.arkham.deck
Interface PDFPrintSupport.PDFWriter
-
- Enclosing class:
- PDFPrintSupport
public static interface PDFPrintSupport.PDFWriter
An interface implemented by classes that can provide very basic PDF writing support. To use a PDF writer, follow these steps:- Get a new writer instance by calling
PDFPrintSupport.createPDFWriter()
. - Create a new
PDFPrintSupport.Configuration
object and fill in the members with suitable configuration information. - Load the configuration into the writer by calling
setConfiguration(ca.cgjennings.apps.arkham.deck.PDFPrintSupport.Configuration)
. - Call addPage in sequence for each page you wish to add, supplying an image of the page content.
- Call
close()
after all pages have been added.
This interface may change incompatibly in future versions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPage(java.awt.image.BufferedImage pageImage, double xInPoints, double yInPoints, double widthInPoints, double heightInPoints)
Adds a new page that consists of a single image.void
close()
Closes the PDF file once all pages have been added.void
setConfiguration(PDFPrintSupport.Configuration config)
Sets the configuration information to be used by this writer to create a PDF file.
-
-
-
Method Detail
-
setConfiguration
void setConfiguration(PDFPrintSupport.Configuration config) throws java.io.IOException
Sets the configuration information to be used by this writer to create a PDF file.- Parameters:
config
- configuration details that describe the destination, page size, and basic metadata- Throws:
java.io.IOException
- if an I/O error occurs while initializing the PDF file
-
addPage
void addPage(java.awt.image.BufferedImage pageImage, double xInPoints, double yInPoints, double widthInPoints, double heightInPoints) throws java.io.IOException
Adds a new page that consists of a single image.- Parameters:
pageImage
- an image to be drawn on the pagexInPoints
- the x-offset at which to draw the imageyInPoints
- the y-offset at which to draw the imagewidthInPoints
- the width of the imageheightInPoints
- the height of the image- Throws:
java.io.IOException
- if an I/O error occurs while adding the page
-
close
void close() throws java.io.IOException
Closes the PDF file once all pages have been added.- Throws:
java.io.IOException
- if an I/O error occurs while finishing the PDF file
-
-