Class StandardPdfProducer
java.lang.Object
net.sf.jasperreports.pdf.classic.producer.StandardPdfProducer
- All Implemented Interfaces:
net.sf.jasperreports.pdf.common.PdfProducer
public class StandardPdfProducer
extends Object
implements net.sf.jasperreports.pdf.common.PdfProducer
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected classclassContent byte that opens and closes the marked content sequences of the chunks that carry a structure element, as the text of a phrase is written. -
Constructor Summary
ConstructorsConstructorDescriptionStandardPdfProducer(net.sf.jasperreports.pdf.common.PdfProducerContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPdfPage(byte[] pdfData, float x, float y, float width, float height) net.sf.jasperreports.pdf.common.PdfImageclipImage(net.sf.jasperreports.pdf.common.PdfImage image, float clipWidth, float clipHeight, float translateX, float translateY) voidclose()net.sf.jasperreports.pdf.common.PdfRadioCheckcreateCheckField(float llx, float lly, float urx, float ury, String fieldName, String onValue) net.sf.jasperreports.pdf.common.PdfTextChunkcreateChunk(String text, Map<AttributedCharacterIterator.Attribute, Object> attributes, Locale locale) net.sf.jasperreports.pdf.common.PdfChunkcreateChunk(net.sf.jasperreports.pdf.common.PdfImage imageContainer) net.sf.jasperreports.pdf.common.PdfTextFieldcreateComboField(float llx, float lly, float urx, float ury, String fieldName, String value, String[] choices) net.sf.jasperreports.pdf.common.PdfDocumentcreateDocument(PrintPageFormat pageFormat) net.sf.jasperreports.pdf.common.PdfImagecreateImage(byte[] data, boolean verify) net.sf.jasperreports.pdf.common.PdfTextFieldcreateListField(float llx, float lly, float urx, float ury, String fieldName, String value, String[] choices) Creates the content byte that a phrase which has chunks carrying structure elements is to be laid out on.net.sf.jasperreports.pdf.common.PdfContentprotected voidCreates the annotation of the chunk whose text is being written, if it was postponed until the marked content sequence of the chunk was opened.net.sf.jasperreports.pdf.common.PdfPhrasenet.sf.jasperreports.pdf.common.PdfPhrasecreatePhrase(net.sf.jasperreports.pdf.common.PdfChunk chunk) net.sf.jasperreports.pdf.common.PdfTextFieldcreateTextField(float llx, float lly, float urx, float ury, String fieldName) protected com.lowagie.text.pdf.TextFieldcreateTextFormField(float llx, float lly, float urx, float ury, String fieldName) net.sf.jasperreports.pdf.common.PdfDocumentWritervoiddeferChunkAnnotation(com.lowagie.text.Chunk chunk, Consumer<com.lowagie.text.Rectangle> annotationCreator) Registers a callback that creates an annotation for a chunk once the text layout has determined where on the page the chunk is placed.net.sf.jasperreports.pdf.common.PdfImagedrawImage(JRPrintImage image, Graphics2DRenderable renderer, boolean forceSvgShapes, double renderWidth, double renderHeight) voidendPage()protected StandardPdfProducer.ChunkEventgetChunkEvent(com.lowagie.text.Chunk chunk) Returns the record of the callbacks that the PDF library reports back for a chunk through the generic tag page event, creating it if the chunk does not carry one yet.net.sf.jasperreports.pdf.common.PdfProducerContextcom.lowagie.text.FontgetFont(Map<AttributedCharacterIterator.Attribute, Object> attributes, Locale locale) net.sf.jasperreports.pdf.common.PdfContentcom.lowagie.text.pdf.PdfContentBytenet.sf.jasperreports.pdf.common.PdfStructurecom.lowagie.text.pdf.PdfWriternet.sf.jasperreports.pdf.common.PdfRadioCheckgetRadioField(float llx, float lly, float urx, float ury, String fieldName, String onValue) protected com.lowagie.text.pdf.PdfFormFieldgetRadioGroup(com.lowagie.text.pdf.RadioCheckField radioCheckField) net.sf.jasperreports.pdf.common.PdfOutlineEntrynet.sf.jasperreports.pdf.AbstractPdfTextRenderergetTextRenderer(JRPrintText text, JRStyledText styledText, Locale textLocale, boolean awtIgnoreMissingFont, boolean defaultIndentFirstLine, boolean defaultJustifyLastLine) Deprecated.net.sf.jasperreports.pdf.AbstractPdfTextRenderergetTextRenderer(net.sf.jasperreports.pdf.common.PdfTextRendererContext textContext) voidvoidnewPage()voidregisterChunkMarkedContent(com.lowagie.text.Chunk chunk, StandardStructureEntry markedContentTag) Registers the structure element that the text of a chunk belongs to, so that its marked content sequence can be opened right before the text of the chunk is written.protected voidsetDocumentProperties(com.lowagie.text.Document pdfDocument) protected voidsetFieldChoices(com.lowagie.text.pdf.TextField textField, String value, String[] choices) voidsetForceLineBreakPolicy(boolean forceLineBreakPolicy) voidsetPageSize(PrintPageFormat pageFormat, float pageWidth, float pageHeight) protected booleantoUseSavedLineBreaks(net.sf.jasperreports.pdf.common.PdfTextRendererContext textContext)
-
Constructor Details
-
StandardPdfProducer
public StandardPdfProducer(net.sf.jasperreports.pdf.common.PdfProducerContext context)
-
-
Method Details
-
getContext
public net.sf.jasperreports.pdf.common.PdfProducerContext getContext()- Specified by:
getContextin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
createDocument
- Specified by:
createDocumentin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
setDocumentProperties
protected void setDocumentProperties(com.lowagie.text.Document pdfDocument) -
createWriter
public net.sf.jasperreports.pdf.common.PdfDocumentWriter createWriter(OutputStream os) throws JRException - Specified by:
createWriterin interfacenet.sf.jasperreports.pdf.common.PdfProducer- Throws:
JRException
-
getPdfWriter
public com.lowagie.text.pdf.PdfWriter getPdfWriter() -
createPdfContent
public net.sf.jasperreports.pdf.common.PdfContent createPdfContent()- Specified by:
createPdfContentin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
getPdfContent
public net.sf.jasperreports.pdf.common.PdfContent getPdfContent()- Specified by:
getPdfContentin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
getPdfContentByte
public com.lowagie.text.pdf.PdfContentByte getPdfContentByte() -
initReport
public void initReport()- Specified by:
initReportin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
setForceLineBreakPolicy
public void setForceLineBreakPolicy(boolean forceLineBreakPolicy) - Specified by:
setForceLineBreakPolicyin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
newPage
public void newPage()- Specified by:
newPagein interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
setPageSize
- Specified by:
setPageSizein interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
getChunkEvent
Returns the record of the callbacks that the PDF library reports back for a chunk through the generic tag page event, creating it if the chunk does not carry one yet.The event is fired while the line that contains the chunk is written, right before the text of the chunk goes into the content stream, and a chunk that gets split across lines is reported once for each of its parts. A chunk can only carry a single generic tag, so all the callbacks that it needs share one record.
- Parameters:
chunk- the chunk to register the callbacks for
-
deferChunkAnnotation
public void deferChunkAnnotation(com.lowagie.text.Chunk chunk, Consumer<com.lowagie.text.Rectangle> annotationCreator) Registers a callback that creates an annotation for a chunk once the text layout has determined where on the page the chunk is placed. When the chunk carries a structure element as well, the callback is called after the marked content sequence of the chunk has been opened in that element.- Parameters:
chunk- the chunk to create the annotation forannotationCreator- called with the position of the chunk on the page
-
registerChunkMarkedContent
public void registerChunkMarkedContent(com.lowagie.text.Chunk chunk, StandardStructureEntry markedContentTag) Registers the structure element that the text of a chunk belongs to, so that its marked content sequence can be opened right before the text of the chunk is written.- Parameters:
chunk- the chunk whose text is to be taggedmarkedContentTag- the structure element to add the marked content of the chunk to- See Also:
-
createPendingChunkAnnotation
protected void createPendingChunkAnnotation()Creates the annotation of the chunk whose text is being written, if it was postponed until the marked content sequence of the chunk was opened.- See Also:
-
createMarkedContentCanvas
Creates the content byte that a phrase which has chunks carrying structure elements is to be laid out on.- See Also:
-
endPage
public void endPage()- Specified by:
endPagein interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
close
public void close()- Specified by:
closein interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
getTextRenderer
public net.sf.jasperreports.pdf.AbstractPdfTextRenderer getTextRenderer(net.sf.jasperreports.pdf.common.PdfTextRendererContext textContext) - Specified by:
getTextRendererin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
toUseSavedLineBreaks
protected boolean toUseSavedLineBreaks(net.sf.jasperreports.pdf.common.PdfTextRendererContext textContext) -
getTextRenderer
public net.sf.jasperreports.pdf.AbstractPdfTextRenderer getTextRenderer(JRPrintText text, JRStyledText styledText, Locale textLocale, boolean awtIgnoreMissingFont, boolean defaultIndentFirstLine, boolean defaultJustifyLastLine) Deprecated.Replaced bygetTextRenderer(PdfTextRendererContext).- Specified by:
getTextRendererin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
createImage
public net.sf.jasperreports.pdf.common.PdfImage createImage(byte[] data, boolean verify) throws IOException, JRException - Specified by:
createImagein interfacenet.sf.jasperreports.pdf.common.PdfProducer- Throws:
IOExceptionJRException
-
drawImage
public net.sf.jasperreports.pdf.common.PdfImage drawImage(JRPrintImage image, Graphics2DRenderable renderer, boolean forceSvgShapes, double renderWidth, double renderHeight) throws JRException, IOException - Specified by:
drawImagein interfacenet.sf.jasperreports.pdf.common.PdfProducer- Throws:
JRExceptionIOException
-
clipImage
public net.sf.jasperreports.pdf.common.PdfImage clipImage(net.sf.jasperreports.pdf.common.PdfImage image, float clipWidth, float clipHeight, float translateX, float translateY) throws JRException - Specified by:
clipImagein interfacenet.sf.jasperreports.pdf.common.PdfProducer- Throws:
JRException
-
getFont
public com.lowagie.text.Font getFont(Map<AttributedCharacterIterator.Attribute, Object> attributes, Locale locale) -
createChunk
public net.sf.jasperreports.pdf.common.PdfTextChunk createChunk(String text, Map<AttributedCharacterIterator.Attribute, Object> attributes, Locale locale) - Specified by:
createChunkin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
createChunk
public net.sf.jasperreports.pdf.common.PdfChunk createChunk(net.sf.jasperreports.pdf.common.PdfImage imageContainer) - Specified by:
createChunkin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
createPhrase
public net.sf.jasperreports.pdf.common.PdfPhrase createPhrase()- Specified by:
createPhrasein interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
createPhrase
public net.sf.jasperreports.pdf.common.PdfPhrase createPhrase(net.sf.jasperreports.pdf.common.PdfChunk chunk) - Specified by:
createPhrasein interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
createTextField
public net.sf.jasperreports.pdf.common.PdfTextField createTextField(float llx, float lly, float urx, float ury, String fieldName) - Specified by:
createTextFieldin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
createTextFormField
protected com.lowagie.text.pdf.TextField createTextFormField(float llx, float lly, float urx, float ury, String fieldName) -
createComboField
public net.sf.jasperreports.pdf.common.PdfTextField createComboField(float llx, float lly, float urx, float ury, String fieldName, String value, String[] choices) - Specified by:
createComboFieldin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
setFieldChoices
-
createListField
public net.sf.jasperreports.pdf.common.PdfTextField createListField(float llx, float lly, float urx, float ury, String fieldName, String value, String[] choices) - Specified by:
createListFieldin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
createCheckField
public net.sf.jasperreports.pdf.common.PdfRadioCheck createCheckField(float llx, float lly, float urx, float ury, String fieldName, String onValue) - Specified by:
createCheckFieldin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
getRadioField
public net.sf.jasperreports.pdf.common.PdfRadioCheck getRadioField(float llx, float lly, float urx, float ury, String fieldName, String onValue) - Specified by:
getRadioFieldin interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
getRadioGroup
protected com.lowagie.text.pdf.PdfFormField getRadioGroup(com.lowagie.text.pdf.RadioCheckField radioCheckField) -
getRootOutline
public net.sf.jasperreports.pdf.common.PdfOutlineEntry getRootOutline()- Specified by:
getRootOutlinein interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
getPdfStructure
public net.sf.jasperreports.pdf.common.PdfStructure getPdfStructure()- Specified by:
getPdfStructurein interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
addPdfPage
public void addPdfPage(byte[] pdfData, float x, float y, float width, float height) - Specified by:
addPdfPagein interfacenet.sf.jasperreports.pdf.common.PdfProducer
-
getTextRenderer(PdfTextRendererContext).