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)
  • 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:
      getContext in interface net.sf.jasperreports.pdf.common.PdfProducer
    • createDocument

      public net.sf.jasperreports.pdf.common.PdfDocument createDocument(PrintPageFormat pageFormat)
      Specified by:
      createDocument in interface net.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:
      createWriter in interface net.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:
      createPdfContent in interface net.sf.jasperreports.pdf.common.PdfProducer
    • getPdfContent

      public net.sf.jasperreports.pdf.common.PdfContent getPdfContent()
      Specified by:
      getPdfContent in interface net.sf.jasperreports.pdf.common.PdfProducer
    • getPdfContentByte

      public com.lowagie.text.pdf.PdfContentByte getPdfContentByte()
    • initReport

      public void initReport()
      Specified by:
      initReport in interface net.sf.jasperreports.pdf.common.PdfProducer
    • setForceLineBreakPolicy

      public void setForceLineBreakPolicy(boolean forceLineBreakPolicy)
      Specified by:
      setForceLineBreakPolicy in interface net.sf.jasperreports.pdf.common.PdfProducer
    • newPage

      public void newPage()
      Specified by:
      newPage in interface net.sf.jasperreports.pdf.common.PdfProducer
    • setPageSize

      public void setPageSize(PrintPageFormat pageFormat, float pageWidth, float pageHeight)
      Specified by:
      setPageSize in interface net.sf.jasperreports.pdf.common.PdfProducer
    • getChunkEvent

      protected StandardPdfProducer.ChunkEvent getChunkEvent(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.

      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 for
      annotationCreator - 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 tagged
      markedContentTag - 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

      public StandardPdfProducer.MarkedContentCanvas 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:
      endPage in interface net.sf.jasperreports.pdf.common.PdfProducer
    • close

      public void close()
      Specified by:
      close in interface net.sf.jasperreports.pdf.common.PdfProducer
    • getTextRenderer

      public net.sf.jasperreports.pdf.AbstractPdfTextRenderer getTextRenderer(net.sf.jasperreports.pdf.common.PdfTextRendererContext textContext)
      Specified by:
      getTextRenderer in interface net.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.
      Specified by:
      getTextRenderer in interface net.sf.jasperreports.pdf.common.PdfProducer
    • createImage

      public net.sf.jasperreports.pdf.common.PdfImage createImage(byte[] data, boolean verify) throws IOException, JRException
      Specified by:
      createImage in interface net.sf.jasperreports.pdf.common.PdfProducer
      Throws:
      IOException
      JRException
    • drawImage

      public net.sf.jasperreports.pdf.common.PdfImage drawImage(JRPrintImage image, Graphics2DRenderable renderer, boolean forceSvgShapes, double renderWidth, double renderHeight) throws JRException, IOException
      Specified by:
      drawImage in interface net.sf.jasperreports.pdf.common.PdfProducer
      Throws:
      JRException
      IOException
    • 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:
      clipImage in interface net.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:
      createChunk in interface net.sf.jasperreports.pdf.common.PdfProducer
    • createChunk

      public net.sf.jasperreports.pdf.common.PdfChunk createChunk(net.sf.jasperreports.pdf.common.PdfImage imageContainer)
      Specified by:
      createChunk in interface net.sf.jasperreports.pdf.common.PdfProducer
    • createPhrase

      public net.sf.jasperreports.pdf.common.PdfPhrase createPhrase()
      Specified by:
      createPhrase in interface net.sf.jasperreports.pdf.common.PdfProducer
    • createPhrase

      public net.sf.jasperreports.pdf.common.PdfPhrase createPhrase(net.sf.jasperreports.pdf.common.PdfChunk chunk)
      Specified by:
      createPhrase in interface net.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:
      createTextField in interface net.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:
      createComboField in interface net.sf.jasperreports.pdf.common.PdfProducer
    • setFieldChoices

      protected void setFieldChoices(com.lowagie.text.pdf.TextField textField, String value, String[] choices)
    • 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:
      createListField in interface net.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:
      createCheckField in interface net.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:
      getRadioField in interface net.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:
      getRootOutline in interface net.sf.jasperreports.pdf.common.PdfProducer
    • getPdfStructure

      public net.sf.jasperreports.pdf.common.PdfStructure getPdfStructure()
      Specified by:
      getPdfStructure in interface net.sf.jasperreports.pdf.common.PdfProducer
    • addPdfPage

      public void addPdfPage(byte[] pdfData, float x, float y, float width, float height)
      Specified by:
      addPdfPage in interface net.sf.jasperreports.pdf.common.PdfProducer