public class PdfBoxRenderer extends Object implements Closeable, PageSupplier
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Cleanup thread resources.
|
void |
createPDF()
Creates a PDF with setup specified by builder.
|
org.apache.pdfbox.pdmodel.PDDocument |
createPDFKeepOpen()
Creates a PDF with setup specified by builder.
|
void |
createPDFWithoutClosing()
Creates a PDF with setup specified by builder.
|
List<PagePosition<Box>> |
findPagePositionsByID(Pattern pattern) |
void |
finishPDF()
Deprecated.
|
Document |
getDocument() |
float |
getDotsPerPoint() |
PdfBoxFontResolver |
getFontResolver()
Get the PDF-BOX font resolver.
|
float |
getLastContentBottom()
Returns the bottom Y postion in bottom-up PDF units
on the last page of content.
|
List<PagePosition<Layer>> |
getLayerPositions(Layer layer)
Returns a list of page positions for a single layer.
|
List<PagePosition<Layer>> |
getLayersPositions()
Returns a list of page positions for all layers in the document.
|
PDFCreationListener |
getListener() |
PdfBoxOutputDevice |
getOutputDevice() |
org.apache.pdfbox.pdmodel.PDDocument |
getPdfDocument()
Returns the PDDocument or null if it has been closed.
|
float |
getPDFVersion() |
BlockBox |
getRootBox() |
SharedContext |
getSharedContext() |
void |
layout() |
org.apache.pdfbox.pdmodel.PDPage |
requestPage(org.apache.pdfbox.pdmodel.PDDocument doc,
float pageWidth,
float pageHeight,
int pageNumber,
int shadowPageNumber)
Called whenever a page or shadow-page is needed.
|
void |
setListener(PDFCreationListener listener) |
public Document getDocument()
public org.apache.pdfbox.pdmodel.PDDocument getPdfDocument()
public PdfBoxFontResolver getFontResolver()
public float getPDFVersion()
public void layout()
public void createPDF()
throws IOException
IOExceptionpublic void createPDFWithoutClosing()
throws IOException
getPdfDocument().
createPDFKeepOpen() with try-with-resources.IOExceptionpublic org.apache.pdfbox.pdmodel.PDDocument createPDFKeepOpen()
throws IOException
IOException@Deprecated public void finishPDF() throws IOException
IOExceptionpublic PdfBoxOutputDevice getOutputDevice()
public SharedContext getSharedContext()
public BlockBox getRootBox()
public float getDotsPerPoint()
public List<PagePosition<Box>> findPagePositionsByID(Pattern pattern)
public PDFCreationListener getListener()
public void setListener(PDFCreationListener listener)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic org.apache.pdfbox.pdmodel.PDPage requestPage(org.apache.pdfbox.pdmodel.PDDocument doc,
float pageWidth,
float pageHeight,
int pageNumber,
int shadowPageNumber)
PageSupplierrequestPage in interface PageSupplierdoc - PDDocument the page belongs topageWidth - Width of page in PDF points (1/72 inch)pageHeight - Height of page in PDF pointspageNumber - Number of the layout page - this may differ from the PDF document page if there are previous shadow pages.shadowPageNumber - Number of the shadow-page or -1 if on a main page.PDPagepublic float getLastContentBottom()
public List<PagePosition<Layer>> getLayersPositions()
public List<PagePosition<Layer>> getLayerPositions(Layer layer)
getLayersPositions() which will return page
positions for all layers.
WARNING: NOT transform aware. A transformed layer will return page
positions that are not correct.Copyright © 2004–2025. All rights reserved.