Package com.openhtmltopdf.java2d.api
Class DefaultPageProcessor
java.lang.Object
com.openhtmltopdf.java2d.api.DefaultPageProcessor
- All Implemented Interfaces:
FSPageProcessor
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final int
private final FSPageOutputStreamSupplier
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPageProcessor
(FSPageOutputStreamSupplier osFactory, int imageType, String imageFormat) Creates a page processor which saves each page as an image. -
Method Summary
Modifier and TypeMethodDescriptionCreate a graphics device that can be supplied to useLayoutGraphics.createPage
(int zeroBasedPageNumber, int width, int height) void
finishPage
(FSPage pg)
-
Field Details
-
_osFactory
-
_imageType
private final int _imageType -
_imageFormat
-
-
Constructor Details
-
DefaultPageProcessor
public DefaultPageProcessor(FSPageOutputStreamSupplier osFactory, int imageType, String imageFormat) Creates a page processor which saves each page as an image.- Parameters:
osFactory
- must supply an output stream for each page. The os will be closed by the page processor.imageType
- must be a constant from the BufferedImage class.imageFormat
- must be a format such as png or jpeg
-
-
Method Details
-
createLayoutGraphics
Create a graphics device that can be supplied to useLayoutGraphics. The caller is responsible for calling dispose on the returned device.- Returns:
-
createPage
- Specified by:
createPage
in interfaceFSPageProcessor
-
finishPage
- Specified by:
finishPage
in interfaceFSPageProcessor
-