|
DynamicPDF by ceTe Software | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cete.dynamicpdf.Document
public class Document
Represents a PDF Document. This is the primary class used to generate the PDF
document. It represents a single PDF Document and is made up of Pages and
Outlines. The document can have a Security
object associated
with it to control document security and encryption. The document can be
output to any object derived from the java.io.OutputStream
class
that supports writing and can easily be integrated with JSP/SERVLET to stream
the document to any Web Server's HTTP output stream.
Licensing:
This class is a DynamicPDF Generator Community Edition
feature. Some properties require additional licensing and are noted
accordingly.
Security
,
OutputStream
Constructor Summary | |
---|---|
Document()
Initializes a new instance of the Document class. |
Method Summary | |
---|---|
static boolean |
addLicense(java.lang.String licenseKey)
Adds the license to the product. |
void |
certify(java.lang.String fieldName,
Certificate certificate,
boolean timestamp,
CertifyingPermission permission)
Certifies with signing and Timestamping the document digitally. |
void |
certify(java.lang.String fieldName,
Certificate certificate,
CertifyingPermission permission)
Certifies with signing the document digitally. |
void |
certify(java.lang.String fieldName,
Certificate certificate,
TimestampServer timestampServer,
CertifyingPermission permission)
Certifies with signing and Timestamping the document digitally. |
byte[] |
draw()
Outputs the generated Document to a byte array. |
void |
draw(java.io.OutputStream outStream)
Outputs the generated Document to the given
OutputStream object. |
void |
draw(java.lang.String filePath)
Outputs the generated Document to a file. |
protected void |
drawRootEntries(DocumentWriter writer)
Outputs the catalog entries to the DocumentWriter . |
void |
drawToWeb(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.io.OutputStream sOut)
Outputs the generated Document to the given
HttpServletResponse object. |
void |
drawToWeb(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.io.OutputStream sOut,
boolean allowBrowserCaching)
Outputs the generated Document to the given
HttpServletResponse object. |
void |
drawToWeb(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.io.OutputStream sOut,
java.lang.String downloadAsFileName)
Outputs the generated Document to the given
HttpServletResponse object. |
void |
drawToWeb(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.io.OutputStream sOut,
java.lang.String downloadAsFileName,
boolean forceDownload)
Outputs the generated Document to the given
HttpServletResponse object. |
static Document |
fromHtml(java.lang.String filePath,
PageDimensions dimensions,
HtmlAreaPadding padding)
|
static Document |
fromHtml(java.lang.String filePath,
PageDimensions dimensions,
HtmlAreaPadding padding,
java.net.URI baseHref)
|
static Document |
fromHtml(java.lang.String filePath,
PageDimensions dimensions,
java.net.URI baseHref)
|
static Document |
fromHtml(java.net.URI uri,
PageDimensions dimensions,
HtmlAreaPadding padding)
|
static Document |
fromHtml(java.net.URI uri,
PageDimensions dimensions,
HtmlAreaPadding padding,
java.net.URI baseHref)
|
static Document |
fromHtml(java.net.URI uri,
PageDimensions dimensions,
java.net.URI baseHref)
|
java.lang.String |
getAuthor()
Gets a value indicating the author of the Document . |
int |
getCompressionLevel()
Gets a value indicating the compression level of the Document . |
java.lang.String |
getCreator()
Gets a value indicating the creator of the Document . |
CustomPropertyList |
getCustomProperties()
Gets a value indicating the custom properties of the Document. |
static PdfFormat |
getDefaultPdfFormat()
Deprecated. as of DynamicPDF v10.0.0 replaced by GlobalSettings.getDefaultOutputPdfFormat() |
static PdfVersion |
getDefaultPdfVersion()
Deprecated. as of DynamicPDF v10.0.0 replaced by GlobalSettings.getDefaultOutputPdfVersion() |
EmbeddedFileList |
getEmbeddedFiles()
Gets an EmbeddedFileList containing the EmbeddedFile for the
document. |
Form |
getForm()
Gets a form object for the PDF document. |
FormFlatteningOptions |
getFormFlattening()
Deprecated. as of DynamicPDF v8.0.0 replaced by Form.getOutput() |
int |
getInitialPage()
Gets a value indicating the initial page of the Document . |
PageLayout |
getInitialPageLayout()
Gets a value indicating the intial layout of the Document. |
PageMode |
getInitialPageMode()
Gets a value indicating the initial page mode of the Document . |
PageZoom |
getInitialPageZoom()
Gets a value indicating the initial zoom of the Document . |
DocumentJavaScriptList |
getJavaScripts()
Gets a DocumentJavaScriptList containing the JavaScript entries for that document. |
java.lang.String |
getKeywords()
Gets a value indicating the keywords of the Document . |
java.lang.String |
getLanguage()
Gets a value indicating the language of the Document. |
DocumentOptimization |
getOptimization()
Gets the document optimization. |
OutlineList |
getOutlines()
Gets an OutlineList object that represents the top level
outlines of the Document . |
OutputIntentList |
getOutputIntents()
Gets the output intent list for the Document. |
DocumentPackage |
getPackage()
Gets the document package. |
PageList |
getPages()
Gets a PageList object that represent the pages of the
Document . |
PdfFormat |
getPdfFormat()
Gets a PdfFormat object that represents the format for the PDF document. |
PdfVersion |
getPdfVersion()
Gets the PDF version of the PDF document. |
PdfXVersion |
getPdfXVersion()
Gets the PDF/X version for the Document. |
java.lang.String |
getProducer()
Gets a value indicating the producer of the Document . |
static int |
getProductBuildNumber()
Gets the product build number. |
static java.lang.String |
getProductVersion()
Gets the product version. |
DocumentReaderEvents |
getReaderEvents()
Gets the reader events of the document. |
SectionList |
getSections()
Gets a SectionList object for the Document . |
Security |
getSecurity()
Gets an object to control the security and encryption of the Document . |
Template |
getStampTemplate()
Gets a Template object for the Document . |
java.lang.String |
getSubject()
Gets a value indicating the subject of the Document . |
TagOptions |
getTag()
Gets a value indicating whether document is tagged. |
Template |
getTemplate()
Gets a Template object for the Document . |
java.lang.String |
getTitle()
Gets a value indicating the title of the Document . |
Trapped |
getTrapped()
Gets a value indicating if trapping information is present in the Document. |
ViewerPreferences |
getViewerPreferences()
Gets a ViewerPreferences object that represent the viewer preferences of the Document . |
XmpMetadata |
getXmpMetadata()
Gets the xmp metadata. |
void |
requireLicense()
Causes the evaluation watermark to display if product is not adequately licensed. |
void |
requireLicense(int level)
Causes the evaluation watermark to display if product is not adequately licensed. |
void |
setAuthor(java.lang.String author)
Sets a value indicating the author of the Document . |
void |
setCompressionLevel(int compressionLevel)
Sets a value indicating the compression level of the Document . |
void |
setCreator(java.lang.String creator)
Sets a value indicating the creator of the Document . |
static void |
setDefaultPdfFormat(PdfFormat pdfFormat)
Deprecated. as of DynamicPDF v10.0.0 replaced by GlobalSettings.setDefaultOutputPdfFormat(PdfFormat) |
static void |
setDefaultPdfVersion(PdfVersion pdfVersion)
Deprecated. as of DynamicPDF v10.0.0 replaced by GlobalSettings.setDefaultOutputPdfVersion(PdfVersion) |
void |
setFormFlattening(FormFlatteningOptions value)
Deprecated. as of DynamicPDF v8.0.0 replaced by Form.setOutput(FormOutput) |
void |
setInitialPage(int initialPage)
Sets a value indicating the initial page of the Document . |
void |
setInitialPageLayout(PageLayout value)
Sets a value indicating the intial layout of the Document. |
void |
setInitialPageMode(PageMode initialPageMode)
Sets a value indicating the initial page mode of the Document . |
void |
setInitialPageZoom(PageZoom initialPageZoom)
Sets a value indicating the initial zoom of the Document . |
void |
setKeywords(java.lang.String keywords)
Sets a value indicating the keywords of the Document . |
void |
setLanguage(java.lang.String value)
sets a value indicating the language of the Document. |
void |
setOptimization(DocumentOptimization value)
Sets the document optimization. |
void |
setPackage(DocumentPackage value)
Sets the document package. |
void |
setPdfFormat(PdfFormat pdfFormat)
Sets a PdfFormat object for the Document . |
void |
setPdfVersion(PdfVersion ver)
Sets the PDF version of the PDF document. |
void |
setPdfXVersion(PdfXVersion value)
sets the PDF/X version for the Document. |
void |
setProducer(java.lang.String producer)
Sets a value indicating the producer of the Document . |
void |
setSecurity(Security security)
Sets an object to control the security and encryption of the Document . |
void |
setStampTemplate(Template template)
Sets a Template object for the Document . |
void |
setSubject(java.lang.String subject)
Sets a value indicating the subject of the Document . |
void |
setTag(TagOptions tagOptions)
Gets a value indicating whether document is tagged. |
void |
setTemplate(Template template)
Sets a Template object for the Document . |
void |
setTitle(java.lang.String title)
Sets a value indicating the title of the Document . |
void |
setTrapped(Trapped value)
Sets a value indicating if trapping information is present in the Document. |
void |
setXmpMetadata(XmpMetadata xmp)
Sets the xmp metadata. |
void |
sign(java.lang.String fieldName,
Certificate certificate)
Sign this document digitally. |
void |
sign(java.lang.String fieldName,
Certificate certificate,
boolean timestamp)
Digitally sign this document with Timestamping. |
void |
sign(java.lang.String fieldName,
Certificate certificate,
TimestampServer timestampServer)
Digitally sign this document with Timestamping. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Document()
Document
class.
Method Detail |
---|
public static int getProductBuildNumber()
public static java.lang.String getProductVersion()
public static boolean addLicense(java.lang.String licenseKey)
licenseKey
- A string representing license key provided to you by
ceTe Software.
public static Document fromHtml(java.lang.String filePath, PageDimensions dimensions, HtmlAreaPadding padding)
public static Document fromHtml(java.lang.String filePath, PageDimensions dimensions, java.net.URI baseHref)
public static Document fromHtml(java.lang.String filePath, PageDimensions dimensions, HtmlAreaPadding padding, java.net.URI baseHref)
public static Document fromHtml(java.net.URI uri, PageDimensions dimensions, HtmlAreaPadding padding)
public static Document fromHtml(java.net.URI uri, PageDimensions dimensions, java.net.URI baseHref)
public static Document fromHtml(java.net.URI uri, PageDimensions dimensions, HtmlAreaPadding padding, java.net.URI baseHref)
public byte[] draw()
Document
to a byte array. View Example
public void draw(java.lang.String filePath)
Document
to a file. View Example
GeneratorException
- If specified path is incorrect.filePath
- the String representing the file path to store the
Document.public void draw(java.io.OutputStream outStream)
Document
to the given
OutputStream
object.
GeneratorException
- If specified stream is incorrect. View ExampleoutStream
- the OutputStream object that receive the
Document
output.public void drawToWeb(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.OutputStream sOut)
Document
to the given
HttpServletResponse
object. View Example
GeneratorException
- If generated PDF can't be write to specified
stream.request
- the HttpServletRequest object that contains the client
request information.response
- the HttpServletResponse object that receive the
Document
output.sOut
- the OutputStream object that receive the
Document
output.public void drawToWeb(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.OutputStream sOut, boolean allowBrowserCaching)
Document
to the given
HttpServletResponse
object. View Example
GeneratorException
- If generated PDF can't be write to specified
stream.request
- the HttpServletRequest object that contains the client
request information.response
- the HttpServletResponse object that receive the
Document
output.sOut
- the OutputStream object that receive the
Document
output.allowBrowserCaching
- the boolean value which specifies if the
browser should be allowed to cache the Document
.public void drawToWeb(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.OutputStream sOut, java.lang.String downloadAsFileName)
Document
to the given
HttpServletResponse
object. View Example
GeneratorException
- If generated PDF can't be write to specified
stream.request
- the HttpServletRequest object that contains the client
request information.response
- the HttpServletResponse object that receive the
Document
output.sOut
- the OutputStream object that receive the
Document
output.downloadAsFileName
- the String which specifies the file name of the
document if it is downloaded.public void drawToWeb(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.OutputStream sOut, java.lang.String downloadAsFileName, boolean forceDownload)
Document
to the given
HttpServletResponse
object. View Example
GeneratorException
- If generated PDF can't be write to specified
stream.request
- the HttpServletRequest object that contains the client
request information.response
- the HttpServletResponse object that receive the
Document
output.sOut
- the OutputStream object that receive the
Document
output.downloadAsFileName
- the String which specifies the file name of the
document if it is downloaded.forceDownload
- the boolean value which specifies if the Save As
dialog should appear.public void requireLicense(int level)
level
- the evaluation watermark to display if product is not
adequately licensed.public void requireLicense()
public void sign(java.lang.String fieldName, Certificate certificate)
fieldName
- Field name of the signature.certificate
- Reference of type Certificate
View Example
public void sign(java.lang.String fieldName, Certificate certificate, boolean timestamp)
fieldName
- Field name of the signature.certificate
- Reference of type Certificate
timestamp
- Timestamp the document using details from the
certificate.Certificate
public void sign(java.lang.String fieldName, Certificate certificate, TimestampServer timestampServer)
fieldName
- Field name of the signature.certificate
- Reference of type Certificate
.timestampServer
- Reference of type TimestampServer
.Certificate
,
TimestampServer
public void certify(java.lang.String fieldName, Certificate certificate, CertifyingPermission permission)
fieldName
- Field name of the signature.certificate
- Reference of type Certificate
permission
- CertifyingPermission
for the signature.Certificate
,
CertifyingPermission
public void certify(java.lang.String fieldName, Certificate certificate, TimestampServer timestampServer, CertifyingPermission permission)
fieldName
- Field name of the signature.certificate
- Reference of type Certificate
timestampServer
- Reference of type TimestampServer
.permission
- CertifyingPermission
for the signature.Certificate
,
TimestampServer
,
CertifyingPermission
public void certify(java.lang.String fieldName, Certificate certificate, boolean timestamp, CertifyingPermission permission)
fieldName
- Field name of the signature.certificate
- Reference of type Certificate
timestamp
- Timestamp the document using details from the
certificate.permission
- CertifyingPermission
for the signature.Certificate
,
CertifyingPermission
public static PdfFormat getDefaultPdfFormat()
GlobalSettings.getDefaultOutputPdfFormat()
PdfFormat
public static void setDefaultPdfFormat(PdfFormat pdfFormat)
GlobalSettings.setDefaultOutputPdfFormat(PdfFormat)
PdfFormat
object for the Document
.
pdfFormat
- the documents PdfFormat object.PdfFormat
public static PdfVersion getDefaultPdfVersion()
GlobalSettings.getDefaultOutputPdfVersion()
PdfVersion
public static void setDefaultPdfVersion(PdfVersion pdfVersion)
GlobalSettings.setDefaultOutputPdfVersion(PdfVersion)
PdfVersion
object for the Document
.
pdfVersion
- the documents PdfVersion object.PdfVersion
public ViewerPreferences getViewerPreferences()
Document
.
ViewerPreferences
public void setTemplate(Template template)
Template
object for the Document
.
template
- the documents Template object.Template
public Template getTemplate()
Template
object for the Document
.
Template
public void setStampTemplate(Template template)
Template
object for the Document
. All
page elements within this Template will appear in the foreground of the
other contents of the PDF.
template
- the documents Template object.Template
public Template getStampTemplate()
Template
object for the Document
.
Template
public SectionList getSections()
SectionList
object for the Document
.
Used to break a document into section.
SectionList
public void setPdfFormat(PdfFormat pdfFormat)
PdfFormat
object for the Document
.
pdfFormat
- the documents PdfFormat object.PdfFormat
public PdfFormat getPdfFormat()
PdfFormat
public OutputIntentList getOutputIntents()
public Trapped getTrapped()
public void setTrapped(Trapped value)
value
- indicating if trapping information is present in the
Document.public DocumentReaderEvents getReaderEvents()
public DocumentPackage getPackage()
public void setPackage(DocumentPackage value)
value
- the document package.public PdfXVersion getPdfXVersion()
public void setPdfXVersion(PdfXVersion value)
value
- the PDF/X version for the Document.public PageList getPages()
PageList
object that represent the pages of the
Document
.
Document
.PageList
public OutlineList getOutlines()
OutlineList
object that represents the top level
outlines of the Document
.
Licensing:
This class is a DynamicPDF Generator Professional
Edition feature. One of the following licenses is required for
non-evaluation usage:
OutlineList
public void setInitialPageZoom(PageZoom initialPageZoom)
Document
.
initialPageZoom
- the PageZoom of the document.PageZoom
public PageZoom getInitialPageZoom()
Document
.
PageZoom
public void setInitialPageMode(PageMode initialPageMode)
Document
.
initialPageMode
- the PageMode of the document.PageMode
public PageMode getInitialPageMode()
Document
.
PageMode
public void setInitialPage(int initialPage)
Document
.
initialPage
- the integer value indicating the documents initial
page.public PageLayout getInitialPageLayout()
public void setInitialPageLayout(PageLayout value)
value
- the intial layout of the Document.public int getInitialPage()
Document
.
public java.lang.String getProducer()
Document
. This
value appears as a property of the generated PDF document.
public void setProducer(java.lang.String producer)
Document
. This
value appears as a property of the generated PDF document.
producer
- the String value indicating the documents producer.public void setAuthor(java.lang.String author)
Document
. This
value appears as a property of the generated PDF document.
author
- the String value indicating the documents author.public java.lang.String getAuthor()
Document
. This
value appears as a property of the generated PDF document.
public java.lang.String getLanguage()
public void setLanguage(java.lang.String value)
value
- the language of the Document.public void setCreator(java.lang.String creator)
Document
. This
value appears as a property of the generated PDF document.
creator
- the String value indicating the documents creator.public java.lang.String getCreator()
Document
. This
value appears as a property of the generated PDF document.
public void setKeywords(java.lang.String keywords)
Document
. This
value appears as a property of the generated PDF document.
keywords
- A comma seperated string value indicating the document's
keywords. Each keyword should be seperated by a comma.public java.lang.String getKeywords()
Document
. This
value appears as a property of the generated PDF document.
public void setSubject(java.lang.String subject)
Document
. This
value appears as a property of the generated PDF document.
subject
- the String value indicating the documents subject.public java.lang.String getSubject()
Document
. This
value appears as a property of the generated PDF document.
public void setTitle(java.lang.String title)
Document
. This
value appears as a property of the generated PDF document.
title
- the String value indicating the documents title.public java.lang.String getTitle()
Document
. This
value appears as a property of the generated PDF document.
public CustomPropertyList getCustomProperties()
View Example
public void setCompressionLevel(int compressionLevel)
Document
. A value from 0 to 9 indicating the compression
level of the document. Six (6) is the default. Zero (0) represents no
compression and nine (9) represents the best compression. This value will
only affect the compression of the content streams of the documents
pages. Depending on the type of document you are creating, it may not
affect the size significantly.
java.lang.IllegalArgumentException
- Compression level should be 0-9compressionLevel
- the int value used to set the compression level
of the Document
public int getCompressionLevel()
Document
.
Document
.public void setSecurity(Security security)
Document
.
Licensing:
This property is a DynamicPDF Generator Enterprise
Edition feature. One of the following licenses is required for
non-evaluation usage:
security
- Security object which controls the encryption and
security of the generated PDF document.public Security getSecurity()
Document
.
Licensing:
This property is a DynamicPDF Generator Enterprise
Edition feature. One of the following licenses is required for
non-evaluation usage:
public Form getForm()
Licensing:
Reading the values or properties of a field is a
DynamicPDF Merger Standard Edition feature (for modifying field values
see below). One of the following licenses is required for non-evaluation
usage:
Modiying the values of the fields (i.e. form filling) is a Professional Edition Feature. One of the following licenses is required for non-evaluation usage:
public PdfVersion getPdfVersion()
public void setPdfVersion(PdfVersion ver)
ver
- the PDF version of the PDF document.public void setXmpMetadata(XmpMetadata xmp)
xmp
- the xmp metadata. View Example
Licensing:
This property is a DynamicPDF Generator Enterprise
Edition feature. One of the following licenses is required for
non-evaluation usage:
public XmpMetadata getXmpMetadata()
Licensing:
This property is a DynamicPDF Generator Enterprise
Edition feature. One of the following licenses is required for
non-evaluation usage:
public EmbeddedFileList getEmbeddedFiles()
EmbeddedFileList
containing the EmbeddedFile for the
document.
EmbeddedFileList
containing the EmbeddedFile for
the document.public DocumentJavaScriptList getJavaScripts()
Licensing:
This property is a DynamicPDF Generator Enterprise
Edition feature. One of the following licenses is required for
non-evaluation usage:
DocumentJavaScriptList
protected void drawRootEntries(DocumentWriter writer)
DocumentWriter
.
writer
- DocumentWriter
object to write the catalog
entries.DocumentWriter
public TagOptions getTag()
public void setTag(TagOptions tagOptions)
tagOptions
- a value indicating whether document is tagged.public void setFormFlattening(FormFlatteningOptions value)
Form.setOutput(FormOutput)
value
- the form flattening options for the PDF document.public FormFlatteningOptions getFormFlattening()
Form.getOutput()
public DocumentOptimization getOptimization()
public void setOptimization(DocumentOptimization value)
value
- document optimization value.
|
DynamicPDF by ceTe Software | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |