net.windward.xmlreport
Class ProcessPdf

java.lang.Object
  |
  +--net.windward.xmlreport.ProcessReport
        |
        +--net.windward.xmlreport.ProcessPdf
All Implemented Interfaces:
ProcessPdfAPI, ProcessReportAPI, ProcessReportAPIBase

public class ProcessPdf
extends ProcessReport
implements ProcessPdfAPI

This class is the main program that takes a template stream and a datasource and merges them to create a pdf report stream. The way to use this is to construct a ProcessPdf object, set any options (presently none), then call process.
The calling method must close all streams after calling process. process will flush the output (report) stream before returning. If you wish to sign a pdf file using a Verisign certificate, please go to http://itextpdf.sourceforge.net/howtosign.html

Version:
2.0 2 January 2004

Fields inherited from class net.windward.xmlreport.ProcessReport
TEMPLATE_TYPE_DOCX, TEMPLATE_TYPE_RTF, TEMPLATE_TYPE_UNKNOWN, TEMPLATE_TYPE_WORD_11, TEMPLATE_TYPE_XLSX
 
Fields inherited from interface net.windward.xmlreport.ProcessPdfAPI
ALLOW_ALL, ALLOW_ASSEMBLY, ALLOW_COPY, ALLOW_DEGRADED_PRINTING, ALLOW_FILL_IN, ALLOW_MOD_ANNOTATIONS, ALLOW_MOD_CONTENTS, ALLOW_PRINTING, ALLOW_SCREEN_READERS, COMP_FAST, COMP_MAX, COMP_NONE, FONT_EMBEDED, FONT_INTERNAL, FONT_NO_EMBED
 
Fields inherited from interface net.windward.xmlreport.ProcessReportAPI
CHARSET_DEFAULT, CHARSET_RTF, CHARSET_UNICODE, LOCALE_DEFAULT, LOCALE_SYSTEM, TYP_DOCX, TYP_EXCEL_ML, TYP_HTML, TYP_PDF, TYP_RTF, TYP_TXT, TYP_WORD_ML, TYP_XLS, TYP_XLSX
 
Constructor Summary
ProcessPdf(java.io.InputStream rtfTemplate)
          Create a ProcessPdf object with the passed in template.
ProcessPdf(java.io.InputStream xmlData, java.io.InputStream rtfTemplate, java.io.OutputStream report)
          Create a ProcessPdf object with the passed in template & data streams, writing it to the passed in report stream.
ProcessPdf(java.io.InputStream rtfTemplate, java.io.OutputStream report)
          Create a ProcessPdf object with the passed in template, writing it to the passed in report stream.
 
Method Summary
 ProcessReportAPIBase duplicate(java.io.OutputStream out)
          Creates and returns a copy of this object.
 int getCompressionLevel()
          Get the compression level.
 int getFontLevel()
          Get the font level.
 int getKeyLength()
          Get the password licenseKey length.
 java.lang.String getOwnerPassword()
          Get the owner password for the report.
 int getReportType()
          Get the report format of the output stream.
 int getSecurity()
          Get the security for the created pdf report.
 java.lang.String getUserPassword()
          Get the user password for the report.
static void loadFonts(int fontLevel)
           
 void setCompressionLevel(int level)
          Set the compression level.
 void setFontLevel(int level)
          Set the font level.
 void setKeyLength(int len)
          Set the password licenseKey length.
 void setOwnerPassword(java.lang.String password)
          Set the owner password for the report.
 void setSecurity(int mode)
          Set the security for the created pdf report.
 void setUserPassword(java.lang.String password)
          Set the user password for the report.
 
Methods inherited from class net.windward.xmlreport.ProcessReport
addBean, close, dispose, getBaseDirectory, getCharset, getChartProvider, getCompany, getImportingProvider, getInfo, getKeywords, getLocale, getNumPages, getReport, getSubject, getTitle, getVersion, getVersionMajor, getVersionMinor, getVersionRelease, init, isDebugMode, process, processComplete, processData, processSetup, processSetup, setBaseDirectory, setCharset, setChartProvider, setDebugMode, setKeywords, setLocale, setSubject, setTitle, statLine
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.windward.xmlreport.ProcessReportAPI
setChartProvider
 
Methods inherited from interface net.windward.xmlreport.ProcessReportAPIBase
addBean, close, getBaseDirectory, getCharset, getInfo, getKeywords, getLocale, getNumPages, getReport, getSubject, getTitle, isDebugMode, process, processComplete, processData, processSetup, processSetup, setBaseDirectory, setCharset, setDebugMode, setKeywords, setLocale, setSubject, setTitle
 

Constructor Detail

ProcessPdf

public ProcessPdf(java.io.InputStream rtfTemplate)
           throws LicenseException,
                  SetupException
Create a ProcessPdf object with the passed in template. Objects created with this constructor must call processSetup, processData, and processComplete. Objects created with this constructor cannot call process. The report will be in the pdf format.
Parameters:
rtfTemplate - The report template, as a rtf document.
Throws:
LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.

ProcessPdf

public ProcessPdf(java.io.InputStream rtfTemplate,
                  java.io.OutputStream report)
           throws LicenseException,
                  SetupException
Create a ProcessPdf object with the passed in template, writing it to the passed in report stream. Objects created with this constructor must call processSetup, processData, and processComplete. Objects created with this constructor cannot call process. The report will be in the pdf format.
Parameters:
rtfTemplate - The report template, as a rtf document.
report - The stream to write the report to.
Throws:
LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.

ProcessPdf

public ProcessPdf(java.io.InputStream xmlData,
                  java.io.InputStream rtfTemplate,
                  java.io.OutputStream report)
           throws DataSourceException,
                  LicenseException,
                  SetupException
Create a ProcessPdf object with the passed in template & data streams, writing it to the passed in report stream. The report will be in the pdf format.
Parameters:
xmlData - The xml data that will be placed into the report where there are xml elements.
rtfTemplate - The report template, as a rtf document.
report - The stream to write the report to.
Throws:
DataSourceException - thrown if there is a problem with the datasource.
LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.
Method Detail

duplicate

public ProcessReportAPIBase duplicate(java.io.OutputStream out)
                               throws AlreadyProcessedException,
                                      LicenseException,
                                      SetupException
Creates and returns a copy of this object. You may call this before or after calling processData(). You may then call processData() on the created object. You must call this after calling processSetup() and before calling processComplete(). While this mostly does a deep copy, it does not do a deep copy of bean objects or image data. This will always return a ProcessPdf object.
Specified by:
duplicate in interface ProcessReportAPIBase
Parameters:
out - The stream to write the report to. If null will create a ByteArrayOutputStream.
Throws:
AlreadyProcessedException - thrown if call the process steps out of order or call ones other than data twice.
LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.

loadFonts

public static void loadFonts(int fontLevel)

getReportType

public int getReportType()
Get the report format of the output stream.
Specified by:
getReportType in interface ProcessPdfAPI
Returns:
The type (format) of the output report. Will be TYP_PDF.

setFontLevel

public void setFontLevel(int level)
Set the font level. Basically a higher font level means a more accurate final pdf file - but also a large one. The choices are:
Specified by:
setFontLevel in interface ProcessPdfAPI
Parameters:
level - The font level. Can be 0 - 2.

getFontLevel

public int getFontLevel()
Get the font level. Basically a higher font level means a more accurate final pdf file - but also a large one. The choices are:
Specified by:
getFontLevel in interface ProcessPdfAPI
Returns:
The font level. Will be 0 - 2.

setCompressionLevel

public void setCompressionLevel(int level)
Set the compression level. Basically a higher compression level means a smaller final pdf file - but also a longer processing time. The choices are:
Specified by:
setCompressionLevel in interface ProcessPdfAPI
Parameters:
level - The compression level. Can be 0 - 2.

getCompressionLevel

public int getCompressionLevel()
Get the compression level. Basically a higher compression level means a smaller final pdf file - but also a longer processing time. The choices are:
Specified by:
getCompressionLevel in interface ProcessPdfAPI
Returns:
The compression level. Will be 0 - 2.

setOwnerPassword

public void setOwnerPassword(java.lang.String password)
Set the owner password for the report. Set to "" for no password. If this is not set and UserPassword or Security are set - then a random OwnerPassword sill be created.
Specified by:
setOwnerPassword in interface ProcessPdfAPI
Parameters:
password - The new owner password.

getOwnerPassword

public java.lang.String getOwnerPassword()
Get the owner password for the report. Is "" for no password.
Specified by:
getOwnerPassword in interface ProcessPdfAPI
Returns:
The owner password. "" if no password.

setUserPassword

public void setUserPassword(java.lang.String password)
Set the user password for the report. Set to "" for no password. There is purposely no getUserPassword call.
Specified by:
setUserPassword in interface ProcessPdfAPI
Parameters:
password - The new user password.

getUserPassword

public java.lang.String getUserPassword()
Get the user password for the report. Is "" for no password.
Specified by:
getUserPassword in interface ProcessPdfAPI
Returns:
The user password. "" if no password.

setSecurity

public void setSecurity(int mode)
Set the security for the created pdf report.
Specified by:
setSecurity in interface ProcessPdfAPI
Parameters:
mode - Set to a bitmask of the ALLOW_* final ints.

getSecurity

public int getSecurity()
Get the security for the created pdf report.
Specified by:
getSecurity in interface ProcessPdfAPI
Returns:
A bitmask of the ALLOW_* final ints.

setKeyLength

public void setKeyLength(int len)
Set the password licenseKey length.
Specified by:
setKeyLength in interface ProcessPdfAPI
Parameters:
len - Must be set to 40 or 128.

getKeyLength

public int getKeyLength()
Get the password licenseKey length.
Specified by:
getKeyLength in interface ProcessPdfAPI
Returns:
Will be 40 or 128.


Copyright © 2002 - 2008 Windward Reports - All Rights Reserved. java reporting software