org.kuali.kfs.module.purap.pdf
Class PurchaseOrderPdf

java.lang.Object
  extended by com.lowagie.text.pdf.PdfPageEventHelper
      extended by org.kuali.kfs.module.purap.pdf.PurapPdf
          extended by org.kuali.kfs.module.purap.pdf.PurchaseOrderPdf
All Implemented Interfaces:
com.lowagie.text.pdf.PdfPageEvent

public class PurchaseOrderPdf
extends PurapPdf

Base class to handle pdf for purchase order documents.


Field Summary
 
Fields inherited from class org.kuali.kfs.module.purap.pdf.PurapPdf
campusName, cb, environment, headerTable, helv, isPreview, isRetransmit, logo, logoImage, nestedHeaderTable, po, tpl
 
Constructor Summary
PurchaseOrderPdf()
          headerTable pieces need to be public
 
Method Summary
 void generatePdf(PurchaseOrderDocument po, PurchaseOrderTransmitParameters pdfParameters, ByteArrayOutputStream byteArrayOutputStream, boolean isRetransmit, String environment, List<PurchaseOrderItem> retransmitItems)
          Generates the pdf document based on the data in the given PurchaseOrderDocument, the pdf parameters, environment, retransmit items, creates a pdf writer using the given byteArrayOutputStream then write the pdf document into the writer.
 PurchaseOrderPdf getPageEvents()
          Gets a PageEvents object.
 void onOpenDocument(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
          Overrides the method in PdfPageEventHelper from itext to create and set the headerTable and set its logo image if there is a logoImage to be used, creates and sets the nestedHeaderTable and its content.
 void savePdf(PurchaseOrderDocument po, PurchaseOrderParameters pdfParameters, boolean isRetransmit, String environment)
          Invokes the createPdf method to create a pdf document and saves it into a file which name and location are specified in the pdfParameters.
 
Methods inherited from class org.kuali.kfs.module.purap.pdf.PurapPdf
deletePdf, getDateTimeService, getDocument, onCloseDocument, onEndPage, onStartPage
 
Methods inherited from class com.lowagie.text.pdf.PdfPageEventHelper
onChapter, onChapterEnd, onGenericTag, onParagraph, onParagraphEnd, onSection, onSectionEnd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PurchaseOrderPdf

public PurchaseOrderPdf()
headerTable pieces need to be public

Method Detail

onOpenDocument

public void onOpenDocument(com.lowagie.text.pdf.PdfWriter writer,
                           com.lowagie.text.Document document)
Overrides the method in PdfPageEventHelper from itext to create and set the headerTable and set its logo image if there is a logoImage to be used, creates and sets the nestedHeaderTable and its content.

Specified by:
onOpenDocument in interface com.lowagie.text.pdf.PdfPageEvent
Overrides:
onOpenDocument in class com.lowagie.text.pdf.PdfPageEventHelper
Parameters:
writer - The PdfWriter for this document.
document - The document.
See Also:
PdfPageEventHelper.onOpenDocument(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document)

getPageEvents

public PurchaseOrderPdf getPageEvents()
Gets a PageEvents object.

Overrides:
getPageEvents in class PurapPdf
Returns:
a new PageEvents object

generatePdf

public void generatePdf(PurchaseOrderDocument po,
                        PurchaseOrderTransmitParameters pdfParameters,
                        ByteArrayOutputStream byteArrayOutputStream,
                        boolean isRetransmit,
                        String environment,
                        List<PurchaseOrderItem> retransmitItems)
Generates the pdf document based on the data in the given PurchaseOrderDocument, the pdf parameters, environment, retransmit items, creates a pdf writer using the given byteArrayOutputStream then write the pdf document into the writer.

Parameters:
po - The PurchaseOrderDocument to be used to generate the pdf.
pdfParameters - The PurchaseOrderPdfParameters to be used to generate the pdf.
byteArrayOutputStream - The ByteArrayOutputStream where the pdf document will be written to.
isRetransmit - The boolean to indicate whether this is for a retransmit purchase order document.
environment - The current environment used (e.g. DEV if it is a development environment).
retransmitItems - The items selected by the user to be retransmitted.

savePdf

public void savePdf(PurchaseOrderDocument po,
                    PurchaseOrderParameters pdfParameters,
                    boolean isRetransmit,
                    String environment)
Invokes the createPdf method to create a pdf document and saves it into a file which name and location are specified in the pdfParameters.

Parameters:
po - The PurchaseOrderDocument to be used to create the pdf.
pdfParameters - The pdfParameters containing some of the parameters information needed by the pdf for example, the pdf file name and pdf file location, purchasing director name, etc.
isRetransmit - The boolean to indicate whether this is for a retransmit purchase order document.
environment - The current environment used (e.g. DEV if it is a development environment).


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.