|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.docmosis.document.converter.ConversionInstruction
public class ConversionInstruction
This class is used to specify various settings for a document to be rendered. Control features include:
Nested Class Summary | |
---|---|
static class |
ConversionInstruction.OfficeEngineProperties
Properties specifically for the underlying office engine |
Field Summary | |
---|---|
static int |
PDF_INITIAL_VIEW_DEFAULT
default view with neither outlines or thumbnails |
static int |
PDF_INITIAL_VIEW_OUTLINE
initial view with outline pane visible |
static int |
PDF_INITIAL_VIEW_THUMBNAIL
initial view with thumbnail pane visible |
static int |
PDF_RESTRICTED_CHANGES_FILLING_OF_FORM_FIELDS
Pdf restricted with filling of form fields allowed |
static int |
PDF_RESTRICTED_CHANGES_FILLING_OF_FORM_FIELDS_AND_COMMENTING
Pdf restricted with filling of form fields and commenting allowed |
static int |
PDF_RESTRICTED_CHANGES_INSERT_DELETE_ROTATE_PAGES
Pdf restricted with inserting deleting and rotating pages allowed |
static int |
PDF_RESTRICTED_CHANGES_NO_CHANGES_ALLOWED
Pdf restricted with no changes allowed |
static int |
PDF_RESTRICTED_CHANGES_PAGE_EXTRACTION_RESTRICTED
Pdf restricted with inserting deleting and rotating pages allowed, filling of form fields and commenting allowed. |
static int |
PDF_RESTRICTED_PRINTING_CANNOT_BE_PRINTED
Restricted printing to cannot be printed |
static int |
PDF_RESTRICTED_PRINTING_LOW_RESOLUTION
Restricted printing to low resolution only |
static int |
PDF_RESTRICTED_PRINTING_MAX_RESOLUTION
Restricted printing to maximum resolution |
Constructor Summary | |
---|---|
ConversionInstruction()
Create a blank conversion instruction. |
|
ConversionInstruction(ConversionInstruction other)
Create a standalone copy of the given conversion instruction. |
Method Summary | |
---|---|
boolean |
cleanupDataProvider()
Determine if the DataProvider should be cleaned up at the end of the render process. |
boolean |
compressSingleDocument()
Determine whether to compress (zip) the resulting document if only a single format is being used. |
boolean |
equals(Object obj)
|
ConversionFormat[] |
getConversionFormats()
Get the conversion formats specified by this instruction. |
Map |
getConversionProperties(ConversionFormat format)
|
String |
getConverterGroupName()
Get the name of the Converter Group to use to render the document. |
String |
getOutputFileName()
|
String |
getOutputFileNameWithFormats()
Determine the default output file name that will be produced based on: outputFileName conversionFormats compressSingleDocument The effect is to ensure the default outputName has the correct extension based on what will be generated (".zip" for multiple files or compressing single format, otherwise the extension for the type). |
RendererRegistry |
getRendererRegistry()
Get the collection of renderers registry that have been set into this instruction. |
int |
hashCode()
|
boolean |
includesFormat(ConversionFormat format)
Determine if the specified format is included in the conversion formats currently set in this instruction. |
boolean |
isCompressingSingleDocument()
Determine if a single resulting document should be automatically zipped to create a smaller file. |
boolean |
isConvertOnly()
Determine if this instruction is flagged as "convert only" meaning extra processing (such as updating TOC and counting pages) is not done. |
boolean |
producesZippedDocument()
Determines if this instruction produces a zipped result. |
ConversionInstruction |
setCleanupDataProvider(boolean cleanupDataProvider)
Specify whether the data provider should be cleaned up at the end of the render process. |
ConversionInstruction |
setCompressingSingleDocument(boolean compressingSingleDocument)
Specify whether a single resulting document should be automatically zipped to create a smaller file. |
ConversionInstruction |
setConversionFormats(ConversionFormat[] conversionFormats)
Specify the conversion formats for the returned result. |
ConversionInstruction |
setConverterGroupName(String converterGroupName)
Specify the name of the converter pool group to which this task is to be assigned. |
ConversionInstruction |
setConvertOnly(boolean convertOnly)
Specify this instruction is flagged as "convert only" meaning extra processing (such as updating TOC and counting pages) is not done. |
ConversionInstruction |
setOutputFileName(String outputFileName)
Specify the filename for output. |
ConversionInstruction |
setPdfArchiveMode(boolean archiveMode)
Set whether to use PDF archive mode or not. |
ConversionInstruction |
setPdfDisplayTitle(boolean title)
Set whether to display the document title (if available) in the PDF window title bar. |
ConversionInstruction |
setPdfEmbedStandardFonts(boolean embed)
Specifies whether to embed the 14 standard PDF fonts or not. |
ConversionInstruction |
setPdfHideViewerMenubar(boolean hide)
Specifies whether to hide the PDF viewer menubar when the document is active. |
ConversionInstruction |
setPdfHideViewerToolbar(boolean hide)
Specifies whether to hide the PDF viewer toolbar when the document is active. |
ConversionInstruction |
setPdfHideViewerWindowControls(boolean hide)
Specifies whether to hide the PDF viewer controls when the document is active. |
ConversionInstruction |
setPdfImageCompressionQuality(int quality)
Specifies quality of the JPG export. |
ConversionInstruction |
setPdfInitialView(int view)
Specifies how the PDF document should be displayed when opened. |
ConversionInstruction |
setPdfLosslessConversion(boolean lossless)
Specifies if graphics are exported to PDF using a lossless compression eg. |
ConversionInstruction |
setPdfMagnification(int magnification,
int zoom)
Set the magnification and zoom. |
ConversionInstruction |
setPdfOpenInFullScreen(boolean fullScreen)
Set whether to open the PDF in fullscreen mode or not. |
ConversionInstruction |
setPdfPasswordProtect(String password)
Set a password to read-protect a PDF document. |
ConversionInstruction |
setPdfRestrictAllowAccessibilty(boolean restrictAllowAccessibility)
Set whether the document content can be extracted to be used in accessibility applications for a PDF document. |
ConversionInstruction |
setPdfRestrictCopy(boolean restrictCopy)
Set whether the pages and the document content can be extracted to be used in other documents (copy and paste) for a PDF document. |
ConversionInstruction |
setPdfRestrictEditing(int changes)
Specifies what changes are allowed for a PDF document. |
ConversionInstruction |
setPdfRestrictPassword(String password)
Set a password to restrict permissions for a PDF document. |
ConversionInstruction |
setPdfRestrictPrinting(int printing)
Specifies what printing is allowed for a PDF document. |
ConversionInstruction |
setPdfTagged(boolean tagged)
Specify whether the PDF should be tagged. |
ConversionInstruction |
setPdfWatermark(String text)
Set whether to use a watermark or not. |
ConversionInstruction |
setPdfWatermarkColor(String colorHexValue)
Specifies the color of the pdf watermark. |
ConversionInstruction |
setPdfWatermarkFontName(String fontName)
Specifies the font name of the pdf watermark. |
ConversionInstruction |
setPdfWatermarkFontSize(int fontSize)
Specifies the font size of the pdf watermark. |
ConversionInstruction |
setPdfWatermarkRotation(int rotationAngle)
Specifies the rotation angle of the pdf watermark. |
ConversionInstruction |
setRenderer(Class forClass,
FieldRenderer renderer)
Set a renderer against the given Class for use with this instruction. |
ConversionInstruction |
setRenderer(String name,
FieldRenderer renderer)
Set a renderer with the given name for use with this instruction. |
ConversionInstruction |
setWordPasswordProtect(String password)
Set an encrypted password to protect a Word document. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PDF_INITIAL_VIEW_DEFAULT
public static final int PDF_INITIAL_VIEW_OUTLINE
public static final int PDF_INITIAL_VIEW_THUMBNAIL
public static final int PDF_RESTRICTED_PRINTING_CANNOT_BE_PRINTED
public static final int PDF_RESTRICTED_PRINTING_LOW_RESOLUTION
public static final int PDF_RESTRICTED_PRINTING_MAX_RESOLUTION
public static final int PDF_RESTRICTED_CHANGES_NO_CHANGES_ALLOWED
public static final int PDF_RESTRICTED_CHANGES_INSERT_DELETE_ROTATE_PAGES
public static final int PDF_RESTRICTED_CHANGES_FILLING_OF_FORM_FIELDS
public static final int PDF_RESTRICTED_CHANGES_FILLING_OF_FORM_FIELDS_AND_COMMENTING
public static final int PDF_RESTRICTED_CHANGES_PAGE_EXTRACTION_RESTRICTED
Constructor Detail |
---|
public ConversionInstruction()
public ConversionInstruction(ConversionInstruction other)
other
- the instruction to copyMethod Detail |
---|
public String getOutputFileName()
public String getOutputFileNameWithFormats()
public ConversionInstruction setOutputFileName(String outputFileName)
outputFileName
- the name of the file
public boolean isCompressingSingleDocument()
public ConversionFormat[] getConversionFormats()
public ConversionInstruction setWordPasswordProtect(String password)
password
- the password to open the Word document; null removes any
current passwords.
public ConversionInstruction setPdfPasswordProtect(String password)
password
- the password to open the PDF document
public ConversionInstruction setPdfMagnification(int magnification, int zoom) throws IllegalArgumentException
magnification
- the magnification rule to use as follows:
0= Opens with default zoom magnification.
1= Opens magnified to fit the entire page within the window.
2= Opens magnified to fit the entire page width within the window.
3= Opens magnified to fit the entire width of its bounding box within the window (cuts out margins).
4= Opens with the zoom level specified in the zoom property.
The default is 0.zoom
- only applicable if the magnification is 4. Zoom determines
the percentage zoom level.
IllegalArgumentException
public ConversionInstruction setPdfArchiveMode(boolean archiveMode) throws IllegalArgumentException
archiveMode
- true to use PDF archive mode; false otherwise. Default is false.
IllegalArgumentException
public ConversionInstruction setPdfImageCompressionQuality(int quality) throws IllegalArgumentException
quality
- Minimum inclusive value: 1. Represents lowest value that can be used.
The lower the value, the less good is the compression quality and the bigger is be
the file size.
Maximum inclusive value:100. Represents highest value that can be used. The higher
the value, the better is the compression quality and the smaller is the file size.
The default is 90.
IllegalArgumentException
public ConversionInstruction setPdfInitialView(int view) throws IllegalArgumentException
view
- PDF_INITIAL_VIEW_DEFAULT = Select the default viewer mode, neither outlines or thumb nails.
PDF_INITIAL_VIEW_OUTLINE = The document is opened with outline pane opened.
PDF_INITIAL_VIEW_THUMBNAIL = The document is opened with thumb nail pane opened.
The default value is 0.
IllegalArgumentException
- if an invalid view is providedpublic ConversionInstruction setPdfLosslessConversion(boolean lossless)
lossless
- true to use lossless compression; false to use normal
compression; default is false; setting this property to true will
override any calls to setPdfImageCompressionQuality().
public ConversionInstruction setPdfEmbedStandardFonts(boolean embed)
embed
- true to embed standard fonts; false to not do so; default is false.
public ConversionInstruction setPdfWatermark(String text)
text
- the text of the watermark to use. Use null to set no watermark.
Default is null.
public ConversionInstruction setPdfWatermarkColor(String colorHexValue) throws IllegalArgumentException
IllegalArgumentException
public ConversionInstruction setPdfWatermarkFontSize(int fontSize) throws IllegalArgumentException
IllegalArgumentException
public ConversionInstruction setPdfWatermarkFontName(String fontName) throws IllegalArgumentException
IllegalArgumentException
public ConversionInstruction setPdfWatermarkRotation(int rotationAngle) throws IllegalArgumentException
IllegalArgumentException
public ConversionInstruction setPdfOpenInFullScreen(boolean fullScreen)
fullScreen
- true to open the PDF in full screen mode; false otherwise.
public ConversionInstruction setPdfDisplayTitle(boolean title)
title
- true to display the document title; false to just display the
file name; default is to just display the file name.
public ConversionInstruction setPdfHideViewerMenubar(boolean hide)
hide
- true to hide the view menubar; default is false.
public ConversionInstruction setPdfHideViewerToolbar(boolean hide)
hide
- true to hide the viewer toolbar ; default is false.
public ConversionInstruction setPdfHideViewerWindowControls(boolean hide)
hide
- true to hide the viewer controls; default is false.
public ConversionInstruction setPdfTagged(boolean tagged)
tagged
- if true, the PDF will be tagged.
public ConversionInstruction setPdfRestrictPassword(String password)
password
- the password to change permissions of the PDF document
public ConversionInstruction setPdfRestrictPrinting(int printing) throws IllegalArgumentException
printing
- PDF_RESTRICTED_PRINTING_CANNOT_BE_PRINTED = The document cannot be printed.
PDF_RESTRICTED_PRINTING_LOW_RESOLUTION = The document can be printed at low resolution only.
PDF_RESTRICTED_PRINTING_MAX_RESOLUTION = The document can be printed at maximum resolution.
The default value is 2.
IllegalArgumentException
- if an invalid printing value is providedpublic ConversionInstruction setPdfRestrictEditing(int changes) throws IllegalArgumentException
changes
- PDF_RESTRICTED_CHANGES_NO_CHANGES_ALLOWED = The document cannot be changed.
PDF_RESTRICTED_CHANGES_INSERT_DELETE_ROTATE_PAGES = Inserting deleting and rotating pages is allowed.
PDF_RESTRICTED_CHANGES_FILLING_OF_FORM_FIELDS = Filling of form field is allowed.
PDF_RESTRICTED_CHANGES_FILLING_OF_FORM_FIELDS_AND_COMMENTING = Both filling of form field and commenting is allowed.
PDF_RESTRICTED_CHANGES_PAGE_EXTRACTION_RESTRICTED = All the changes of the previous selections are permitted, with the only exclusion of page extraction (copy).
The default value is 4.
IllegalArgumentException
- if an invalid changes value is providedpublic ConversionInstruction setPdfRestrictCopy(boolean restrictCopy)
restrictCopy
- if true, copy and paste of content is not allowed.
public ConversionInstruction setPdfRestrictAllowAccessibilty(boolean restrictAllowAccessibility)
restrictAllowAccessibility
- if true, content cannot be extracted for use in accessibility applications.
public Map getConversionProperties(ConversionFormat format)
public boolean compressSingleDocument()
public ConversionInstruction setCompressingSingleDocument(boolean compressingSingleDocument)
compressingSingleDocument
- if true, single documents will be zipped.
public ConversionInstruction setConversionFormats(ConversionFormat[] conversionFormats)
conversionFormats
- the array of formats desired
public String getConverterGroupName()
public ConversionInstruction setConverterGroupName(String converterGroupName)
converterGroupName
- the name of the group.
public boolean cleanupDataProvider()
public ConversionInstruction setCleanupDataProvider(boolean cleanupDataProvider)
cleanupDataProvider
- set to false to disable auto cleanup
public boolean isConvertOnly()
public ConversionInstruction setConvertOnly(boolean convertOnly)
convertOnly
- if true, minimised processing will occur
public ConversionInstruction setRenderer(String name, FieldRenderer renderer)
name
- the name against which the renderer is associatedrenderer
- the renderer
public ConversionInstruction setRenderer(Class forClass, FieldRenderer renderer)
forClass
- the Class against which the renderer is associatedrenderer
- the renderer
public RendererRegistry getRendererRegistry()
public boolean includesFormat(ConversionFormat format)
format
- the format to test
public boolean producesZippedDocument()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |