public class PdfWriter extends DocWriter implements PdfViewerPreferences, PdfEncryptionSettings, PdfVersion, PdfDocumentActions, PdfPageActions, PdfXConformance, PdfRunDirection, PdfAnnotations
DocWriter
class for PDF.
When this PdfWriter
is added
to a certain PdfDocument
, the PDF representation of every Element
added to this Document will be written to the outputstream.
Modifier and Type | Class and Description |
---|---|
static class |
PdfWriter.PdfBody
This class generates the structure of a PDF document.
|
Modifier and Type | Field and Description |
---|---|
static int |
ALLOW_ASSEMBLY
The operation permitted when the document is opened with the user password
|
static int |
ALLOW_COPY
The operation permitted when the document is opened with the user password
|
static int |
ALLOW_DEGRADED_PRINTING
The operation permitted when the document is opened with the user password
|
static int |
ALLOW_FILL_IN
The operation permitted when the document is opened with the user password
|
static int |
ALLOW_MODIFY_ANNOTATIONS
The operation permitted when the document is opened with the user password
|
static int |
ALLOW_MODIFY_CONTENTS
The operation permitted when the document is opened with the user password
|
static int |
ALLOW_PRINTING
The operation permitted when the document is opened with the user password
|
static int |
ALLOW_SCREENREADERS
The operation permitted when the document is opened with the user password
|
static int |
AllowAssembly
Deprecated.
As of iText 2.0.7, use
ALLOW_ASSEMBLY instead. Scheduled for removal at or after 2.2.0 |
static int |
AllowCopy
Deprecated.
As of iText 2.0.7, use
ALLOW_COPY instead. Scheduled for removal at or after 2.2.0 |
static int |
AllowDegradedPrinting
Deprecated.
As of iText 2.0.7, use
ALLOW_DEGRADED_PRINTING instead. Scheduled for removal at or after 2.2.0 |
static int |
AllowFillIn
Deprecated.
As of iText 2.0.7, use
ALLOW_FILL_IN instead. Scheduled for removal at or after 2.2.0 |
static int |
AllowModifyAnnotations
Deprecated.
As of iText 2.0.7, use
ALLOW_MODIFY_ANNOTATIONS instead. Scheduled for removal at or after 2.2.0 |
static int |
AllowModifyContents
Deprecated.
As of iText 2.0.7, use
ALLOW_MODIFY_CONTENTS instead. Scheduled for removal at or after 2.2.0 |
static int |
AllowPrinting
Deprecated.
As of iText 2.0.7, use
ALLOW_PRINTING instead. Scheduled for removal at or after 2.2.0 |
static int |
AllowScreenReaders
Deprecated.
As of iText 2.0.7, use
ALLOW_SCREENREADERS instead. Scheduled for removal at or after 2.2.0 |
protected PdfWriter.PdfBody |
body
body of the PDF document
|
static int |
CenterWindow
A viewer preference
|
protected int |
colorNumber
The color number counter for the colors in the document.
|
protected int |
compressionLevel
The compression level of the content streams.
|
protected PdfEncryption |
crypto
Contains the business logic for cryptography.
|
protected int |
currentPageNumber
The current page number.
|
protected com.lowagie.text.pdf.PdfReaderInstance |
currentPdfReaderInstance |
protected PdfDictionary |
defaultColorspace |
static PdfName |
DID_PRINT
action value
|
static PdfName |
DID_SAVE
action value
|
protected PdfContentByte |
directContent
The direct content in this document.
|
protected PdfContentByte |
directContentUnder
The direct content under in this document.
|
static int |
DirectionL2R
A viewer preference
|
static int |
DirectionR2L
A viewer preference
|
static int |
DisplayDocTitle
A viewer preference
|
static int |
DO_NOT_ENCRYPT_METADATA
Add this to the mode to keep the metadata in clear text
|
static PdfName |
DOCUMENT_CLOSE
action value
|
protected HashMap<PdfSpotColor,com.lowagie.text.pdf.ColorDetails> |
documentColors
The colors of this document
|
protected HashMap<PdfDictionary,PdfObject[]> |
documentExtGState |
protected LinkedHashMap<BaseFont,com.lowagie.text.pdf.FontDetails> |
documentFonts
The fonts of this document
|
protected Set<PdfOCG> |
documentOCG
A hashSet containing all the PdfLayer objects.
|
protected List<PdfOCG> |
documentOCGorder
An array list used to define the order of an OCG tree.
|
protected HashMap<PdfPatternPainter,PdfName> |
documentPatterns
The patterns of this document
|
protected HashMap<Object,PdfObject[]> |
documentProperties |
protected HashMap<PdfShadingPattern,Object> |
documentShadingPatterns |
protected HashMap<PdfShading,Object> |
documentShadings |
protected HashMap<com.lowagie.text.pdf.ColorDetails,com.lowagie.text.pdf.ColorDetails> |
documentSpotPatterns |
static int |
EMBEDDED_FILES_ONLY
Add this to the mode to keep encrypt only the embedded files.
|
static int |
ENCRYPTION_AES_128
Type of encryption
|
protected PdfDictionary |
extraCatalog
Holds value of property extraCatalog this is used for Output Intents.
|
static int |
FitWindow
A viewer preference
|
protected int |
fontNumber
The font number counter for the fonts in the document.
|
protected LinkedHashMap<PdfIndirectReference,Object[]> |
formXObjects
The form XObjects in this document.
|
protected int |
formXObjectsCounter
The name counter for the form XObjects name.
|
protected boolean |
fullCompression
Holds value of property fullCompression.
|
static int |
GENERATION_MAX
The highest generation number possible.
|
protected PdfDictionary |
group
A group attributes dictionary specifying the attributes
of the page's page group for use in the transparent
imaging model
|
static int |
HideMenubar
A viewer preference
|
static int |
HideToolbar
A viewer preference
|
static int |
HideWindowUI
A viewer preference
|
protected PdfDictionary |
imageDictionary
Dictionary, containing all the images of the PDF document
|
protected HashMap<PdfReader,com.lowagie.text.pdf.PdfReaderInstance> |
importedPages |
protected HashMap<PdfStream,PdfIndirectReference> |
JBIG2Globals
A HashSet with Stream objects containing JBIG2 Globals
|
protected List |
newBookmarks |
static float |
NO_SPACE_CHAR_RATIO
Disable the inter-character spacing.
|
static int |
NonFullScreenPageModeUseNone
A viewer preference
|
static int |
NonFullScreenPageModeUseOC
A viewer preference
|
static int |
NonFullScreenPageModeUseOutlines
A viewer preference
|
static int |
NonFullScreenPageModeUseThumbs
A viewer preference
|
protected PdfArray |
OCGLocked
The locked array in an OCG dictionary
|
protected PdfArray |
OCGRadioGroup
The RBGroups array in an OCG dictionary
|
protected PdfOCProperties |
OCProperties
The OCProperties in a catalog dictionary.
|
static PdfName |
PAGE_CLOSE
action value
|
static PdfName |
PAGE_OPEN
action value
|
static int |
PageLayoutOneColumn
A viewer preference
|
static int |
PageLayoutSinglePage
A viewer preference
|
static int |
PageLayoutTwoColumnLeft
A viewer preference
|
static int |
PageLayoutTwoColumnRight
A viewer preference
|
static int |
PageLayoutTwoPageLeft
A viewer preference
|
static int |
PageLayoutTwoPageRight
A viewer preference
|
static int |
PageModeFullScreen
A viewer preference
|
static int |
PageModeUseAttachments
A viewer preference
|
static int |
PageModeUseNone
A viewer preference
|
static int |
PageModeUseOC
A viewer preference
|
static int |
PageModeUseOutlines
A viewer preference
|
static int |
PageModeUseThumbs
A viewer preference
|
protected ArrayList<PdfIndirectReference> |
pageReferences
The PdfIndirectReference to the pages.
|
protected com.lowagie.text.pdf.ColorDetails |
patternColorspaceCMYK |
protected com.lowagie.text.pdf.ColorDetails |
patternColorspaceGRAY |
protected com.lowagie.text.pdf.ColorDetails |
patternColorspaceRGB |
protected int |
patternNumber
The pattern number counter for the colors in the document.
|
protected PdfDocument |
pdf
the pdfdocument object.
|
protected PdfVersionImp |
pdf_version
Stores the version information for the header and the catalog.
|
static PdfName |
PDF_VERSION_1_2
possible PDF version (catalog)
|
static PdfName |
PDF_VERSION_1_3
possible PDF version (catalog)
|
static PdfName |
PDF_VERSION_1_4
possible PDF version (catalog)
|
static PdfName |
PDF_VERSION_1_5
possible PDF version (catalog)
|
static PdfName |
PDF_VERSION_1_6
possible PDF version (catalog)
|
static PdfName |
PDF_VERSION_1_7
possible PDF version (catalog)
|
static int |
PDFA1A
PDFA-1A level.
|
static int |
PDFA1B
PDFA-1B level.
|
static int |
PDFX1A2001
A PDF/X level.
|
static int |
PDFX32002
A PDF/X level.
|
static int |
PDFXNONE
A PDF/X level.
|
protected int |
prevxref
A number referring to the previous Cross-Reference Table.
|
static int |
PrintScalingNone
A viewer preference
|
protected PdfPages |
root
The root of the page tree.
|
static int |
RUN_DIRECTION_DEFAULT
Use the default run direction.
|
static int |
RUN_DIRECTION_LTR
Use bidirectional reordering with left-to-right
preferential run direction.
|
static int |
RUN_DIRECTION_NO_BIDI
Do not use bidirectional reordering.
|
static int |
RUN_DIRECTION_RTL
Use bidirectional reordering with right-to-left
preferential run direction.
|
protected int |
runDirection |
static int |
SIGNATURE_APPEND_ONLY
signature value
|
static int |
SIGNATURE_EXISTS
signature value
|
static float |
SPACE_CHAR_RATIO_DEFAULT
The default space-char ratio.
|
static int |
STANDARD_ENCRYPTION_128
Type of encryption
|
static int |
STANDARD_ENCRYPTION_40
Type of encryption
|
static boolean |
STRENGTH128BITS
Deprecated.
As of iText 2.0.7, use
STANDARD_ENCRYPTION_128 instead. Scheduled for removal at or after 2.2.0 |
static boolean |
STRENGTH40BITS
Deprecated.
As of iText 2.0.7, use
STANDARD_ENCRYPTION_40 instead. Scheduled for removal at or after 2.2.0 |
protected PdfStructureTreeRoot |
structureTreeRoot |
protected PdfName |
tabs
The value of the Tabs entry in the page dictionary.
|
protected boolean |
tagged |
protected float |
userunit |
static char |
VERSION_1_2
possible PDF version (header)
|
static char |
VERSION_1_3
possible PDF version (header)
|
static char |
VERSION_1_4
possible PDF version (header)
|
static char |
VERSION_1_5
possible PDF version (header)
|
static char |
VERSION_1_6
possible PDF version (header)
|
static char |
VERSION_1_7
possible PDF version (header)
|
static PdfName |
WILL_PRINT
action value
|
static PdfName |
WILL_SAVE
action value
|
protected byte[] |
xmpMetadata
XMP Metadata for the document.
|
Modifier | Constructor and Description |
---|---|
protected |
PdfWriter()
Constructs a
PdfWriter . |
protected |
PdfWriter(PdfDocument document,
OutputStream os)
Constructs a
PdfWriter . |
Modifier and Type | Method and Description |
---|---|
protected PdfIndirectReference |
add(PdfICCBased icc) |
void |
addAnnotation(PdfAnnotation annot)
Use this methods to add a
PdfAnnotation or a PdfFormField
to the document. |
void |
addCalculationOrder(PdfFormField annot)
Use this method to adds the
PdfAnnotation
to the calculation order array. |
void |
addDeveloperExtension(PdfDeveloperExtension de)
Adds a developer extension to the Extensions dictionary
in the Catalog.
|
PdfName |
addDirectImageSimple(Image image)
Use this method to adds an image to the document
but not to the page resources.
|
PdfName |
addDirectImageSimple(Image image,
PdfIndirectReference fixedRef)
Adds an image to the document but not to the page resources.
|
void |
addFileAttachment(PdfFileSpecification fs)
Use this method to add a file attachment at the document level.
|
void |
addFileAttachment(String description,
byte[] fileStore,
String file,
String fileDisplay)
Use this method to add a file attachment at the document level.
|
void |
addFileAttachment(String description,
PdfFileSpecification fs)
Use this method to add a file attachment at the document level.
|
void |
addJavaScript(PdfAction js)
Use this method to add a JavaScript action at the document level.
|
void |
addJavaScript(String code)
Use this method to adds a JavaScript action at the document level.
|
void |
addJavaScript(String code,
boolean unicode)
Use this method to add a JavaScript action at the document level.
|
void |
addJavaScript(String name,
PdfAction js)
Use this method to add a JavaScript action at the document level.
|
void |
addJavaScript(String name,
String code)
Use this method to adds a JavaScript action at the document level.
|
void |
addJavaScript(String name,
String code,
boolean unicode)
Use this method to add a JavaScript action at the document level.
|
void |
addNamedDestination(String name,
int page,
PdfDestination dest)
Adds one named destination.
|
void |
addNamedDestinations(Map<String,String> map,
int page_offset)
Adds named destinations in bulk.
|
void |
addOCGRadioGroup(List<PdfLayer> group)
Use this method to set a collection of optional content groups
whose states are intended to follow a "radio button" paradigm.
|
protected void |
addSharedObjectsToBody() |
PdfIndirectObject |
addToBody(PdfObject object)
Use this method to add a PDF object to the PDF body.
|
PdfIndirectObject |
addToBody(PdfObject object,
boolean inObjStm)
Use this method to add a PDF object to the PDF body.
|
PdfIndirectObject |
addToBody(PdfObject object,
int refNumber)
Use this method to add a PDF object to the PDF body.
|
PdfIndirectObject |
addToBody(PdfObject object,
int refNumber,
boolean inObjStm)
Use this method to add a PDF object to the PDF body.
|
PdfIndirectObject |
addToBody(PdfObject object,
PdfIndirectReference ref)
Use this method to add a PDF object to the PDF body.
|
PdfIndirectObject |
addToBody(PdfObject object,
PdfIndirectReference ref,
boolean inObjStm)
Use this method to add a PDF object to the PDF body.
|
void |
addViewerPreference(PdfName key,
PdfObject value)
Adds a viewer preference.
|
void |
clearTextWrap()
Use this method to clear text wrapping around images (if applicable).
|
void |
close()
Signals that the
Document was closed and that no other
Elements will be added. |
void |
createXmpMetadata()
Use this method to creates XMP Metadata based
on the metadata in the PdfDocument.
|
protected void |
fillOCProperties(boolean erase) |
boolean |
fitsPage(Table table)
Checks if a
Table fits the current page of the PdfDocument . |
boolean |
fitsPage(Table table,
float margin)
Checks if a
Table fits the current page of the PdfDocument . |
void |
freeReader(PdfReader reader)
Use this method to writes the reader to the document
and free the memory used by it.
|
PdfAcroForm |
getAcroForm()
Use this methods to get the AcroForm object.
|
Rectangle |
getBoxSize(String boxName)
Use this method to get the size of a trim, art, crop or bleed box,
or null if not defined.
|
protected PdfDictionary |
getCatalog(PdfIndirectReference rootObj) |
int |
getCompressionLevel()
Returns the compression level used for streams written by this writer.
|
long |
getCurrentDocumentSize()
Use this method to gets the current document size.
|
int |
getCurrentPageNumber() |
PdfDictionary |
getDefaultColorspace()
Use this method to get the default colorspaces.
|
PdfContentByte |
getDirectContent()
Use this method to get the direct content for this document.
|
PdfContentByte |
getDirectContentUnder()
Use this method to get the direct content under for this document.
|
PdfDictionary |
getExtraCatalog()
Sets extra keys to the catalog.
|
PdfDictionary |
getGroup()
Use this method to get the group dictionary.
|
PdfImportedPage |
getImportedPage(PdfReader reader,
int pageNumber)
Use this method to get a page from other PDF document.
|
PdfDictionary |
getInfo()
Use this method to get the info dictionary if you want to
change it directly (add keys and values to the info dictionary).
|
static PdfWriter |
getInstance(Document document,
OutputStream os)
Use this method to get an instance of the
PdfWriter . |
static PdfWriter |
getInstance(Document document,
OutputStream os,
DocListener listener)
Use this method to get an instance of the
PdfWriter . |
protected int |
getNewObjectNumber(PdfReader reader,
int number,
int generation) |
PdfOCProperties |
getOCProperties()
Use this method to get the Optional Content Properties Dictionary.
|
PdfPageEvent |
getPageEvent()
Gets the
PdfPageEvent for this document or null
if none is set. |
int |
getPageNumber()
Gets the pagenumber of this document.
|
PdfIndirectReference |
getPageReference(int page)
Use this method to get a reference to a page existing or not.
|
Rectangle |
getPageSize()
Use this method to get the size of the media box.
|
PdfIndirectReference |
getPdfIndirectReference()
Use this to get an
PdfIndirectReference for an object that
will be created in the future. |
int |
getPDFXConformance()
Getter for the PDF/X Conformance value.
|
protected PdfIndirectReference |
getReferenceJBIG2Globals(byte[] content)
Gets an indirect reference to a JBIG2 Globals stream.
|
PdfOutline |
getRootOutline()
Use this method to get the root outline
and construct bookmarks.
|
int |
getRunDirection()
Use this method to set the run direction.
|
float |
getSpaceCharRatio()
Use this method to gets the space/character extra spacing ratio
for fully justified text.
|
PdfStructureTreeRoot |
getStructureTreeRoot()
Gets the structure tree root.
|
PdfName |
getTabs()
Returns the value to be used for the Tabs entry in the page tree.
|
float |
getUserunit()
Use this method to get the user unit.
|
float |
getVerticalPosition(boolean ensureNewLine)
Use this method to get the current vertical page position.
|
boolean |
isFullCompression()
Use this method to find out if 1.5 compression is on.
|
boolean |
isPageEmpty()
Checks if a newPage() will actually generate a new page.
|
boolean |
isPdfX()
Checks if the PDF/X Conformance is necessary.
|
boolean |
isRgbTransparencyBlending()
Gets the transparency blending colorspace.
|
boolean |
isStrictImageSequence()
Use this method to get the strictImageSequence status.
|
boolean |
isTagged()
Check if the document is marked for tagging.
|
boolean |
isUserProperties()
Gets the flag indicating the presence of structure elements that contain user properties attributes.
|
void |
lockLayer(PdfLayer layer)
Use this method to lock an optional content group.
|
void |
open()
Signals that the
Document has been opened and that
Elements can be added. |
void |
releaseTemplate(PdfTemplate tp)
Use this method to releases the memory used by a template.
|
int |
reorderPages(int[] order)
Use this method to reorder the pages in the document.
|
void |
setAdditionalAction(PdfName actionType,
PdfAction action)
Additional-actions defining the actions to be taken in
response to various trigger events affecting the document
as a whole.
|
void |
setAtLeastPdfVersion(char version)
If the PDF Header hasn't been written yet,
this changes the version as it will appear in the PDF Header,
but only if the parameter refers to a higher version.
|
void |
setBoxSize(String boxName,
Rectangle size)
Use this method to set the page box sizes.
|
void |
setCollection(PdfCollection collection)
Use this method to add the Collection dictionary.
|
void |
setCompressionLevel(int compressionLevel)
Sets the compression level to be used for streams written by this writer.
|
void |
setCropBoxSize(Rectangle crop)
Use this method to set the crop box.
|
void |
setDefaultColorspace(PdfName key,
PdfObject cs)
Use this method to sets the default colorspace that will be applied
to all the document.
|
void |
setDuration(int seconds)
Sets the display duration for the page (for presentations)
|
void |
setEncryption(boolean strength,
String userPassword,
String ownerPassword,
int permissions)
Deprecated.
As of iText 2.0.3, replaced by (@link #setEncryption(byte[], byte[], int, int)}. Scheduled for removal at or after 2.2.0
|
void |
setEncryption(byte[] userPassword,
byte[] ownerPassword,
int permissions,
boolean strength128Bits)
Deprecated.
As of iText 2.0.3, replaced by (@link #setEncryption(byte[], byte[], int, int)}. Scheduled for removal at or after 2.2.0
|
void |
setEncryption(byte[] userPassword,
byte[] ownerPassword,
int permissions,
int encryptionType)
Sets the encryption options for this document.
|
void |
setEncryption(Certificate[] certs,
int[] permissions,
int encryptionType)
Sets the certificate encryption options for this document.
|
void |
setEncryption(int encryptionType,
String userPassword,
String ownerPassword,
int permissions)
Deprecated.
As of iText 2.0.3, replaced by (@link #setEncryption(byte[], byte[], int, int)}. Scheduled for removal at or after 2.2.0
|
void |
setFullCompression()
Use this method to set the document's compression to the
PDF 1.5 mode with object streams and xref streams.
|
void |
setGroup(PdfDictionary group)
Use this method to set the group dictionary.
|
void |
setInitialLeading(float leading)
Sets the initial leading for the PDF document.
|
void |
setLinearPageMode()
Use this method to make sure the page tree has a linear structure
(every leave is attached directly to the root).
|
void |
setOpenAction(PdfAction action)
When the document opens this
action will be
invoked. |
void |
setOpenAction(String name)
When the document opens it will jump to the destination with
this name.
|
void |
setOutlines(List outlines)
Sets the bookmarks.
|
boolean |
setOutputIntents(PdfReader reader,
boolean checkExistence)
Use this method to copy the output intent dictionary
from another document to this one.
|
void |
setOutputIntents(String outputConditionIdentifier,
String outputCondition,
String registryName,
String info,
byte[] destOutputProfile)
Sets the values of the output intent dictionary.
|
void |
setOutputIntents(String outputConditionIdentifier,
String outputCondition,
String registryName,
String info,
ICC_Profile colorProfile)
Sets the values of the output intent dictionary.
|
void |
setPageAction(PdfName actionType,
PdfAction action)
Sets the open and close page additional action.
|
void |
setPageEmpty(boolean pageEmpty)
Use this method to make sure a page is added,
even if it's empty.
|
void |
setPageEvent(PdfPageEvent event)
Sets the
PdfPageEvent for this document. |
void |
setPageLabels(PdfPageLabels pageLabels)
Use this method to add page labels
|
void |
setPageXmpMetadata(byte[] xmpMetadata)
Use this method to set the XMP Metadata for each page.
|
void |
setPdfVersion(char version)
If the PDF Header hasn't been written yet,
this changes the version as it will appear in the PDF Header.
|
void |
setPdfVersion(PdfName version)
Sets the PDF version as it will appear in the Catalog.
|
void |
setPDFXConformance(int pdfx)
Sets the PDF/X conformance level.
|
void |
setRgbTransparencyBlending(boolean rgbTransparencyBlending)
Sets the transparency blending colorspace to RGB.
|
void |
setRunDirection(int runDirection)
Use this method to set the run direction.
|
void |
setSigFlags(int f)
Use this method to set the signature flags.
|
void |
setSpaceCharRatio(float spaceCharRatio)
Use this method to set the ratio between the extra word spacing and
the extra character spacing when the text is fully justified.
|
void |
setStrictImageSequence(boolean strictImageSequence)
Use this method to set the image sequence, so that it follows
the text in strict order (or not).
|
void |
setTabs(PdfName tabs)
Sets the value for the Tabs entry in the page tree.
|
void |
setTagged()
Mark this document for tagging.
|
void |
setThumbnail(Image image)
Use this method to set the thumbnail image for the current page.
|
void |
setTransition(PdfTransition transition)
Sets the transition for the page
|
void |
setUserProperties(boolean userProperties)
Sets the flag indicating the presence of structure elements that contain user properties attributes.
|
void |
setUserunit(float userunit)
Use this method to set the user unit.
|
void |
setViewerPreferences(int preferences)
Sets the page layout and page mode preferences by ORing one or two of these constants.
|
void |
setXmpMetadata(byte[] xmpMetadata)
Use this method to set the XMP Metadata.
|
protected void |
writeOutlines(PdfDictionary catalog,
boolean namedAsNames) |
add, addTabs, flush, getISOBytes, isCloseStream, isPaused, newPage, pause, resetFooter, resetHeader, resetPageCount, resume, setCloseStream, setFooter, setHeader, setMarginMirroring, setMarginMirroringTopBottom, setMargins, setPageCount, setPageSize, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStart
public static final int GENERATION_MAX
protected PdfDocument pdf
protected PdfContentByte directContent
protected PdfContentByte directContentUnder
protected PdfWriter.PdfBody body
protected PdfDictionary extraCatalog
protected PdfPages root
protected ArrayList<PdfIndirectReference> pageReferences
protected int currentPageNumber
protected PdfName tabs
protected int prevxref
protected List newBookmarks
public static final char VERSION_1_2
public static final char VERSION_1_3
public static final char VERSION_1_4
public static final char VERSION_1_5
public static final char VERSION_1_6
public static final char VERSION_1_7
public static final PdfName PDF_VERSION_1_2
public static final PdfName PDF_VERSION_1_3
public static final PdfName PDF_VERSION_1_4
public static final PdfName PDF_VERSION_1_5
public static final PdfName PDF_VERSION_1_6
public static final PdfName PDF_VERSION_1_7
protected PdfVersionImp pdf_version
public static final int PageLayoutSinglePage
public static final int PageLayoutOneColumn
public static final int PageLayoutTwoColumnLeft
public static final int PageLayoutTwoColumnRight
public static final int PageLayoutTwoPageLeft
public static final int PageLayoutTwoPageRight
public static final int PageModeUseNone
public static final int PageModeUseOutlines
public static final int PageModeUseThumbs
public static final int PageModeFullScreen
public static final int PageModeUseOC
public static final int PageModeUseAttachments
public static final int HideToolbar
public static final int HideMenubar
public static final int HideWindowUI
public static final int FitWindow
public static final int CenterWindow
public static final int DisplayDocTitle
public static final int NonFullScreenPageModeUseNone
public static final int NonFullScreenPageModeUseOutlines
public static final int NonFullScreenPageModeUseThumbs
public static final int NonFullScreenPageModeUseOC
public static final int DirectionL2R
public static final int DirectionR2L
public static final int PrintScalingNone
public static final PdfName DOCUMENT_CLOSE
public static final PdfName WILL_SAVE
public static final PdfName DID_SAVE
public static final PdfName WILL_PRINT
public static final PdfName DID_PRINT
public static final int SIGNATURE_EXISTS
public static final int SIGNATURE_APPEND_ONLY
protected byte[] xmpMetadata
public static final int PDFXNONE
public static final int PDFX1A2001
public static final int PDFX32002
public static final int PDFA1A
public static final int PDFA1B
public static final int STANDARD_ENCRYPTION_40
public static final int STANDARD_ENCRYPTION_128
public static final int ENCRYPTION_AES_128
public static final int DO_NOT_ENCRYPT_METADATA
public static final int EMBEDDED_FILES_ONLY
public static final int ALLOW_PRINTING
public static final int ALLOW_MODIFY_CONTENTS
public static final int ALLOW_COPY
public static final int ALLOW_MODIFY_ANNOTATIONS
public static final int ALLOW_FILL_IN
public static final int ALLOW_SCREENREADERS
public static final int ALLOW_ASSEMBLY
public static final int ALLOW_DEGRADED_PRINTING
public static final int AllowPrinting
ALLOW_PRINTING
instead. Scheduled for removal at or after 2.2.0public static final int AllowModifyContents
ALLOW_MODIFY_CONTENTS
instead. Scheduled for removal at or after 2.2.0public static final int AllowCopy
ALLOW_COPY
instead. Scheduled for removal at or after 2.2.0public static final int AllowModifyAnnotations
ALLOW_MODIFY_ANNOTATIONS
instead. Scheduled for removal at or after 2.2.0public static final int AllowFillIn
ALLOW_FILL_IN
instead. Scheduled for removal at or after 2.2.0public static final int AllowScreenReaders
ALLOW_SCREENREADERS
instead. Scheduled for removal at or after 2.2.0public static final int AllowAssembly
ALLOW_ASSEMBLY
instead. Scheduled for removal at or after 2.2.0public static final int AllowDegradedPrinting
ALLOW_DEGRADED_PRINTING
instead. Scheduled for removal at or after 2.2.0public static final boolean STRENGTH40BITS
STANDARD_ENCRYPTION_40
instead. Scheduled for removal at or after 2.2.0public static final boolean STRENGTH128BITS
STANDARD_ENCRYPTION_128
instead. Scheduled for removal at or after 2.2.0protected PdfEncryption crypto
protected boolean fullCompression
protected int compressionLevel
protected LinkedHashMap<BaseFont,com.lowagie.text.pdf.FontDetails> documentFonts
protected int fontNumber
protected LinkedHashMap<PdfIndirectReference,Object[]> formXObjects
protected int formXObjectsCounter
protected com.lowagie.text.pdf.PdfReaderInstance currentPdfReaderInstance
protected HashMap<PdfSpotColor,com.lowagie.text.pdf.ColorDetails> documentColors
protected int colorNumber
protected HashMap<PdfPatternPainter,PdfName> documentPatterns
protected int patternNumber
protected HashMap<PdfShadingPattern,Object> documentShadingPatterns
protected HashMap<PdfShading,Object> documentShadings
protected HashMap<PdfDictionary,PdfObject[]> documentExtGState
protected boolean tagged
protected PdfStructureTreeRoot structureTreeRoot
protected List<PdfOCG> documentOCGorder
protected PdfOCProperties OCProperties
protected PdfArray OCGRadioGroup
protected PdfArray OCGLocked
public static final PdfName PAGE_OPEN
public static final PdfName PAGE_CLOSE
protected PdfDictionary group
public static final float SPACE_CHAR_RATIO_DEFAULT
public static final float NO_SPACE_CHAR_RATIO
public static final int RUN_DIRECTION_DEFAULT
public static final int RUN_DIRECTION_NO_BIDI
public static final int RUN_DIRECTION_LTR
public static final int RUN_DIRECTION_RTL
protected int runDirection
protected float userunit
protected PdfDictionary defaultColorspace
protected HashMap<com.lowagie.text.pdf.ColorDetails,com.lowagie.text.pdf.ColorDetails> documentSpotPatterns
protected com.lowagie.text.pdf.ColorDetails patternColorspaceRGB
protected com.lowagie.text.pdf.ColorDetails patternColorspaceGRAY
protected com.lowagie.text.pdf.ColorDetails patternColorspaceCMYK
protected PdfDictionary imageDictionary
protected HashMap<PdfStream,PdfIndirectReference> JBIG2Globals
protected PdfWriter()
PdfWriter
.protected PdfWriter(PdfDocument document, OutputStream os)
PdfWriter
.
Remark: a PdfWriter can only be constructed by calling the method
getInstance(Document document, OutputStream os)
.
document
- The PdfDocument
that has to be writtenos
- The OutputStream
the writer has to write to.public static PdfWriter getInstance(Document document, OutputStream os) throws DocumentException
PdfWriter
.document
- The Document
that has to be writtenos
- The OutputStream
the writer has to write to.PdfWriter
DocumentException
- on errorpublic static PdfWriter getInstance(Document document, OutputStream os, DocListener listener) throws DocumentException
PdfWriter
.document
- The Document
that has to be writtenos
- The OutputStream
the writer has to write to.listener
- A DocListener
to pass to the PdfDocument.PdfWriter
DocumentException
- on errorpublic PdfDictionary getInfo()
public float getVerticalPosition(boolean ensureNewLine)
ensureNewLine
- Tells whether a new line shall be enforced. This may cause side effects
for elements that do not terminate the lines they've started because those lines will get
terminated.public void setInitialLeading(float leading) throws DocumentException
leading
- the initial leadingDocumentException
- if you try setting the leading after the document was opened.public PdfContentByte getDirectContent()
public PdfContentByte getDirectContentUnder()
public PdfIndirectObject addToBody(PdfObject object) throws IOException
object
- IOException
public PdfIndirectObject addToBody(PdfObject object, boolean inObjStm) throws IOException
object
- inObjStm
- IOException
public PdfIndirectObject addToBody(PdfObject object, PdfIndirectReference ref) throws IOException
object
- ref
- IOException
public PdfIndirectObject addToBody(PdfObject object, PdfIndirectReference ref, boolean inObjStm) throws IOException
object
- ref
- inObjStm
- IOException
public PdfIndirectObject addToBody(PdfObject object, int refNumber) throws IOException
object
- refNumber
- IOException
public PdfIndirectObject addToBody(PdfObject object, int refNumber, boolean inObjStm) throws IOException
object
- refNumber
- inObjStm
- IOException
public PdfIndirectReference getPdfIndirectReference()
PdfIndirectReference
for an object that
will be created in the future.
Use this method only if you know what you're doing!PdfIndirectReference
protected PdfDictionary getCatalog(PdfIndirectReference rootObj)
public PdfDictionary getExtraCatalog()
public void setLinearPageMode()
public int reorderPages(int[] order) throws DocumentException
null
argument value only returns the number of pages to process.
It is advisable to issue a Document.newPage()
before using this method.order
- an array with the new page sequence. It must have the
same size as the number of pages.DocumentException
- if all the pages are not present in the arraypublic PdfIndirectReference getPageReference(int page)
page
- the page number. The first page is 1public int getPageNumber()
public int getCurrentPageNumber()
public void setTabs(PdfName tabs)
tabs
- Can be PdfName.R, PdfName.C or PdfName.S.
Since the Adobe Extensions Level 3, it can also be PdfName.A
or PdfName.Wpublic PdfName getTabs()
public void setPageEvent(PdfPageEvent event)
PdfPageEvent
for this document.event
- the PdfPageEvent
for this documentpublic PdfPageEvent getPageEvent()
PdfPageEvent
for this document or null
if none is set.PdfPageEvent
for this document or null
if none is setpublic void open()
Document
has been opened and that
Elements
can be added.
When this method is called, the PDF-document header is written to the outputstream.
open
in interface DocListener
open
in class DocWriter
DocWriter.open()
public void close()
Document
was closed and that no other
Elements
will be added.
The pages-tree is built and written to the outputstream. A Catalog is constructed, as well as an Info-object, the reference table is composed and everything is written to the outputstream embedded in a Trailer.
close
in interface DocListener
close
in class DocWriter
DocWriter.close()
protected void addSharedObjectsToBody() throws IOException
IOException
public PdfOutline getRootOutline()
public void setOutlines(List outlines)
SimpleBookmark
.outlines
- the bookmarks or null
to remove anyprotected void writeOutlines(PdfDictionary catalog, boolean namedAsNames) throws IOException
IOException
public void setPdfVersion(char version)
PdfVersion
setPdfVersion
in interface PdfVersion
version
- a character representing the PDF versionPdfVersion.setPdfVersion(char)
public void setAtLeastPdfVersion(char version)
PdfVersion
setAtLeastPdfVersion
in interface PdfVersion
version
- a character representing the PDF versionPdfVersion.setAtLeastPdfVersion(char)
public void setPdfVersion(PdfName version)
PdfVersion
setPdfVersion
in interface PdfVersion
version
- the PDF name that will be used for the Version key in the catalogPdfVersion.setPdfVersion(com.lowagie.text.pdf.PdfName)
public void addDeveloperExtension(PdfDeveloperExtension de)
PdfVersion
addDeveloperExtension
in interface PdfVersion
de
- an object that contains the extensions prefix and dictionaryPdfVersion.addDeveloperExtension(com.lowagie.text.pdf.PdfDeveloperExtension)
public void setViewerPreferences(int preferences)
PdfViewerPreferences
addViewerPreference(key, value)
if you want to change the following preferences:
setViewerPreferences
in interface PdfViewerPreferences
preferences
- the viewer preferencesPdfViewerPreferences.setViewerPreferences(int)
public void addViewerPreference(PdfName key, PdfObject value)
PdfViewerPreferences
addViewerPreference
in interface PdfViewerPreferences
key
- the name of the viewer preferencevalue
- the value of the viewer preferencePdfViewerPreferences.addViewerPreference(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject)
public void setPageLabels(PdfPageLabels pageLabels)
pageLabels
- the page labelspublic void addNamedDestinations(Map<String,String> map, int page_offset)
map
- a map with strings as keys for the names,
and structured strings as values for the destinationspage_offset
- number of pages that has to be added to
the page numbers in the destinations (useful if you
use this method in combination with PdfCopy).public void addNamedDestination(String name, int page, PdfDestination dest)
name
- the name for the destinationpage
- the page number where you want to jump todest
- an explicit destinationpublic void addJavaScript(PdfAction js)
js
- The JavaScript actionpublic void addJavaScript(String code, boolean unicode)
code
- the JavaScript codeunicode
- select JavaScript unicode. Note that the internal
Acrobat JavaScript engine does not support unicode,
so this may or may not work for youpublic void addJavaScript(String code)
code
- the JavaScript codepublic void addJavaScript(String name, PdfAction js)
name
- The name of the JS Action in the name treejs
- The JavaScript actionpublic void addJavaScript(String name, String code, boolean unicode)
name
- The name of the JS Action in the name treecode
- the JavaScript codeunicode
- select JavaScript unicode. Note that the internal
Acrobat JavaScript engine does not support unicode,
so this may or may not work for youpublic void addJavaScript(String name, String code)
name
- The name of the JS Action in the name treecode
- the JavaScript codepublic void addFileAttachment(String description, byte[] fileStore, String file, String fileDisplay) throws IOException
description
- the file descriptionfileStore
- an array with the file. If it's null
the file will be read from the diskfile
- the path to the file. It will only be used if
fileStore
is not null
fileDisplay
- the actual file name stored in the pdfIOException
- on errorpublic void addFileAttachment(String description, PdfFileSpecification fs) throws IOException
description
- the file descriptionfs
- the file specificationIOException
public void addFileAttachment(PdfFileSpecification fs) throws IOException
fs
- the file specificationIOException
public void setOpenAction(String name)
PdfDocumentActions
setOpenAction
in interface PdfDocumentActions
name
- the name of the destination to jump toPdfDocumentActions.setOpenAction(java.lang.String)
public void setOpenAction(PdfAction action)
PdfDocumentActions
action
will be
invoked.setOpenAction
in interface PdfDocumentActions
action
- the action to be invokedPdfDocumentActions.setOpenAction(com.lowagie.text.pdf.PdfAction)
public void setAdditionalAction(PdfName actionType, PdfAction action) throws DocumentException
PdfDocumentActions
DOCUMENT_CLOSE
,
WILL_SAVE
, DID_SAVE
, WILL_PRINT
and DID_PRINT
.setAdditionalAction
in interface PdfDocumentActions
actionType
- the action typeaction
- the action to execute in response to the triggerDocumentException
- on invalid action typePdfDocumentActions.setAdditionalAction(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfAction)
public void setCollection(PdfCollection collection)
collection
- a dictionary of type PdfCollectionpublic PdfAcroForm getAcroForm()
PdfAnnotations
getAcroForm
in interface PdfAnnotations
PdfAnnotations.getAcroForm()
public void addAnnotation(PdfAnnotation annot)
PdfAnnotations
PdfAnnotation
or a PdfFormField
to the document. Only the top parent of a PdfFormField
needs to be added.addAnnotation
in interface PdfAnnotations
annot
- the PdfAnnotation
or the PdfFormField
to addPdfAnnotations.addAnnotation(com.lowagie.text.pdf.PdfAnnotation)
public void addCalculationOrder(PdfFormField annot)
PdfAnnotations
PdfAnnotation
to the calculation order array.addCalculationOrder
in interface PdfAnnotations
annot
- the PdfAnnotation
to be addedPdfAnnotations.addCalculationOrder(com.lowagie.text.pdf.PdfFormField)
public void setSigFlags(int f)
PdfAnnotations
setSigFlags
in interface PdfAnnotations
f
- the flags. This flags are ORed with current onesPdfAnnotations.setSigFlags(int)
public void setXmpMetadata(byte[] xmpMetadata)
xmpMetadata
- The xmpMetadata to set.public void setPageXmpMetadata(byte[] xmpMetadata)
xmpMetadata
- The xmpMetadata to set.public void createXmpMetadata()
public void setPDFXConformance(int pdfx)
PdfXConformance
setPDFXConformance
in interface PdfXConformance
pdfx
- the conformance levelPdfXConformance.setPDFXConformance(int)
public int getPDFXConformance()
PdfXConformance
getPDFXConformance
in interface PdfXConformance
PdfXConformance.getPDFXConformance()
public boolean isPdfX()
PdfXConformance
isPdfX
in interface PdfXConformance
PdfXConformance.isPdfX()
public void setOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, ICC_Profile colorProfile) throws IOException
outputConditionIdentifier
- a valueoutputCondition
- a value, "PDFA/A" to force GTS_PDFA1, otherwise cued by pdfxConformance.registryName
- a valueinfo
- a valuecolorProfile
- a valueIOException
- on errorpublic void setOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, byte[] destOutputProfile) throws IOException
ICC_Profile
-based version of this method.outputConditionIdentifier
- a valueoutputCondition
- a value, "PDFA/A" to force GTS_PDFA1, otherwise cued by pdfxConformance.registryName
- a valueinfo
- a valuedestOutputProfile
- a valueIOException
public boolean setOutputIntents(PdfReader reader, boolean checkExistence) throws IOException
reader
- the other documentcheckExistence
- true
to just check for the existence of a valid output intent
dictionary, false
to insert the dictionary if it existstrue
if the output intent dictionary exists, false
otherwiseIOException
- on errorpublic void setEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionType) throws DocumentException
PdfEncryptionSettings
setEncryption
in interface PdfEncryptionSettings
userPassword
- the user password. Can be null or emptyownerPassword
- the owner password. Can be null or emptypermissions
- the user permissionsencryptionType
- the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.
Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartextDocumentException
- if the document is already openPdfEncryptionSettings.setEncryption(byte[], byte[], int, int)
public void setEncryption(Certificate[] certs, int[] permissions, int encryptionType) throws DocumentException
PdfEncryptionSettings
setEncryption
in interface PdfEncryptionSettings
certs
- the public certificates to be used for the encryptionpermissions
- the user permissions for each of the certificatesencryptionType
- the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.DocumentException
- if the document is already openPdfEncryptionSettings.setEncryption(java.security.cert.Certificate[], int[], int)
public void setEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, boolean strength128Bits) throws DocumentException
userPassword
- the user password. Can be null or emptyownerPassword
- the owner password. Can be null or emptypermissions
- the user permissionsstrength128Bits
- true
for 128 bit key length, false
for 40 bit key lengthDocumentException
- if the document is already openpublic void setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions) throws DocumentException
strength
- true
for 128 bit key length, false
for 40 bit key lengthuserPassword
- the user password. Can be null or emptyownerPassword
- the owner password. Can be null or emptypermissions
- the user permissionsDocumentException
- if the document is already openpublic void setEncryption(int encryptionType, String userPassword, String ownerPassword, int permissions) throws DocumentException
encryptionType
- the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.
Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartextuserPassword
- the user password. Can be null or emptyownerPassword
- the owner password. Can be null or emptypermissions
- the user permissionsDocumentException
- if the document is already openpublic boolean isFullCompression()
public void setFullCompression()
If set before opening the document it will also set the pdf version to 1.5.
public int getCompressionLevel()
public void setCompressionLevel(int compressionLevel)
compressionLevel
- a value between 0 (best speed) and 9 (best compression)public void releaseTemplate(PdfTemplate tp) throws IOException
tp
- the template to releaseIOException
- on errorpublic PdfImportedPage getImportedPage(PdfReader reader, int pageNumber)
reader
- the PDF document where the page ispageNumber
- the page number. The first page is 1public void freeReader(PdfReader reader) throws IOException
reader
- the PdfReader
to freeIOException
- on errorpublic long getCurrentDocumentSize()
freeReader()
when concatenating many documents and an idea of
the current size is needed.protected int getNewObjectNumber(PdfReader reader, int number, int generation)
public void setTagged()
public boolean isTagged()
true
if the document is marked for taggingpublic PdfStructureTreeRoot getStructureTreeRoot()
null
.public PdfOCProperties getOCProperties()
public void addOCGRadioGroup(List<PdfLayer> group)
group
- the radio grouppublic void lockLayer(PdfLayer layer)
layer
- the layer that needs to be added to the array of locked OCGsprotected void fillOCProperties(boolean erase)
public Rectangle getPageSize()
public void setCropBoxSize(Rectangle crop)
crop
- the crop boxpublic void setBoxSize(String boxName, Rectangle size)
boxName
- the box sizesize
- the sizepublic Rectangle getBoxSize(String boxName)
boxName
- crop, trim, art or bleedpublic void setPageEmpty(boolean pageEmpty)
pageEmpty
- the statepublic boolean isPageEmpty()
public void setPageAction(PdfName actionType, PdfAction action) throws DocumentException
PdfPageActions
setPageAction
in interface PdfPageActions
actionType
- the action type. It can be PdfWriter.PAGE_OPEN
or PdfWriter.PAGE_CLOSE
action
- the action to performDocumentException
- if the action type is invalidPdfPageActions.setPageAction(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfAction)
public void setDuration(int seconds)
PdfPageActions
setDuration
in interface PdfPageActions
seconds
- the number of seconds to display the pagePdfPageActions.setDuration(int)
public void setTransition(PdfTransition transition)
PdfPageActions
setTransition
in interface PdfPageActions
transition
- the Transition objectPdfPageActions.setTransition(com.lowagie.text.pdf.PdfTransition)
public void setThumbnail(Image image) throws DocumentException
image
- the imagePdfException
- on errorDocumentException
- or errorpublic PdfDictionary getGroup()
public void setGroup(PdfDictionary group)
group
- New value of property group.public float getSpaceCharRatio()
public void setSpaceCharRatio(float spaceCharRatio)
spaceCharRatio
times more
than extra character spacing. If the ratio is PdfWriter.NO_SPACE_CHAR_RATIO
then the extra character spacing will be zero.spaceCharRatio
- the ratio between the extra word spacing and the extra character spacingpublic void setRunDirection(int runDirection)
setRunDirection
in interface PdfRunDirection
runDirection
- the run directionpublic int getRunDirection()
getRunDirection
in interface PdfRunDirection
public float getUserunit()
public void setUserunit(float userunit) throws DocumentException
userunit
- The userunit to set.DocumentException
- on errorpublic PdfDictionary getDefaultColorspace()
public void setDefaultColorspace(PdfName key, PdfObject cs)
The colorspace is applied immediately when creating templates and at the page end for the main document content.
key
- the name of the colorspace. It can be PdfName.DEFAULTGRAY
, PdfName.DEFAULTRGB
or PdfName.DEFAULTCMYK
cs
- the colorspace. A null
or PdfNull
removes any colorspace with the same namepublic boolean isStrictImageSequence()
public void setStrictImageSequence(boolean strictImageSequence)
strictImageSequence
- new value of property strictImageSequencepublic void clearTextWrap() throws DocumentException
DocumentException
public PdfName addDirectImageSimple(Image image) throws DocumentException
Document.add(Image)
.
Use this method only if you know what you're doing!image
- the Image
to addPdfException
- on errorDocumentException
- on errorpublic PdfName addDirectImageSimple(Image image, PdfIndirectReference fixedRef) throws DocumentException
Document.add(Image)
.
Use this method only if you know what you're doing!image
- the Image
to addfixedRef
- the reference to used. It may be null
,
a PdfIndirectReference
or a PRIndirectReference
.PdfException
- on errorDocumentException
- on errorprotected PdfIndirectReference add(PdfICCBased icc)
protected PdfIndirectReference getReferenceJBIG2Globals(byte[] content)
content
- a byte array that may already been added to the writer inside a stream object.public boolean fitsPage(Table table, float margin)
Table
fits the current page of the PdfDocument
.table
- the table that has to be checkedmargin
- a certain margintrue
if the Table
fits the page, false
otherwise.public boolean fitsPage(Table table)
Table
fits the current page of the PdfDocument
.table
- the table that has to be checkedtrue
if the Table
fits the page, false
otherwise.public boolean isUserProperties()
public void setUserProperties(boolean userProperties)
userProperties
- the user properties flagpublic boolean isRgbTransparencyBlending()
true
if the transparency blending colorspace is RGB, false
if it is the default blending colorspacepublic void setRgbTransparencyBlending(boolean rgbTransparencyBlending)
rgbTransparencyBlending
- true
to set the transparency blending colorspace to RGB, false
to use the default blending colorspaceCopyright © 2020. All rights reserved.