org.mapfish.print
Class PDFCustomBlocks

java.lang.Object
  extended by com.lowagie.text.pdf.PdfPageEventHelper
      extended by org.mapfish.print.PDFCustomBlocks
All Implemented Interfaces:
com.lowagie.text.pdf.PdfPageEvent

public class PDFCustomBlocks
extends com.lowagie.text.pdf.PdfPageEventHelper

Listen to events from the PDF document in order to render the custom ChunkDrawers, the header/footer and the background.


Nested Class Summary
static class PDFCustomBlocks.AbsoluteDrawer
          Base class for the absolute drawers
 
Field Summary
static org.apache.log4j.Logger LOGGER
           
 
Constructor Summary
PDFCustomBlocks(com.lowagie.text.pdf.PdfWriter writer, RenderingContext context)
           
 
Method Summary
 void addAbsoluteDrawer(PDFCustomBlocks.AbsoluteDrawer chunkDrawer)
          Schedule a absolute block (like a !columns or a !map).
 void addChunkDrawer(ChunkDrawer chunkDrawer)
          Register a custom drawer.
 void addError(java.lang.Exception e)
           
 void blockRendered(ChunkDrawer chunkDrawer)
          Called when a custom drawer has been rendered.
 com.lowagie.text.Chunk getOrCreateTotalPagesBlock(com.lowagie.text.Font font)
           
 void onCloseDocument(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
           
 void onEndPage(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
           
 void onStartPage(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
           
 void setBackgroundPdf(java.lang.String backgroundPdf)
           
 void setFooter(HeaderFooter footer, PJsonObject params)
           
 void setHeader(HeaderFooter header, PJsonObject params)
           
 
Methods inherited from class com.lowagie.text.pdf.PdfPageEventHelper
onChapter, onChapterEnd, onGenericTag, onOpenDocument, onParagraph, onParagraphEnd, onSection, onSectionEnd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

public static final org.apache.log4j.Logger LOGGER
Constructor Detail

PDFCustomBlocks

public PDFCustomBlocks(com.lowagie.text.pdf.PdfWriter writer,
                       RenderingContext context)
Method Detail

onStartPage

public void onStartPage(com.lowagie.text.pdf.PdfWriter writer,
                        com.lowagie.text.Document document)
Specified by:
onStartPage in interface com.lowagie.text.pdf.PdfPageEvent
Overrides:
onStartPage in class com.lowagie.text.pdf.PdfPageEventHelper

onEndPage

public void onEndPage(com.lowagie.text.pdf.PdfWriter writer,
                      com.lowagie.text.Document document)
Specified by:
onEndPage in interface com.lowagie.text.pdf.PdfPageEvent
Overrides:
onEndPage in class com.lowagie.text.pdf.PdfPageEventHelper

onCloseDocument

public void onCloseDocument(com.lowagie.text.pdf.PdfWriter writer,
                            com.lowagie.text.Document document)
Specified by:
onCloseDocument in interface com.lowagie.text.pdf.PdfPageEvent
Overrides:
onCloseDocument in class com.lowagie.text.pdf.PdfPageEventHelper

addChunkDrawer

public void addChunkDrawer(ChunkDrawer chunkDrawer)
Register a custom drawer.


blockRendered

public void blockRendered(ChunkDrawer chunkDrawer)
Called when a custom drawer has been rendered.


addAbsoluteDrawer

public void addAbsoluteDrawer(PDFCustomBlocks.AbsoluteDrawer chunkDrawer)
                       throws com.lowagie.text.DocumentException
Schedule a absolute block (like a !columns or a !map).

Throws:
com.lowagie.text.DocumentException

setHeader

public void setHeader(HeaderFooter header,
                      PJsonObject params)

setFooter

public void setFooter(HeaderFooter footer,
                      PJsonObject params)

setBackgroundPdf

public void setBackgroundPdf(java.lang.String backgroundPdf)

addError

public void addError(java.lang.Exception e)

getOrCreateTotalPagesBlock

public com.lowagie.text.Chunk getOrCreateTotalPagesBlock(com.lowagie.text.Font font)
                                                  throws com.lowagie.text.BadElementException
Throws:
com.lowagie.text.BadElementException


Copyright © 2009 Camptocamp SA. All Rights Reserved.