Gets the name of the resultant PDF file.
This name will be passed to makePdf
, assertPdf
and comparePdf
methods.
@return
Gets the name of the compare PDF file.
This name will be passed to comparePdf
method.
@return
Sets the maximum errors count which will be returned as the result of the comparison.
@param compareByContentMaxErrorCount the errors count.
@return Returns this.
Sets the absolute error parameter which will be used in floating point numbers comparison.
@param error the epsilon new value.
@return Returns this.
Sets the relative error parameter which will be used in floating point numbers comparison.
@param error the epsilon new value.
@return Returns this.
Creates a new instance of MemoryLimitsAwareException.
@param message the detail message.
A
handles memory allocation and prevents decompressed pdf streams from occupation of more space than allowed.
Creates a
which will be used to handle decompression of pdf streams.
The max allowed memory limits will be generated by default.
Creates a
which will be used to handle decompression of pdf streams.
The max allowed memory limits will be generated by default, based on the size of the document.
the size of the document, which is going to be handled by iText.
Gets the maximum allowed size which can be occupied by a single decompressed pdf stream.
the maximum allowed size which can be occupied by a single decompressed pdf stream.
Sets the maximum allowed size which can be occupied by a single decompressed pdf stream.
Sets the maximum allowed size which can be occupied by a single decompressed pdf stream.
This value correlates with maximum heap size. This value should not exceed limit of the heap size.
iText will throw an exception if during decompression a pdf stream with two or more filters of identical type
occupies more memory than allowed.
the maximum allowed size which can be occupied by a single decompressed pdf stream.
this
instance.
Gets the maximum allowed size which can be occupied by all decompressed pdf streams.
the maximum allowed size value which streams may occupy
Sets the maximum allowed size which can be occupied by all decompressed pdf streams.
Sets the maximum allowed size which can be occupied by all decompressed pdf streams.
This value can be limited by the maximum expected PDF file size when it's completely decompressed.
Setting this value correlates with the maximum processing time spent on document reading
iText will throw an exception if during decompression pdf streams with two or more filters of identical type
occupy more memory than allowed.
he maximum allowed size which can be occupied by all decompressed pdf streams.
this
instance.
Considers the number of bytes which are occupied by the decompressed pdf stream.
Considers the number of bytes which are occupied by the decompressed pdf stream.
If memory limits have not been faced, throws an exception.
the number of bytes which are occupied by the decompressed pdf stream.
this
instance.
Begins handling of current pdf stream decompression.
this
instance.
Ends handling of current pdf stream decompression.
Ends handling of current pdf stream decompression.
If memory limits have not been faced, throws an exception.
this
instance.
This class implements an output stream which can be used for memory limits aware decompression of pdf streams.
The maximum size of array to allocate.
Attempts to allocate larger arrays will result in an exception.
The maximum size of array to allocate.
Attempts to allocate larger arrays will result in an exception.
Creates a new byte array output stream. The buffer capacity is
initially 32 bytes, though its size increases if necessary.
Creates a new byte array output stream, with a buffer capacity of
the specified size, in bytes.
@param size the initial size.
@throws IllegalArgumentException if size is negative.
Gets the maximum size which can be occupied by this output stream.
@return the maximum size which can be occupied by this output stream.
Sets the maximum size which can be occupied by this output stream.
@param maxStreamSize the maximum size which can be occupied by this output stream.
@return this {@link MemoryLimitsAwareOutputStream}
{@inheritDoc}
Query and change fields in existing documents either by method
calls or by FDF merging.
@author Paulo Soares
A field type invalid or not found.
A field type.
A field type.
A field type.
A field type.
A field type.
A field type.
A field type.
Holds value of property generateAppearances.
Holds value of property fieldCache.
Gets the list of appearance names. Use it to get the names allowed
with radio and checkbox fields. If the /Opt key exists the values will
also be included. The name 'Off' may also be valid
even if not returned in the list.
For Comboboxes it will return an array of display values. To extract the
export values of a Combobox, please refer to {@link AcroFields#getListOptionExport(String)}
@param fieldName the fully qualified field name
@return the list of names or null
if the field does not exist
Gets the list of export option values from fields of type list or combo.
If the field doesn't exist or the field type is not list or combo it will return
null
.
@param fieldName the field name
@return the list of export option values from fields of type list or combo
Gets the list of display option values from fields of type list or combo.
If the field doesn't exist or the field type is not list or combo it will return
null
.
@param fieldName the field name
@return the list of export option values from fields of type list or combo
Export the fields as a FDF.
@param writer the FDF writer
Renames a field. Only the last part of the name can be renamed. For example,
if the original field is "ab.cd.ef" only the "ef" part can be renamed.
@param oldName the old field name
@param newName the new field name
@return true
if the renaming was successful, false
otherwise
Retrieve the rich value for the given field
@param name
@return The rich value if present, or null.
@since 5.0.6
Gets the field value.
@param name the fully qualified field name
@return the field value
Gets the field values of a Choice field.
@param name the fully qualified field name
@return the field value
@since 2.1.3
Merges an XML data structure into this form.
@param n the top node of the data structure
@throws java.io.IOException on error
@throws com.lowagie.text.DocumentException o error
Sets the fields by FDF merging.
@param fdf the FDF form
@throws IOException on error
@throws DocumentException on error
Sets the fields by XFDF merging.
@param xfdf the XFDF form
@throws IOException on error
@throws DocumentException on error
Regenerates the field appearance.
This is usefull when you change a field property, but not its value,
for instance form.SetFieldProperty("f", "bgcolor", BaseColor.BLUE, null);
This won't have any effect, unless you use RegenerateField("f") after changing
the property.
@param name the fully qualified field name or the partial name in the case of XFA forms
@throws IOException on error
@throws DocumentException on error
@return true
if the field was found and changed,
false
otherwise
Sets the field value.
@param name the fully qualified field name or the partial name in the case of XFA forms
@param value the field value
@throws IOException on error
@throws DocumentException on error
@return true
if the field was found and changed,
false
otherwise
Sets the field value.
@param name the fully qualified field name or the partial name in the case of XFA forms
@param value the field value
@param saveAppearance save the current appearance of the field or not
@throws IOException on error
@throws DocumentException on error
@return true
if the field was found and changed,
false
otherwise
Sets the rich value for the given field. See PDF Reference chapter
12.7.3.4 (Rich Text) and 12.7.4.3 (Text Fields) for further details. Note that iText doesn't create an appearance for Rich Text fields.
So you either need to use XML Worker to create an appearance (/N entry in the /AP dictionary), or you need to use setGenerateAppearances(false) to tell the viewer
that iText didn't create any appearances.
@param name Field name
@param richValue html markup
@return success/failure (will fail if the field isn't found, isn't a text field, or doesn't support rich text)
@throws DocumentException
@throws IOException
@since 5.0.6
Sets the field value and the display string. The display string
is used to build the appearance in the cases where the value
is modified by Acrobat with JavaScript and the algorithm is
known.
@param name the fully qualified field name or the partial name in the case of XFA forms
@param value the field value
@param display the string that is used for the appearance. If null
the value
parameter will be used
@return true
if the field was found and changed,
false
otherwise
@throws IOException on error
@throws DocumentException on error
Sets the field value and the display string. The display string
is used to build the appearance in the cases where the value
is modified by Acrobat with JavaScript and the algorithm is
known.
@param name the fully qualified field name or the partial name in the case of XFA forms
@param value the field value
@param display the string that is used for the appearance. If null
the value
parameter will be used
@param saveAppearance save the current appearance of the field or not
@return true
if the field was found and changed,
false
otherwise
@throws IOException on error
@throws DocumentException on error
Sets different values in a list selection.
No appearance is generated yet; nor does the code check if multiple select is allowed.
@param name the name of the field
@param value an array with values that need to be selected
@return true only if the field value was changed
@since 2.1.4
Gets all the fields. The fields are keyed by the fully qualified field name and
the value is an instance of AcroFields.Item
.
@return all the fields
Gets the field structure.
@param name the name of the field
@return the field structure or null
if the field
does not exist
Gets the long XFA translated name.
@param name the name of the field
@return the long field name
Gets the field box positions in the document. The return is an array of float
multiple of 5. For each of this groups the values are: [page, llx, lly, urx,
ury]. The coordinates have the page rotation in consideration.
@param name the field name
@return the positions or null
if field does not exist
Removes all the fields from page
.
@param page the page to remove the fields from
@return true
if any field was removed, false otherwise
Removes a field from the document. If page equals -1 all the fields with this
name
are removed from the document otherwise only the fields in
that particular page are removed.
@param name the field name
@param page the page to remove the field from or -1 to remove it from all the pages
@return true
if the field exists, false otherwise
Removes a field from the document.
@param name the field name
@return true
if the field exists, false otherwise
Sets the option to generate appearances. Not generating apperances
will speed-up form filling but the results can be
unexpected in Acrobat. Don't use it unless your environment is well
controlled. The default is true
.
@param generateAppearances the option to generate appearances
The field representations for retrieval and modification.
writeToAll
constant.
@since 2.1.5
writeToAll
and markUsed
constant.
@since 2.1.5
writeToAll
and markUsed
constant.
@since 2.1.5
This function writes the given key/value pair to all the instances
of merged, widget, and/or value, depending on the writeFlags
setting
@since 2.1.5
@param key you'll never guess what this is for.
@param value if value is null, the key will be removed
@param writeFlags ORed together WRITE_* flags
Mark all the item dictionaries used matching the given flags
@since 2.1.5
@param writeFlags WRITE_MERGED is ignored
An array of PdfDictionary
where the value tag /V
is present.
An array of PdfDictionary
with the widgets.
An array of PdfDictionary
with the widget references.
An array of PdfDictionary
with all the field
and widget tags merged.
An array of Integer
with the page numbers where
the widgets are displayed.
An array of Integer
with the tab order of the field in the page.
Preferred method of determining the number of instances
of a given field.
@since 2.1.5
@return number of instances
Remove the given instance from this item. It is possible to
remove all instances using this function.
@since 2.1.5
@param killIdx
Retrieve the value dictionary of the given instance
@since 2.1.5
@param idx instance index
@return dictionary storing this instance's value. It may be shared across instances.
Add a value dict to this Item
@since 2.1.5
@param value new value dictionary
Retrieve the widget dictionary of the given instance
@since 2.1.5
@param idx instance index
@return The dictionary found in the appropriate page's Annot array.
Add a widget dict to this Item
@since 2.1.5
@param widget
Retrieve the reference to the given instance
@since 2.1.5
@param idx instance index
@return reference to the given field instance
Add a widget ref to this Item
@since 2.1.5
@param widgRef
Retrieve the merged dictionary for the given instance. The merged
dictionary contains all the keys present in parent fields, though they
may have been overwritten (or modified?) by children.
Example: a merged radio field dict will contain /V
@since 2.1.5
@param idx instance index
@return the merged dictionary for the given instance
Adds a merged dictionary to this Item.
@since 2.1.5
@param mergeDict
Retrieve the page number of the given instance
@since 2.1.5
@param idx
@return remember, pages are "1-indexed", not "0-indexed" like field instances.
Adds a page to the current Item.
@since 2.1.5
@param pg
forces a page value into the Item.
@since 2.1.5
@param idx
Gets the tabOrder.
@since 2.1.5
@param idx
@return tab index of the given field instance
Adds a tab order value to this Item.
@since 2.1.5
@param order
Clears a signed field.
@param name the field name
@return true if the field was signed, false if the field was not signed or not found
@since 5.0.5
Gets the field names that have signatures and are signed.
@return the field names that have signatures and are signed
Gets the field names that have blank signatures.
@return the field names that have blank signatures
Gets the signature dictionary, the one keyed by /V.
@param name the field name
@return the signature dictionary keyed by /V or null
if the field is not
a signature
Gets a reference to the normal appearance of a field.
@param name the field name
@return a reference to the /N entry of the /AP dictionary or null
if the field is not found
Checks is the signature covers the entire document or just part of it.
@param name the signature field name
@return true
if the signature covers the entire document,
false
otherwise
Gets the total number of revisions this document has.
@return the total number of revisions
Gets this field
revision.
@param field the signature field name
@return the revision or zero if it's not a signature field
Extracts a revision from the document.
@param field the signature field name
@return an Stream
covering the revision. Returns null
if
it's not a signature field
@throws IOException on error
Sets extra margins in text fields to better mimic the Acrobat layout.
@param extraMarginLeft the extra marging left
@param extraMarginTop the extra margin top
Adds a substitution font to the list. The fonts in this list will be used if the original
font doesn't contain the needed glyphs.
@param font the font
Sets a list of substitution fonts. The list is composed of BaseFont
and can also be null
. The fonts in this list will be used if the original
font doesn't contain the needed glyphs.
@param substitutionFonts the list
Gets the XFA form processor.
@return the XFA form processor
Removes the XFA stream from the document.
Creates a new pushbutton from an existing field. If there are several pushbuttons with the same name
only the first one is used. This pushbutton can be changed and be used to replace
an existing one, with the same name or other name, as long is it is in the same document. To replace an existing pushbutton
call {@link #replacePushbuttonField(String,PdfFormField)}.
@param field the field name that should be a pushbutton
@return a new pushbutton or null
if the field is not a pushbutton
Creates a new pushbutton from an existing field. This pushbutton can be changed and be used to replace
an existing one, with the same name or other name, as long is it is in the same document. To replace an existing pushbutton
call {@link #replacePushbuttonField(String,PdfFormField,int)}.
@param field the field name that should be a pushbutton
@param order the field order in fields with same name
@return a new pushbutton or null
if the field is not a pushbutton
Replaces the first field with a new pushbutton. The pushbutton can be created with
{@link #getNewPushbuttonFromField(String)} from the same document or it can be a
generic PdfFormField of the type pushbutton.
@param field the field name
@param button the PdfFormField
representing the pushbutton
@return true
if the field was replaced, false
if the field
was not a pushbutton
Replaces the designated field with a new pushbutton. The pushbutton can be created with
{@link #getNewPushbuttonFromField(String,int)} from the same document or it can be a
generic PdfFormField of the type pushbutton.
@param field the field name
@param button the PdfFormField
representing the pushbutton
@param order the field order in fields with same name
@return true
if the field was replaced, false
if the field
was not a pushbutton
Checks whether a name exists as a signature field or not. It checks both signed fields and blank signatures.
@param name String
@return boolean does the signature field exist
@since 5.5.1
A class representing a field position
@since 5.0.2
Summary description for InputMeta.
Summary description for MetaDo.
Creates new MetaState
Getter for property currentBackgroundColor.
@return Value of property currentBackgroundColor.
Getter for property currentTextColor.
@return Value of property currentTextColor.
Getter for property backgroundMode.
@return Value of property backgroundMode.
Getter for property textAlign.
@return Value of property textAlign.
Getter for property polyFillMode.
@return Value of property polyFillMode.
Came from GIFEncoder initially.
Modified - to allow for output compressed data without the block counts
which breakup the compressed data stream for GIF.
note this also indicates gif format BITFile. *
@param output destination for output data
@param blocks GIF LZW requires block counts for output data
Reads a BMP from an url.
@param url the url
@throws IOException on error
@return the image
Reads a BMP from a stream. The stream is not closed.
@param is the stream
@throws IOException on error
@return the image
Reads a BMP from a stream. The stream is not closed.
The BMP may not have a header and be considered as a plain DIB.
@param is the stream
@param noHeader true to process a plain DIB
@param size the size of the DIB. Not used for a BMP
@throws IOException on error
@return the image
Reads a BMP from a file.
@param file the file
@throws IOException on error
@return the image
Reads a BMP from a byte array.
@param data the byte array
@throws IOException on error
@return the image
Encodes data in the CCITT G4 FAX format.
Creates a new encoder.
@param width the line width
Encodes a number of lines.
@param data the data to be encoded
@param offset the offset into the data
@param size the size of the data to be encoded
Encodes a full image.
@param data the data to encode
@param width the image width
@param height the image height
@return the encoded image
Encodes a number of lines.
@param data the data to be encoded
@param height the number of lines to encode
Closes the encoder and returns the encoded data.
@return the encoded data
Reads gif images of all types. All the images in a gif are read in the constructors
and can be retrieved with other methods.
@author Paulo Soares
Reads gif images from an URL.
@param url the URL
@throws IOException on error
Reads gif images from a file.
@param file the file
@throws IOException on error
Reads gif images from a byte array.
@param data the byte array
@throws IOException on error
Reads gif images from a stream. The stream isp not closed.
@param isp the stream
@throws IOException on error
Gets the number of frames the gif has.
@return the number of frames the gif has
Gets the image from a frame. The first frame isp 1.
@param frame the frame to get the image from
@return the image
Gets the [x,y] position of the frame in reference to the
logical screen.
@param frame the frame
@return the [x,y] position of the frame
Gets the logical screen. The images may be smaller and placed
in some position in this screen to playback some animation.
No image will be be bigger that this.
@return the logical screen dimensions as [x,y]
Reads GIF file header information.
Reads Logical Screen Descriptor
Reads next 16-bit value, LSB first
Reads next variable length block from input.
@return number of bytes stored in "buffer"
Reads next frame image
Resets frame state for reading next image.
Reads Graphics Control Extension values
Skips variable length blocks up to and including
next zero length block.
Support for JBIG2 Images.
This class assumes that we are always embedding into a pdf.
@since 2.1.5
Gets a byte array that can be used as a /JBIG2Globals,
or null if not applicable to the given jbig2.
@param ra an random access file or array
@return a byte array
returns an Image representing the given page.
@param ra the file or array containing the image
@param page the page number of the image
@return an Image object
Class to read a JBIG2 file at a basic level: understand all the segments,
understand what segments belong to which pages, how many pages there are,
what the width and height of each page is, and global segments if there
are any. Or: the minimum required to be able to take a normal sequential
or random-access organized file, and be able to embed JBIG2 pages as images
in a PDF.
TODO: the indeterminate-segment-size value of dataLength, else?
@since 2.1.5
Inner class that holds information about a JBIG2 segment.
@since 2.1.5
Inner class that holds information about a JBIG2 page.
@since 2.1.5
return as a single byte array the header-data for each segment in segment number
order, EMBEDDED organization, but i am putting the needed segments in SEQUENTIAL organization.
if for_embedding, skip the segment types that are known to be not for acrobat.
@param for_embedding
@return a byte array
@throws IOException
Some PNG specific values.
A PNG marker.
A PNG marker.
A PNG marker.
A PNG marker.
A PNG marker.
A PNG marker.
A PNG marker.
A PNG marker.
A PNG marker.
A PNG marker.
Creates a new instance of PngImage
Reads a PNG from an url.
@param url the url
@throws IOException on error
@return the image
Reads a PNG from a stream.
@param is the stream
@throws IOException on error
@return the image
Reads a PNG from a file.
@param file the file
@throws IOException on error
@return the image
Reads a PNG from a byte array.
@param data the byte array
@throws IOException on error
@return the image
Gets an int
from an Stream
.
@param is an Stream
@return the value of an int
Gets a word
from an Stream
.
@param is an Stream
@return the value of an int
Gets a String
from an Stream
.
@param is an Stream
@return the value of an int
A list of constants used in class TIFFImage.
A bool storing the endianness of the stream.
The number of entries in the IFD.
An array of TIFFFields.
A Hashtable indexing the fields by tag number.
The offset of this IFD.
The offset of the next IFD.
The default constructor.
Constructs a TIFFDirectory from a SeekableStream.
The directory parameter specifies which directory to read from
the linked list present in the stream; directory 0 is normally
read but it is possible to store multiple images in a single
TIFF file by maintaing multiple directories.
@param stream a SeekableStream to read from.
@param directory the index of the directory to read.
Constructs a TIFFDirectory by reading a SeekableStream.
The ifd_offset parameter specifies the stream offset from which
to begin reading; this mechanism is sometimes used to store
private IFDs within a TIFF file that are not part of the normal
sequence of IFDs.
@param stream a SeekableStream to read from.
@param ifd_offset the long byte offset of the directory.
@param directory the index of the directory to read beyond the
one at the current stream offset; zero indicates the IFD
at the current offset.
Returns the number of directory entries.
Returns the value of a given tag as a TIFFField,
or null if the tag is not present.
Returns true if a tag appears in the directory.
Returns an ordered array of ints indicating the tag
values.
Returns an array of TIFFFields containing all the fields
in this directory.
Returns the value of a particular index of a given tag as a
byte. The caller is responsible for ensuring that the tag is
present and has type TIFFField.TIFF_SBYTE, TIFF_BYTE, or
TIFF_UNDEFINED.
Returns the value of index 0 of a given tag as a
byte. The caller is responsible for ensuring that the tag is
present and has type TIFFField.TIFF_SBYTE, TIFF_BYTE, or
TIFF_UNDEFINED.
Returns the value of a particular index of a given tag as a
long. The caller is responsible for ensuring that the tag is
present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED,
TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG.
Returns the value of index 0 of a given tag as a
long. The caller is responsible for ensuring that the tag is
present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED,
TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG.
Returns the value of a particular index of a given tag as a
float. The caller is responsible for ensuring that the tag is
present and has numeric type (all but TIFF_UNDEFINED and
TIFF_ASCII).
Returns the value of index 0 of a given tag as a float. The
caller is responsible for ensuring that the tag is present and
has numeric type (all but TIFF_UNDEFINED and TIFF_ASCII).
Returns the value of a particular index of a given tag as a
double. The caller is responsible for ensuring that the tag is
present and has numeric type (all but TIFF_UNDEFINED and
TIFF_ASCII).
Returns the value of index 0 of a given tag as a double. The
caller is responsible for ensuring that the tag is present and
has numeric type (all but TIFF_UNDEFINED and TIFF_ASCII).
Returns the number of image directories (subimages) stored in a
given TIFF file, represented by a SeekableStream
.
Returns a bool indicating whether the byte order used in the
the TIFF file is big-endian (i.e. whether the byte order is from
the most significant to the least significant)
Returns the offset of the IFD corresponding to this
TIFFDirectory
.
Returns the offset of the next IFD after the IFD corresponding to this
TIFFDirectory
.
@param fillOrder The fill order of the compressed data bytes.
@param w
@param h
The logical order of bits within a byte.
1 = MSB-to-LSB
2 = LSB-to-MSB (flipped)
Uncompressed mode flag: 1 if uncompressed, 0 if not.
EOL padding flag: 1 if fill bits have been added before an EOL such
that the EOL ends on a byte boundary, 0 otherwise.
Coding dimensionality: 1 for 2-dimensional, 0 for 1-dimensional.
Invokes the superclass method and then sets instance variables on
the basis of the metadata set on this decompressor.
Flag for 8 bit unsigned integers.
Flag for null-terminated ASCII strings.
Flag for 16 bit unsigned integers.
Flag for 32 bit unsigned integers.
Flag for pairs of 32 bit unsigned integers.
Flag for 8 bit signed integers.
Flag for 8 bit uninterpreted bytes.
Flag for 16 bit signed integers.
Flag for 32 bit signed integers.
Flag for pairs of 32 bit signed integers.
Flag for 32 bit IEEE floats.
Flag for 64 bit IEEE doubles.
The tag number.
The tag type.
The number of data items present in the field.
The field data.
The default constructor.
Returns the tag number, between 0 and 65535.
Returns the type of the data stored in the IFD.
For a TIFF6.0 file, the value will equal one of the
TIFF_ constants defined in this class. For future
revisions of TIFF, higher values are possible.
Returns the number of elements in the IFD.
Reads TIFF images
@author Paulo Soares
Gets the number of pages the TIFF document has.
@param s the file source
@return the number of pages
Reads a page from a TIFF image.
@param s the file source
@param page the page to get. The first page is 1
@param direct for single strip, CCITT images, generate the image
by direct byte copying. It's faster but may not work
every time
@return the Image
Reads a page from a TIFF image. Direct mode is not used.
@param s the file source
@param page the page to get. The first page is 1
@return the Image
Reads a page from a TIFF image.
@param s the file source
@param page the page to get. The first page is 1
@param direct for single strip, CCITT images, generate the image
by direct byte copying. It's faster but may not work
every time
@return the Image
A class for performing LZW decoding.
Method to decode LZW compressed data.
@param data The compressed data.
@param uncompData Array to return the uncompressed data in.
@param h The number of rows the compressed data contains.
Initialize the string table.
Write out the string just uncompressed.
Add a new string to the string table.
Add a new string to the string table.
Append newString
to the end of oldString
.
@author psoares
Modified from original LZWCompressor to change interface to passing a
buffer of data to be compressed.
base underlying code size of data being compressed 8 for TIFF, 1 to 8 for GIF *
reserved clear code based on code size *
reserved end of data code based on code size *
current number bits output for each code *
limit at which current number of bits code size has to be increased *
the prefix code which represents the predecessor string to current input point *
output destination for bit codes *
general purpose LZW string table *
modify the limits of the code values in LZW encoding due to TIFF bug / feature *
@param outp destination for compressed data
@param codeSize the initial code size for the LZW compressor
@param TIFF flag indicating that TIFF lzw fudge needs to be applied
@exception IOException if underlying output stream error
@param buf data to be compressed to output stream
@exception IOException if underlying output stream error
Indicate to compressor that no more data to go so write outp
any remaining buffered data.
@exception IOException if underlying output stream error
General purpose LZW String Table.
Extracted from GIFEncoder by Adam Doppelt
Comments added by Robin Luiten
expandCode
added by Robin Luiten
The strLen_ table to give quick access to the lenght of an expanded
code for use by the expandCode
method added by Robin.
codesize + Reserved Codes
each entry corresponds to a code and contains the length of data
that the code expands to when decoded.
Constructor allocate memory for string store data
@param index value of -1 indicates no predecessor [used in initialisation]
@param b the byte [character] to add to the string store which follows
the predecessor string specified the index.
@return 0xFFFF if no space in table left for addition of predecesor
index and byte b. Else return the code allocated for combination index + b.
@param index index to prefix string
@param b the character that follws the index prefix
@return b if param index is HASH_FREE. Else return the code
for this prefix and byte successor
@param codesize the size of code to be preallocated for the
string store.
If expanded data doesnt fit into array only what will fit is written
to buf and the return value indicates how much of the expanded code has
been written to the buf. The next call to ExpandCode() should be with
the same code and have the skip parameter set the negated value of the
previous return. Succesive negative return values should be negated and
added together for next skip parameter value with same code.
@param buf buffer to place expanded data into
@param offset offset to place expanded data
@param code the code to expand to the byte array it represents.
PRECONDITION This code must allready be in the LZSS
@param skipHead is the number of bytes at the start of the expanded code to
be skipped before data is written to buf. It is possible that skipHead is
equal to codeLen.
@return the length of data expanded into buf. If the expanded code is longer
than space left in buf then the value returned is a negative number which when
negated is equal to the number of bytes that were used of the code being expanded.
This negative value also indicates the buffer is full.
@author psoares
@author psoares
@author psoares
@param seq
@return the cid code or -1 for end
@author psoares
@author psoares
@author psoares
This class represents a CMap file.
@author Ben Litchfield (ben@benlitchfield.com)
@since 2.1.4
Creates a new instance of CMap.
This will tell if this cmap has any one byte mappings.
@return true If there are any one byte mappings, false otherwise.
This will tell if this cmap has any two byte mappings.
@return true If there are any two byte mappings, false otherwise.
This will perform a lookup into the map.
@param code The code used to lookup.
@param offset The offset into the byte array.
@param length The length of the data we are getting.
@return The string that matches the lookup.
@author psoares
@author psoares
Interface providing alternate description for accessible elements.
Get the attribute of accessible element (everything in A
dictionary + Lang
, Alt
, ActualText
, E
).
@param key
@return
Set the attribute of accessible element (everything in A
dictionary + Lang
, Alt
, ActualText
, E
).
@param key
@param value
Gets all the properties of accessible element.
@return
Role propherty of the accessible element.
Note that all child elements won't also be tagged.
@return
Use this methods to get the AcroForm object.
Use this method only if you know what you're doing
@return the PdfAcroform object of the PdfDocument
Use this methods to add a PdfAnnotation
or a PdfFormField
to the document. Only the top parent of a PdfFormField
needs to be added.
@param annot the PdfAnnotation
or the PdfFormField
to add
Use this method to adds the PdfAnnotation
to the calculation order array.
@param annot the PdfAnnotation
to be added
Use this method to set the signature flags.
@param f the flags. This flags are ORed with current ones
A PDF document can have an open action and other additional actions.
When the document opens it will jump to the destination with
this name.
@param name the name of the destination to jump to
When the document opens this action
will be
invoked.
@param action the action to be invoked
Additional-actions defining the actions to be taken in
response to various trigger events affecting the document
as a whole. The actions types allowed are: DOCUMENT_CLOSE
,
WILL_SAVE
, DID_SAVE
, WILL_PRINT
and DID_PRINT
.
@param actionType the action type
@param action the action to execute in response to the trigger
@throws DocumentException on invalid action type
Encryption settings are described in section 3.5 (more specifically
section 3.5.2) of the PDF Reference 1.7.
They are explained in section 3.3.3 of the book 'iText in Action'.
The values of the different preferences were originally stored
in class PdfWriter, but they have been moved to this separate interface
for reasons of convenience.
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param 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 cleartext
@throws DocumentException if the document is already open
Sets the certificate encryption options for this document. An array of one or more public certificates
must be provided together with an array of the same size for the permissions for each certificate.
The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
@param certs the public certificates to be used for the encryption
@param permissions the user permissions for each of the certicates
@param encryptionType the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.
@throws DocumentException if the document is already open
A PDF page can have an open and/or close action.
Sets the open and close page additional action.
@param actionType the action type. It can be PdfWriter.PAGE_OPEN
or PdfWriter.PAGE_CLOSE
@param action the action to perform
@throws DocumentException if the action type is invalid
Sets the display duration for the page (for presentations)
@param seconds the number of seconds to display the page
Sets the transition for the page
@param transition the Transition object
Sets the run direction. This is only used as a placeholder
as it does not affect anything.
@param runDirection the run direction
The PDF version is described in the PDF Reference 1.7 p92
(about the PDF Header) and page 139 (the version entry in
the Catalog). You'll also find info about setting the version
in the book 'iText in Action' sections 2.1.3 (PDF Header)
and 3.3 (Version history).
If the PDF Header hasn't been written yet,
this changes the version as it will appear in the PDF Header.
If the PDF header was already written to the Stream,
this changes the version as it will appear in the Catalog.
@param version a character representing the PDF 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 param refers to a higher version.
If the PDF header was already written to the Stream,
this changes the version as it will appear in the Catalog.
@param version a character representing the PDF version
Sets the PDF version as it will appear in the Catalog.
Note that this only has effect if you use a later version
than the one that appears in the header. This method
ignores the parameter if you try to set a lower version
than the one currently set in the Catalog.
@param version the PDF name that will be used for the Version key in the catalog
Adds a developer extension to the Extensions dictionary
in the Catalog.
@param de an object that contains the extensions prefix and dictionary
@since 2.1.6
Viewer preferences are described in section 3.6.1 and 8.1 of the
PDF Reference 1.7 (Table 3.25 on p139-142 and Table 8.1 on p579-581).
They are explained in section 13.1 of the book 'iText in Action'.
The values of the different preferences were originally stored
in class PdfWriter, but they have been moved to this separate interface
for reasons of convenience.
Sets the PDF/X conformance level.
Allowed values are PDFX1A2001, PDFX32002, PDFA1A and PDFA1B.
It must be called before opening the document.
@param pdfxConformance the conformance level
Checks if the PDF/X Conformance is necessary.
@return true if the PDF has to be in conformance with any of the PDF/X specifications
Checks if any PDF ISO conformance is necessary.
@return true
if the PDF has to be in conformance with any of the PDF ISO specifications
Shape arabic characters. This code was inspired by an LGPL'ed C library:
Pango ( see http://www.pango.com/ ). Note that the code of this is the
original work of Paulo Soares. Hence it is perfectly justifiable to distribute
it under the MPL.
@author Paulo Soares
Some fonts do not implement ligaturized variations on Arabic characters
e.g. Simplified Arabic has got code point 0xFEED but not 0xFEEE
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.
Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).
Digit shaping option:
Replace European digits (U+0030...U+0039) by Arabic-Indic digits
if the most recent strongly directional character
is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
The initial state at the start of the text is assumed to be not an Arabic,
letter, so European digits at the start of the text will not change.
Compare to DIGITS_ALEN2AN_INIT_AL.
Digit shaping option:
Replace European digits (U+0030...U+0039) by Arabic-Indic digits
if the most recent strongly directional character
is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
The initial state at the start of the text is assumed to be an Arabic,
letter, so European digits at the start of the text will change.
Compare to DIGITS_ALEN2AN_INT_LR.
Not a valid option value.
Bit mask for digit shaping options.
Digit type option: Use Arabic-Indic digits (U+0660...U+0669).
Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).
Bit mask for digit type options.
Arabic is written from right to left.
@return true
@see com.itextpdf.text.pdf.languages.LanguageProcessor#isRTL()
Signals that a bad PDF format has been used to construct a PdfObject
.
@see PdfException
@see PdfBoolean
@see PdfNumber
@see PdfString
@see PdfName
@see PdfDictionary
@see PdfFont
Base class containing properties and methods commom to all
barcode types.
@author Paulo Soares
A type of barcode
A type of barcode
A type of barcode
A type of barcode
A type of barcode
A type of barcode
A type of barcode
A type of barcode
A type of barcode
A type of barcode
A type of barcode
A type of barcode
The minimum bar width.
The bar multiplier for wide bars or the distance between
bars for Postnet and Planet.
The text font. null
if no text.
The size of the text or the height of the shorter bar
in Postnet.
If positive, the text distance under the bars. If zero or negative,
the text distance above the bars.
The height of the bars.
The text Element. Can be Element.ALIGN_LEFT
,
Element.ALIGN_CENTER
or Element.ALIGN_RIGHT
.
The optional checksum generation.
Shows the generated checksum in the the text.
Show the start and stop character '*' in the text for
the barcode 39 or 'ABCD' for codabar.
Generates extended barcode 39.
The code to generate.
Show the guard bars for barcode EAN.
The code type.
The ink spreading.
Gets the minimum bar width.
@return the minimum bar width
Gets the bar multiplier for wide bars.
@return the bar multiplier for wide bars
Gets the text font. null
if no text.
@return the text font. null
if no text
Gets the size of the text.
@return the size of the text
Gets the text baseline.
If positive, the text distance under the bars. If zero or negative,
the text distance above the bars.
@return the baseline.
Gets the height of the bars.
@return the height of the bars
Gets the text Element. Can be Element.ALIGN_LEFT
,
Element.ALIGN_CENTER
or Element.ALIGN_RIGHT
.
@return the text alignment
The property for the optional checksum generation.
Sets the property to show the generated checksum in the the text.
@param checksumText new value of property checksumText
Gets the property to show the start and stop character '*' in the text for
the barcode 39.
@param startStopText new value of property startStopText
Sets the property to generate extended barcode 39.
@param extended new value of property extended
Gets the code to generate.
@return the code to generate
Sets the property to show the guard bars for barcode EAN.
@param guardBars new value of property guardBars
Gets the code type.
@return the code type
Gets the maximum area that the barcode and the text, if
any, will occupy. The lower left corner is always (0, 0).
@return the size the barcode occupies.
Creates a template with the barcode.
@param cb the PdfContentByte
to create the template. It
serves no other use
@param barColor the color of the bars. It can be null
@param textColor the color of the text. It can be null
@return the template
@see #placeBarcode(PdfContentByte cb, BaseColor barColor, BaseColor textColor)
Creates an Image
with the barcode.
@param cb the PdfContentByte
to create the Image
. It
serves no other use
@param barColor the color of the bars. It can be null
@param textColor the color of the text. It can be null
@return the Image
@see #placeBarcode(PdfContentByte cb, BaseColor barColor, BaseColor textColor)
The alternate text to be used, if present.
Sets the alternate text. If present, this text will be used instead of the
text derived from the supplied code.
@param altText the alternate text
The bars to generate the code.
The stop bars.
The charset code change.
The charset code change.
The charset code change.
The code for UCC/EAN-128.
The start code.
The start code.
The start code.
Creates new Barcode128
Removes the FNC1 codes in the text.
@param code the text to clean
@return the cleaned text
Gets the human readable text of a sequence of AI.
@param code the text
@return the human readable text
Returns true
if the next numDigits
starting from index textIndex
are numeric skipping any FNC1.
@param text the text to check
@param textIndex where to check from
@param numDigits the number of digits to check
@return the check result
Packs the digits for charset C also considering FNC1. It assumes that all the parameters
are valid.
@param text the text to pack
@param textIndex where to pack from
@param numDigits the number of digits to pack. It is always an even number
@return the packed digits, two digits per character
Converts the human readable text to the characters needed to
create a barcode using the specified code set.
@param text the text to convert
@param ucc true
if it is an UCC/EAN-128. In this case
the character FNC1 is added
@param codeSet forced code set, or AUTO for optimized barcode.
@return the code ready to be fed to getBarsCode128Raw()
Converts the human readable text to the characters needed to
create a barcode. Some optimization is done to get the shortest code.
@param text the text to convert
@param ucc true
if it is an UCC/EAN-128. In this case
the character FNC1 is added
@return the code ready to be fed to getBarsCode128Raw()
Generates the bars. The input has the actual barcodes, not
the human readable text.
@param text the barcode
@return the bars
Gets the maximum area that the barcode and the text, if
any, will occupy. The lower left corner is always (0, 0).
@return the size the barcode occupies.
Implements the code 39 and code 39 extended. The default parameters are:
x = 0.8f;
n = 2;
font = BaseFont.CreateFont("Helvetica", "winansi", false);
size = 8;
baseline = size;
barHeight = size * 3;
textint= Element.ALIGN_CENTER;
generateChecksum = false;
checksumText = false;
startStopText = true;
extended = false;
@author Paulo Soares
The bars to generate the code.
The index chars to BARS
.
The character combinations to make the code 39 extended.
Creates a new Barcode39.
Creates the bars.
@param text the text to create the bars. This text does not include the start and
stop characters
@return the bars
Converts the extended text into a normal, escaped text,
ready to generate bars.
@param text the extended text
@return the escaped text
Calculates the checksum.
@param text the text
@return the checksum
Gets the maximum area that the barcode and the text, if
any, will occupy. The lower left corner is always (0, 0).
@return the size the barcode occupies.
Implements the code codabar. The default parameters are:
x = 0.8f;
n = 2;
font = BaseFont.CreateFont("Helvetica", "winansi", false);
size = 8;
baseline = size;
barHeight = size * 3;
textAlignment = Element.ALIGN_CENTER;
generateChecksum = false;
checksumText = false;
startStopText = false;
@author Paulo Soares
The bars to generate the code.
The index chars to BARS
.
Creates a new BarcodeCodabar.
Creates the bars.
@param text the text to create the bars
@return the bars
Gets the maximum area that the barcode and the text, if
any, will occupy. The lower left corner is always (0, 0).
@return the size the barcode occupies.
No error.
The text is too big for the symbology capabilities.
The dimensions given for the symbol are illegal.
An error while parsing an extension.
The best encodation will be used.
ASCII encodation.
C40 encodation.
TEXT encodation.
Binary encodation.
X21 encodation.
X12 encodation.
@deprecated Use {@link BarcodeDataMatrix#DM_X12} instead.
EDIFACT encodation.
No encodation needed. The bytes provided are already encoded.
Allows extensions to be embedded at the start of the text.
Doesn't generate the image but returns all the other information.
Creates an instance of this class.
Gets an Image
with the barcode. A successful call to the method generate()
before calling this method is required.
@return the barcode Image
@throws BadElementException on error
Creates a java.awt.Image
. A successful call to the method generate()
before calling this method is required.
@param foreground the color of the bars
@param background the color of the background
@return the image
Gets the generated image. The image is represented as a stream of bytes, each byte representing
8 pixels, 0 for white and 1 for black, with the high-order bit of each byte first. Each row
is aligned at byte boundaries. The dimensions of the image are defined by height and width
plus 2 * ws.
@return the generated image
Gets/sets the whitespace border around the barcode.
@param ws the whitespace border around the barcode
Generates barcodes in several formats: EAN13, EAN8, UPCA, UPCE,
supplemental 2 and 5. The default parameters are:
x = 0.8f;
font = BaseFont.CreateFont("Helvetica", "winansi", false);
size = 8;
baseline = size;
barHeight = size * 3;
guardBars = true;
codeType = EAN13;
code = "";
@author Paulo Soares
The bar positions that are guard bars.
The bar positions that are guard bars.
The bar positions that are guard bars.
The bar positions that are guard bars.
The bar positions that are guard bars.
The x coordinates to place the text.
The x coordinates to place the text.
The basic bar widths.
The total number of bars for EAN13.
The total number of bars for EAN8.
The total number of bars for UPCE.
The total number of bars for supplemental 2.
The total number of bars for supplemental 5.
Marker for odd parity.
Marker for even parity.
Sequence of parities to be used with EAN13.
Sequence of parities to be used with supplemental 2.
Sequence of parities to be used with supplemental 2.
Sequence of parities to be used with UPCE.
Creates new BarcodeEAN
Calculates the EAN parity character.
@param code the code
@return the parity character
Converts an UPCA code into an UPCE code. If the code can not
be converted a null
is returned.
@param text the code to convert. It must have 12 numeric characters
@return the 8 converted digits or null
if the
code could not be converted
Creates the bars for the barcode EAN13 and UPCA.
@param _code the text with 13 digits
@return the barcode
Creates the bars for the barcode EAN8.
@param _code the text with 8 digits
@return the barcode
Creates the bars for the barcode UPCE.
@param _code the text with 8 digits
@return the barcode
Creates the bars for the barcode supplemental 2.
@param _code the text with 2 digits
@return the barcode
Creates the bars for the barcode supplemental 5.
@param _code the text with 5 digits
@return the barcode
Gets the maximum area that the barcode and the text, if
any, will occupy. The lower left corner is always (0, 0).
@return the size the barcode occupies.
The barcode with the EAN/UPC.
The barcode with the supplemental.
Creates new combined barcode.
@param ean the EAN/UPC barcode
@param supp the supplemental barcode
Gets the maximum area that the barcode and the text, if
any, will occupy. The lower left corner is always (0, 0).
@return the size the barcode occupies.
Implements the code interleaved 2 of 5. The text can include
non numeric characters that are printed but do not generate bars.
The default parameters are:
x = 0.8f;
n = 2;
font = BaseFont.CreateFont("Helvetica", "winansi", false);
size = 8;
baseline = size;
barHeight = size * 3;
textint= Element.ALIGN_CENTER;
generateChecksum = false;
checksumText = false;
@author Paulo Soares
The bars to generate the code.
Creates new BarcodeInter25
Deletes all the non numeric characters from text
.
@param text the text
@return a string
with only numeric characters
Calculates the checksum.
@param text the numeric text
@return the checksum
Creates the bars for the barcode.
@param text the text. It can contain non numeric characters
@return the barcode
Gets the maximum area that the barcode and the text, if
any, will occupy. The lower left corner is always (0, 0).
@return the size the barcode occupies.
Generates the 2D barcode PDF417. Supports dimensioning auto-sizing, fixed
and variable sizes, automatic and manual error levels, raw codeword input,
codeword size optimization and bitmap inversion. The output can
be a CCITT G4 Image
or a raw bitmap.
@author Paulo Soares
Auto-size is made based on aspectRatio
and yHeight
.
The size of the barcode will be at least codeColumns*codeRows
.
The size will be at least codeColumns
with a variable number of codeRows
.
The size will be at least codeRows
with a variable number of codeColumns
.
The error level correction is set automatically according
to ISO 15438 recomendations.
The error level correction is set by the user. It can be 0 to 8.
One single binary segment is used
No text
interpretation is done and the content of codewords
is used directly.
Inverts the output bits of the raw bitmap that is normally
bit one for black. It has only effect for the raw bitmap.
Use Macro PDF417 Encoding
@see #setMacroFileId(String)
@see #setMacroSegmentId(int)
@see #setMacroSegmentCount(int)
Creates a new BarcodePDF417
with the default settings.
Sets the segment id for macro PDF417 encoding
@param id the id (starting at 0)
@see #setMacroSegmentCount(int)
Sets the segment count for macro PDF417 encoding
@param cnt the number of macro segments
@see #setMacroSegmentId(int)
Sets the File ID for macro PDF417 encoding
@param id the file id
Set the default settings that correspond to PDF417_USE_ASPECT_RATIO
and PDF417_AUTO_ERROR_LEVEL
.
Paints the barcode. If no exception was thrown a valid barcode is available.
Gets an Image
with the barcode. The image will have to be
scaled in the Y direction by yHeight
for the barcode
to have the right printing aspect.
@return the barcode Image
@throws BadElementException on error
Gets the raw image bits of the barcode. The image will have to
be scaled in the Y direction by yHeight
.
@return The raw barcode image
Gets the number of X pixels of outBits
.
@return the number of X pixels of outBits
Gets the number of Y pixels of outBits
.
It is also the number of rows in the barcode.
@return the number of Y pixels of outBits
Sets the number of barcode rows. This number may be changed
to keep the barcode valid.
@param codeRows the number of barcode rows
Sets the number of barcode data columns.
This number may be changed to keep the barcode valid.
@param codeColumns the number of barcode data columns
Gets the codeword array. This array is always 928 elements long.
It can be writen to if the option PDF417_USE_RAW_CODEWORDS
is set.
@return the codeword array
Sets the length of the codewords.
@param lenCodewords the length of the codewords
Gets the error level correction used for the barcode. It may different
from the previously set value.
@return the error level correction used for the barcode
Sets the error level correction for the barcode.
@param errorLevel the error level correction for the barcode
Sets the bytes that form the barcode. This bytes should
be interpreted in the codepage Cp437.
@param text the bytes that form the barcode
Sets the text that will form the barcode. This text is converted
to bytes using the encoding Cp437.
@param s the text that will form the barcode
@throws UnsupportedEncodingException if the encoding Cp437 is not supported
Sets the options to generate the barcode. This can be all
the PDF417_*
constants.
@param options the options to generate the barcode
Sets the barcode aspect ratio. A ratio or 0.5 will make the
barcode width twice as large as the height.
@param aspectRatio the barcode aspect ratio
Sets the Y pixel height relative to X. It is usually 3.
@param yHeight the Y pixel height relative to X
Holds value of property outBits.
Holds value of property bitColumns.
Holds value of property codeRows.
Holds value of property codeColumns.
Holds value of property codewords.
Holds value of property lenCodewords.
Holds value of property errorLevel.
Holds value of property text.
Holds value of property options.
Holds value of property aspectRatio.
Holds value of property yHeight.
Gets the size of the barcode grid.
Implements the Postnet and Planet barcodes. The default parameters are:
n = 72f / 22f; // distance between bars
x = 0.02f * 72f; // bar width
barHeight = 0.125f * 72f; // height of the tall bars
size = 0.05f * 72f; // height of the short bars
codeType = POSTNET; // type of code
@author Paulo Soares
The bars for each character.
Creates new BarcodePostnet
Creates the bars for Postnet.
@param text the code to be created without checksum
@return the bars
Gets the maximum area that the barcode and the text, if
any, will occupy. The lower left corner is always (0, 0).
@return the size the barcode occupies.
A QRCode implementation based on the zxing code.
@author Paulo Soares
@since 5.0.2
Creates the QR barcode. The barcode is always created with the smallest possible size and is then stretched
to the width and height given. Set the width and height to 1 to get an unscaled barcode.
@param content the text to be encoded
@param width the barcode width
@param height the barcode height
@param hints modifiers to change the way the barcode is create. They can be EncodeHintType.ERROR_CORRECTION
and EncodeHintType.CHARACTER_SET. For EncodeHintType.ERROR_CORRECTION the values can be ErrorCorrectionLevel.L, M, Q, H.
For EncodeHintType.CHARACTER_SET the values are strings and can be Cp437, Shift_JIS and ISO-8859-1 to ISO-8859-16.
You can also use UTF-8, but correct behaviour is not guaranteed as Unicode is not supported in QRCodes.
The default value is ISO-8859-1.
@throws WriterException
Gets an Image
with the barcode.
@return the barcode Image
@throws BadElementException on error
Gets the size of the barcode grid.
A thin border with 1 point width.
A medium border with 2 point width.
A thick border with 3 point width.
The field is visible.
The field is hidden.
The field is visible but does not print.
The field is hidden but is printable.
The user may not change the value of the field.
The field must have a value at the time it is exported by a submit-form
action.
The field may contain multiple lines of text.
This flag is only meaningful with text fields.
The field will not scroll (horizontally for single-line
fields, vertically for multiple-line fields) to accommodate more text
than will fit within its annotation rectangle. Once the field is full, no
further text will be accepted.
The field is intended for entering a secure password that should
not be echoed visibly to the screen.
The text entered in the field represents the pathname of
a file whose contents are to be submitted as the value of the field.
The text entered in the field will not be spell-checked.
This flag is meaningful only in text fields and in combo
fields with the EDIT
flag set.
If set the combo box includes an editable text box as well as a drop list; if
clear, it includes only a drop list.
This flag is only meaningful with combo fields.
whether or not a list may have multiple selections. Only applies to /CH LIST
fields, not combo boxes.
combo box flag.
Holds value of property rotation.
Holds value of property visibility.
Holds value of property fieldName.
Holds value of property options.
Holds value of property maxCharacterLength.
Creates a new TextField
.
@param writer the document PdfWriter
@param box the field location and dimensions
@param fieldName the field name. If null
only the widget keys
will be included in the field allowing it to be used as a kid field.
Sets the border width in points. To eliminate the border
set the border color to null
.
@param borderWidth the border width in points
Sets the border style. The styles are found in PdfBorderDictionary
and can be STYLE_SOLID
, STYLE_DASHED
,
STYLE_BEVELED
, STYLE_INSET
and
STYLE_UNDERLINE
.
@param borderStyle the border style
Sets the border color. Set to null
to remove
the border.
@param borderColor the border color
Sets the background color. Set to null
for
transparent background.
@param backgroundColor the background color
Sets the text color. If null
the color used
will be black.
@param textColor the text color
Sets the text font. If null
then Helvetica
will be used.
@param font the text font
Sets the font size. If 0 then auto-sizing will be used but
only for text fields.
@param fontSize the font size
Sets the text horizontal alignment. It can be Element.ALIGN_LEFT
,
Element.ALIGN_CENTER
and Element.ALIGN_RIGHT
.
@param alignment the text horizontal alignment
Sets the text for text fields.
@param text the text
Sets the field dimension and position.
@param box the field dimension and position
Sets the field rotation. This value should be the same as
the page rotation where the field will be shown.
@param rotation the field rotation
Convenience method to set the field rotation the same as the
page rotation.
@param page the page
Sets the field visibility flag. This flags can be one of
VISIBLE
, HIDDEN
, VISIBLE_BUT_DOES_NOT_PRINT
and HIDDEN_BUT_PRINTABLE
.
@param visibility field visibility flag
Sets the field name.
@param fieldName the field name. If null
only the widget keys
will be included in the field allowing it to be used as a kid field.
Sets the option flags. The option flags can be a combination by oring of
READ_ONLY
, REQUIRED
,
MULTILINE
, DO_NOT_SCROLL
,
PASSWORD
, FILE_SELECTION
,
DO_NOT_SPELL_CHECK
and EDIT
.
@param options the option flags
Sets the maximum length of the field�s text, in characters.
It is only meaningful for text fields.
@param maxCharacterLength the maximum length of the field�s text, in characters
Moves the field keys from from
to to
. The moved keys
are removed from from
.
@param from the source
@param to the destination. It may be null
Summary description for BaseFont.
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
The maximum height above the baseline reached by glyphs in this
font, excluding the height of glyphs for accented characters.
The y coordinate of the top of flat capital letters, measured from
the baseline.
The maximum depth below the baseline reached by glyphs in this
font. The value is a negative number.
The angle, expressed in degrees counterclockwise from the vertical,
of the dominant vertical strokes of the font. The value is
negative for fonts that slope to the right, as almost all italic fonts do.
The lower left x glyph coordinate.
The lower left y glyph coordinate.
The upper right x glyph coordinate.
The upper right y glyph coordinate.
java.awt.Font property
java.awt.Font property
java.awt.Font property
java.awt.Font property
The underline position. Usually a negative value.
The underline thickness.
The strikethrough position.
The strikethrough thickness.
The recommended vertical size for subscripts for this font.
The recommended vertical offset from the baseline for subscripts for this font. Usually a negative value.
The recommended vertical size for superscripts for this font.
The recommended vertical offset from the baseline for superscripts for this font.
The weight class of the font, as defined by the font author
@since 5.0.2
The width class of the font, as defined by the font author
@since 5.0.2
The entry of PDF FontDescriptor dictionary.
(Optional; PDF 1.5; strongly recommended for Type 3 fonts in Tagged PDF documents)
The weight (thickness) component of the fully-qualified font name or font specifier.
A value larger than 500 indicates bold font-weight.
The font is Type 1.
The font is True Type with a standard encoding.
The font is CJK.
The font is True Type with a Unicode encoding.
A font already inside the document.
A Type3 font.
The Unicode encoding with horizontal writing.
The Unicode encoding with vertical writing.
A possible encoding.
A possible encoding.
A possible encoding.
A possible encoding.
A possible encoding.
default array of six numbers specifying the font matrix, mapping glyph space to text space
if the font has to be embedded
if the font doesn't have to be embedded
if the font has to be cached
if the font doesn't have to be cached
The path to the font resources.
The fake CID code that represents a newline.
* Unicode Character 'PARAGRAPH SEPARATOR' (U+2029)
* Treated as a line feed character in XFA rich and plain text.
* @since 5.4.3
The font type.
a not defined character in a custom PDF encoding
table of characters widths for this encoding
encoding names
same as differences but with the unicode codes
encoding used with this font
true if the font is to be embedded in the PDF
The compression level for the font stream.
@since 2.1.3
true if the font must use its built in encoding. In that case the
encoding
is only used to map a char to the position inside
the font, not to the expected char name.
cache for the fonts already used.
list of the 14 built in fonts.
Forces the output of the width array. Only matters for the 14
built-in fonts.
Converts char
directly to byte
by casting.
Indicates if all the glyphs and widths for that particular
encoding should be included in the document.
Custom encodings use this map to key the Unicode character
to the single byte code.
Generates the PDF stream with the Type1 and Truetype fonts returning
a PdfStream.
Generates the PDF stream with the Type1 and Truetype fonts returning
a PdfStream.
@param contents the content of the stream
@param lengths an array of int that describes the several lengths of each part of the font
@param compressionLevel the compression level of the Stream
@throws DocumentException error in the stream compression
@since 2.1.3 (replaces the constructor without param compressionLevel)
Generates the PDF stream for a font.
@param contents the content of a stream
@param subType the subtype of the font.
@param compressionLevel the compression level of the Stream
@throws DocumentException error in the stream compression
@since 2.1.3 (replaces the constructor without param compressionLevel)
Creates new BaseFont
Creates a new font. This will always be the default Helvetica font (not embedded).
This method is introduced because Helvetica is used in many examples.
@return a BaseFont object (Helvetica, Winansi, not embedded)
@throws IOException This shouldn't occur ever
@throws DocumentException This shouldn't occur ever
@since 2.1.1
Creates a font based on an existing document font. The created font font may not
behave as expected, depending on the encoding or subset.
@param fontRef the reference to the document font
@return the font
Indicates whether the font is used for verticl writing or not.
@return true
if the writing mode is vertical for the given font, false
otherwise.
Gets the name without the modifiers Bold, Italic or BoldItalic.
@param name the full name of the font
@return the name without the modifiers Bold, Italic or BoldItalic
Normalize the encoding names. "winansi" is changed to "Cp1252" and
"macroman" is changed to "MacRoman".
@param enc the encoding to be normalized
@return the normalized encoding
Creates the widths
and the differences
arrays
@throws UnsupportedEncodingException the encoding is not supported
Gets the width from the font according to the Unicode char c
or the name
. If the name
is null it's a symbolic font.
@param c the unicode char
@param name the glyph name
@return the width of the char
Gets the kerning between two Unicode chars.
@param char1 the first char
@param char2 the second char
@return the kerning to be applied
Sets the kerning between two Unicode chars.
@param char1 the first char
@param char2 the second char
@param kern the kerning to apply in normalized 1000 units
@return true
if the kerning was applied, false
otherwise
Gets the width of a char
in normalized 1000 units.
@param char1 the unicode char
to get the width of
@return the width in normalized 1000 units
Gets the width of a string
in normalized 1000 units.
@param text the string
to get the witdth of
@return the width in normalized 1000 units
Gets the descent of a String
in normalized 1000 units. The descent will always be
less than or equal to zero even if all the characters have an higher descent.
@param text the String
to get the descent of
@return the dexcent in normalized 1000 units
Gets the ascent of a String
in normalized 1000 units. The ascent will always be
greater than or equal to zero even if all the characters have a lower ascent.
@param text the String
to get the ascent of
@return the ascent in normalized 1000 units
Gets the descent of a String
in points. The descent will always be
less than or equal to zero even if all the characters have an higher descent.
@param text the String
to get the descent of
@param fontSize the size of the font
@return the dexcent in points
Gets the ascent of a String
in points. The ascent will always be
greater than or equal to zero even if all the characters have a lower ascent.
@param text the String
to get the ascent of
@param fontSize the size of the font
@return the ascent in points
Gets the width of a String
in points taking kerning
into account.
@param text the String
to get the witdth of
@param fontSize the font size
@return the width in points
Gets the width of a string
in points.
@param text the string
to get the witdth of
@param fontSize the font size
@return the width in points
Gets the width of a char
in points.
@param char1 the char
to get the witdth of
@param fontSize the font size
@return the width in points
Outputs to the writer the font dictionaries and streams.
@param writer the writer for this document
@param ref the font indirect reference
@param params several parameters that depend on the font type
@throws IOException on error
@throws DocumentException error in generating the object
Returns a PdfStream object with the full font program (if possible).
This method will return null for some types of fonts (CJKFont, Type3Font)
or if there is no font program available (standard Type 1 fonts).
@return a PdfStream with the font program
@since 2.1.3
Gets the encoding used to convert string
into byte[]
.
@return the encoding name
Gets the font parameter identified by key
. Valid values
for key
are ASCENT
, CAPHEIGHT
, DESCENT
,
ITALICANGLE
, BBOXLLX
, BBOXLLY
, BBOXURX
and BBOXURY
.
@param key the parameter to be extracted
@param fontSize the font size in points
@return the parameter in points
Sets the font parameter identified by key
. Valid values
for key
are ASCENT
, CAPHEIGHT
, DESCENT
,
ITALICANGLE
, BBOXLLX
, BBOXLLY
, BBOXURX
and BBOXURY
.
@param key the parameter to be updated
@param value the parameter value
Gets the font type. The font types can be: FONT_TYPE_T1,
FONT_TYPE_TT, FONT_TYPE_CJK and FONT_TYPE_TTUNI.
@return the font type
Gets the embedded flag.
@return true
if the font is embedded.
Gets the symbolic flag of the font.
@return true
if the font is symbolic
Creates a unique subset prefix to be added to the font name when the font is embedded and subset.
@return the subset prefix
Gets the Unicode character corresponding to the byte output to the pdf stream.
@param index the byte index
@return the Unicode character
Gets the postscript font name.
@return the postscript font name
Gets all the names from the font. Only the required tables are read.
@param name the name of the font
@param encoding the encoding of the font
@param ttfAfm the true type font or the afm in a byte array
@throws DocumentException on error
@throws IOException on error
@return an array of Object[] built with {getPostscriptFontName(), GetFamilyFontName(), GetFullFontName()}
Gets all the entries of the namestable from the font. Only the required tables are read.
@param name the name of the font
@param encoding the encoding of the font
@param ttfAfm the true type font or the afm in a byte array
@throws DocumentException on error
@throws IOException on error
@return an array of Object[] built with {getPostscriptFontName(), getFamilyFontName(), getFullFontName()}
Gets the code pages supported by the font. This has only meaning
with True Type fonts.
@return the code pages supported by the font
Enumerates the postscript font names present inside a
True Type Collection.
@param ttcFile the file name of the font
@throws DocumentException on error
@throws IOException on error
@return the postscript font names
Enumerates the postscript font names present inside a
True Type Collection.
@param ttcArray the font as a byte
array
@throws DocumentException on error
@throws IOException on error
@return the postscript font names
Gets the font width array.
@return the font width array
Gets the array with the names of the characters.
@return the array with the names of the characters
Gets the array with the unicode characters.
@return the array with the unicode characters
Set to true
to force the generation of the
widths array.
@param forceWidthsOutput true
to force the generation of the
widths array
Sets the conversion of char
directly to byte
by casting. This is a low level feature to put the bytes directly in
the content stream without passing through string.GetBytes().
@param directTextToByte New value of property directTextToByte.
Indicates if all the glyphs and widths for that particular
encoding should be included in the document. When set to true
only the glyphs used will be included in the font. When set to false
and {@link #addSubsetRange(int[])} was not called the full font will be included
otherwise just the characters ranges will be included.
@param subset new value of property subset
Gets the CID code given an Unicode.
It has only meaning with CJK fonts.
@param c the Unicode
@return the CID equivalent
Checks if the font has any kerning pairs.
@return true
if the font has any kerning pairs
Checks if a character exists in this font.
@param c the character to check
@return true
if the character has a glyph,
false
otherwise
Sets the character advance.
@param c the character
@param advance the character advance normalized to 1000 units
@return true
if the advance was set,
false
otherwise
Gets a list of all document fonts. Each element of the ArrayList
contains a Object[]{String,PRIndirectReference}
with the font name
and the indirect reference to it.
@param reader the document where the fonts are to be listed from
@return the list of fonts and references
Gets a list of the document fonts in a particular page. Each element of the ArrayList
contains a Object[]{String,PRIndirectReference}
with the font name
and the indirect reference to it.
@param reader the document where the fonts are to be listed from
@param page the page to list the fonts from
@return the list of fonts and references
Gets the smallest box enclosing the character contours. It will return
null
if the font has not the information or the character has no
contours, as in the case of the space, for example. Characters with no contours may
also return [0,0,0,0].
@param c the character to get the contour bounding box from
@return an array of four floats with the bounding box in the format [llx,lly,urx,ury] or
null
Gets default array of six numbers specifying the font matrix, mapping glyph space to text space
@return an array of six values
null
iText expects Arabic Diactrics (tashkeel) to have zero advance but some fonts,
most notably those that come with Windows, like times.ttf, have non-zero
advance for those characters. This method makes those character to have zero
width advance and work correctly in the iText Arabic shaping and reordering
context.
Adds a character range when subsetting. The range is an int
array
where the first element is the start range inclusive and the second element is the
end range inclusive. Several ranges are allowed in the same array.
@param range the character range
Sets the compression level to be used for the font streams.
@param compressionLevel a value between 0 (best speed) and 9 (best compression)
@since 2.1.3
Does all the line bidirectional processing with PdfChunk assembly.
@author Paulo Soares
Creates new BidiLine
Call this after processLine() to know if any word was split into several lines.
@return
Gets the width of a range of characters.
@param startIdx the first index to calculate
@param lastIdx the last inclusive index to calculate
@return the sum of all widths
Gets the width of a range of characters.
@param startIdx the first index to calculate
@param lastIdx the last inclusive index to calculate
@param originalWidth the full width of the line. It is used in case of RTL and tab stops
@return the sum of all widths
Method that changes a String with Arabic characters into a String in which the ligatures are made.
@param s the original String
@param runDirection
@param arabicOptions
@return the String with the ligaturesc
Left-to-right
Left-to-Right Embedding
Left-to-Right Override
Right-to-Left
Right-to-Left Arabic
Right-to-Left Embedding
Right-to-Left Override
Pop Directional Format
European Number
European Number Separator
European Number Terminator
Arabic Number
Common Number Separator
Non-Spacing Mark
Boundary Neutral
Paragraph Separator
Segment Separator
Whitespace
Other Neutrals
Minimum bidi type value.
Maximum bidi type value.
Initialize using an array of direction types. Types range from TYPE_MIN to TYPE_MAX inclusive
and represent the direction codes of the characters in the text.
@param types the types array
Initialize using an array of direction types and an externally supplied paragraph embedding level.
The embedding level may be -1, 0, or 1. -1 means to apply the default algorithm (rules P2 and P3),
0 is for LTR paragraphs, and 1 is for RTL paragraphs.
@param types the types array
@param paragraphEmbeddingLevel the externally supplied paragraph embedding level.
The algorithm.
Does not include line-based processing (Rules L1, L2).
These are applied later in the line-based phase of the algorithm.
Rules X9.
Remove explicit codes so that they may be ignored during the remainder
of the main portion of the algorithm. The length of the resulting text
is returned.
@return the length of the data excluding explicit codes and BN.
Reinsert levels information for explicit codes.
This is for ease of relating the level information
to the original input data. Note that the levels
assigned to these codes are arbitrary, they're
chosen so as to avoid breaking level runs.
@param textLength the length of the data after compression
@return the length of the data (original length of
types array supplied to constructor)
2) determining explicit levels
Rules X1 - X8
The interaction of these rules makes handling them a bit complex.
This examines resultTypes but does not modify it. It returns embedding and
override information in the result array. The low 7 bits are the level, the high
bit is set if the level is an override, and clear if it is an embedding.
3) resolving weak types
Rules W1-W7.
Note that some weak types (EN, AN) remain after this processing is complete.
6) resolving neutral types
Rules N1-N2.
7) resolving implicit embedding levels
Rules I1, I2.
Return multiline reordering array for a given level array.
Reordering does not occur across a line break.
Return reordering array for a given level array. This reorders a single line.
The reordering is a visual to logical map. For example,
the leftmost char is string.CharAt(order[0]).
Rule L2.
Return the base level of the paragraph.
Return true if the type is considered a whitespace type for the line break rules.
Return the strong type (L or R) corresponding to the level.
Return the limit of the run starting at index that includes only resultTypes in validSet.
This checks the value at index, and will return index if that value is not in validSet.
Return the start of the run including index that includes only resultTypes in validSet.
This assumes the value at index is valid, and does not check it.
Set resultTypes from start up to (but not including) limit to newType.
Set resultLevels from start up to (but not including) limit to newLevel.
Throw exception if type array is invalid.
Throw exception if paragraph embedding level is invalid. Special allowance for -1 so that
default processing can still be performed when using this API.
Throw exception if line breaks array is invalid.
Acts like a StringBuilder
but works with byte
arrays.
floating point is converted to a format suitable to the PDF.
@author Paulo Soares
The count of bytes in the buffer.
The buffer where the bytes are stored.
If true
always output floating point numbers with 6 decimal digits.
If false
uses the faster, although less precise, representation.
Creates new ByteBuffer with capacity 128
Creates a byte buffer with a certain capacity.
@param size the initial capacity
You can fill the cache in advance if you want to.
@param decimals
Converts an double (multiplied by 100 and cast to an int) into an array of bytes.
@param i the int
@return a bytearray
Appends an int
. The size of the array will grow by one.
@param b the int to be appended
@return a reference to this ByteBuffer
object
Appends the subarray of the byte
array. The buffer will grow by
len
bytes.
@param b the array to be appended
@param off the offset to the start of the array
@param len the length of bytes to Append
@return a reference to this ByteBuffer
object
Appends an array of bytes.
@param b the array to be appended
@return a reference to this ByteBuffer
object
Appends a string
to the buffer. The string
is
converted according to the encoding ISO-8859-1.
@param str the string
to be appended
@return a reference to this ByteBuffer
object
Appends a char
to the buffer. The char
is
converted according to the encoding ISO-8859-1.
@param c the char
to be appended
@return a reference to this ByteBuffer
object
Appends another ByteBuffer
to this buffer.
@param buf the ByteBuffer
to be appended
@return a reference to this ByteBuffer
object
Appends the string representation of an int
.
@param i the int
to be appended
@return a reference to this ByteBuffer
object
Appends the string representation of a long
.
@param i the long
to be appended
@return a reference to this ByteBuffer
object
Appends a string representation of a float
according
to the Pdf conventions.
@param i the float
to be appended
@return a reference to this ByteBuffer
object
Appends a string representation of a double
according
to the Pdf conventions.
@param d the double
to be appended
@return a reference to this ByteBuffer
object
Outputs a double
into a format suitable for the PDF.
@param d a double
@return the string
representation of the double
Outputs a double
into a format suitable for the PDF.
@param d a double
@param buf a ByteBuffer
@return the String
representation of the double
if
buf
is null
. If buf
is not null
,
then the double is appended directly to the buffer and this methods returns null
.
Sets the size to zero.
Creates a newly allocated byte array. Its size is the current
size of this output stream and the valid contents of the buffer
have been copied into it.
@return the current contents of this output stream, as a byte array.
Returns the current size of the buffer.
@return the value of the count
field, which is the number of valid bytes in this byte buffer.
Converts the buffer's contents into a string, translating bytes into
characters according to the platform's default character encoding.
@return string translated from the buffer's contents.
Writes the complete contents of this byte buffer output to
the specified output stream argument, as if by calling the output
stream's write method using out.Write(buf, 0, count)
.
@param out the output stream to which to write the data.
@exception IOException if an I/O error occurs.
List items for the linked list that builds the new CID font.
remember the current offset and increment by item's size in bytes.
Emit the byte stream for this item.
Fix up cross references to this item (applies only to markers).
set the value of an offset item that was initially unknown.
It will be fixed up latex by a call to xref on some marker.
A range item.
An index-offset item for the list.
The size denotes the required size in the CFF. A positive
value means that we need a specific size in bytes (for offset arrays)
and a negative value means that this is a dict item that uses a
variable-size representation.
@author orly manor
TODO To change the template for this generated type comment go to
Window - Preferences - Java - Code Generation - Code and Comments
an unknown offset in a dictionary for the list.
We will fix up the offset later; for now, assume it's large.
Card24 item.
Card32 item.
A SID or Card16 item.
A Card8 item.
A dictionary number on the list.
This implementation is inefficient: it doesn't use the variable-length
representation.
An offset-marker item for the list.
It is used to mark an offset and to set the offset list item.
a utility that creates a range item for an entire index
@param indexOffset where the index is
@return a range item representing the entire index
get a single CID font. The PDF architecture (1.4)
supports 16-bit strings only with CID CFF fonts, not
in Type-1 CFF fonts, so we convert the font to CID if
it is in the Type-1 format.
Two other tasks that we need to do are to select
only a single font from the CFF package (this again is
a PDF restriction) and to subset the CharStrings glyph
description.
A random Access File or an array
(contributed by orly manor)
The Strings in this array represent Type1/Type2 operator names
The Strings in this array represent Type1/Type2 escape operator names
Operator codes for unused CharStrings and unused local and global Subrs
A HashMap containing the glyphs used in the text after being converted
to glyph number by the CMap
The GlyphsUsed keys as an ArrayList
A HashMap for keeping the FDArrays being used by the font
A HashMaps array for keeping the subroutines used in each FontDict
The SubroutinesUsed HashMaps as ArrayLists
A HashMap for keeping the Global subroutines used in the font
The Global SubroutinesUsed HashMaps as ArrayLists
A HashMap for keeping the subroutines used in a non-cid font
The SubroutinesUsed HashMap as ArrayList
An array of the new Indexs for the local Subr. One index for each FontDict
The new subroutines index for a non-cid font
The new global subroutines index of the font
The new CharString of the font
The bias for the global subroutines
The linked list for generating the new font stream
Number of arguments to the stem operators in a subroutine calculated recursivly
C'tor for CFFFontSubset
@param rf - The font file
@param GlyphsUsed - a HashMap that contains the glyph used in the subset
Calculates the length of the charset according to its format
@param Offset The Charset Offset
@param NumofGlyphs Number of glyphs in the font
@return the length of the Charset
Function calculates the number of ranges in the Charset
@param NumofGlyphs The number of glyphs in the font
@param Type The format of the Charset
@return The number of ranges in the Charset data structure
Read the FDSelect of the font and compute the array and its length
@param Font The index of the font being processed
@return The Processed FDSelect of the font
Function reads the FDSelect and builds the FDArrayUsed HashMap According to the glyphs used
@param Font the Number of font being processed
Read the FDArray count, offsize and Offset array
@param Font
The Process function extracts one font out of the CFF file and returns a
subset version of the original.
@param fontName - The name of the font to be taken out of the CFF
@return The new font stream
@throws IOException
Function calcs bias according to the CharString type and the count
of the subrs
@param Offset The offset to the relevent subrs index
@param Font the font
@return The calculated Bias
Function uses BuildNewIndex to create the new index of the subset charstrings
@param FontIndex the font
@throws IOException
The function finds for the FD array processed the local subr offset and its
offset array.
@param Font the font
@param FD The FDARRAY processed
The function reads a subrs (glyph info) between begin and end.
Adds calls to a Lsubr to the hSubr and lSubrs.
Adds calls to a Gsubr to the hGSubr and lGSubrs.
@param begin the start point of the subr
@param end the end point of the subr
@param GBias the bias of the Global Subrs
@param LBias the bias of the Local Subrs
@param hSubr the HashMap for the lSubrs
@param lSubr the ArrayList for the lSubrs
Function Checks how the current operator effects the run time stack after being run
An operator may increase or decrease the stack size
Function checks the key and return the change to the stack after the operator
@return The change in the stack. 2-> flush the stack
Empty the Type2 Stack
Pop one element from the stack
Add an item to the stack
The function reads the next command after the file pointer is set
The function reads the subroutine and returns the number of the hint in it.
If a call to another subroutine is found the function calls recursively.
@param begin the start point of the subr
@param end the end point of the subr
@param LBias the bias of the Local Subrs
@param GBias the bias of the Global Subrs
@param LSubrsOffsets The Offsets array of the subroutines
@return The number of hints in the subroutine read.
Function builds the new offset array, object array and assembles the index.
used for creating the glyph and subrs subsetted index
@param Offsets the offset array of the original index
@param Used the hashmap of the used objects
@param OperatorForUnusedEntries the operator inserted into the data stream for unused entries
@return the new index subset version
@throws IOException
Function builds the new offset array, object array and assembles the index.
used for creating the glyph and subrs subsetted index
@param Offsets the offset array of the original index
@param OperatorForUnusedEntries the operator inserted into the data stream for unused entries
@return the new index subset version
@throws IOException
Function creates the new index, inserting the count,offsetsize,offset array
and object array.
@param NewOffsets the subsetted offset array
@param NewObjects the subsetted object array
@return the new index created
The function builds the new output stream according to the subset process
@param Font the font
@return the subseted font stream
@throws IOException
Function Copies the header from the original fileto the output list
Function Build the header of an index
@param Count the count field of the index
@param Offsize the offsize field of the index
@param First the first offset of the index
Function adds the keys into the TopDict
@param fdarrayRef OffsetItem for the FDArray
@param fdselectRef OffsetItem for the FDSelect
@param charsetRef OffsetItem for the CharSet
@param charstringsRef OffsetItem for the CharString
Function takes the original string item and adds the new strings
to accomodate the CID rules
@param Font the font
Function creates new FDSelect for non-CID fonts.
The FDSelect built uses a single range for all glyphs
@param fdselectRef OffsetItem for the FDSelect
@param nglyphs the number of glyphs in the font
Function creates new CharSet for non-CID fonts.
The CharSet built uses a single range for all glyphs
@param charsetRef OffsetItem for the CharSet
@param nglyphs the number of glyphs in the font
Function creates new FDArray for non-CID fonts.
The FDArray built has only the "Private" operator that points to the font's
original private dict
@param fdarrayRef OffsetItem for the FDArray
@param privateRef OffsetItem for the Private Dict
@param Font the font
Function reconstructs the FDArray, PrivateDict and LSubr for CID fonts
@param Font the font
@throws IOException
Function subsets the FDArray and builds the new one with new offsets
@param Font The font
@param fdPrivate OffsetItem Array (one for each FDArray)
@throws IOException
Function Adds the new private dicts (only for the FDs used) to the list
@param Font the font
@param fdPrivate OffsetItem array one element for each private
@param fdPrivateBase IndexBaseItem array one element for each private
@param fdSubrs OffsetItem array one element for each private
@throws IOException
Function Adds the new LSubrs dicts (only for the FDs used) to the list
@param Font The index of the font
@param fdPrivateBase The IndexBaseItem array for the linked list
@param fdSubrs OffsetItem array for the linked list
@throws IOException
Calculates how many byte it took to write the offset for the subrs in a specific
private dict.
@param Offset The Offset for the private dict
@param Size The size of the private dict
@return The size of the offset of the subrs in the private dict
Function computes the size of an index
@param indexOffset The offset for the computed index
@return The size of the index
The function creates a private dict for a font that was not CID
All the keys are copied as is except for the subrs key
@param Font the font
@param Subr The OffsetItem for the subrs of the private
the function marks the beginning of the subrs index and adds the subsetted subrs
index to the output list.
@param Font the font
@param PrivateBase IndexBaseItem for the private that's referencing to the subrs
@param Subrs OffsetItem for the subrs
@throws IOException
Creates a CJK font compatible with the fonts in the Adobe Asian font Pack.
@author Paulo Soares
The encoding used in the PDF document for CJK fonts
The path to the font resources.
The font name
The style modifier
The CMap name associated with this font
Creates a CJK font.
@param fontName the name of the font
@param enc the encoding of the font
@param emb always false
. CJK font and not embedded
@throws DocumentException on error
@throws IOException on error
Returns a font compatible with a CJK encoding or null if not found.
@param enc
@return
Checks if its a valid CJK font.
@param fontName the font name
@param enc the encoding
@return true
if it is CJK font
Gets the width of a char
in normalized 1000 units.
@param char1 the unicode char
to get the width of
@return the width in normalized 1000 units
You can't get the FontStream of a CJK font (CJK fonts are never embedded),
so this method always returns null.
@return null
@since 2.1.3
Gets the font parameter identified by key
. Valid values
for key
are ASCENT
, CAPHEIGHT
, DESCENT
and ITALICANGLE
.
@param key the parameter to be extracted
@param fontSize the font size in points
@return the parameter in points
Implementation of DocumentFont used while parsing PDF streams.
@since 2.1.4
The font dictionary.
the width of a space for this font, in normalized 1000 point units
The CMap constructed from the ToUnicode map from the font's dictionary, if present.
This CMap transforms CID values into unicode equivalent
Mapping between CID code (single byte only for now) and unicode equivalent
as derived by the font's encoding. Only needed if the ToUnicode CMap is not provided.
Creates an instance of a CMapAwareFont based on an indirect reference to a font.
@param refFont the indirect reference to a font
Parses the ToUnicode entry, if present, and constructs a CMap for it
@since 2.1.7
Inverts DocumentFont's uni2byte mapping to obtain a cid-to-unicode mapping based
on the font's encoding
@since 2.1.7
For all widths of all glyphs, compute the average width in normalized 1000 point units.
This is used to give some meaningful width in cases where we need an average font width
(such as if the width of a space isn't specified by a given font)
@return the average width of all non-zero width glyphs in the font
@since 2.1.5
Override to allow special handling for fonts that don't specify width of space character
@see com.itextpdf.text.pdf.DocumentFont#getWidth(int)
Decodes a single CID (represented by one or two bytes) to a unicode String.
@param bytes the bytes making up the character code to convert
@param offset an offset
@param len a length
@return a String containing the encoded form of the input bytes using the font's encoding.
Decodes a string of bytes (encoded in the font's encoding) into a unicode string
This will use the ToUnicode map of the font, if available, otherwise it uses
the font's encoding
@param cidbytes the bytes that need to be decoded
@return the unicode String that results from decoding
@since 2.1.7
! .NET SPECIFIC; this method is used to avoid unecessary using of StringBuilder because it is slow in .NET !
Decodes a single character string of bytes (encoded in the font's encoding) into a unicode string
This will use the ToUnicode map of the font, if available, otherwise it uses
the font's encoding
@param cidbytes the bytes that need to be decoded
@return the unicode String that results from decoding
Encodes bytes to a String.
@param bytes the bytes from a stream
@param offset an offset
@param len a length
@return a String encoded taking into account if the bytes are in unicode or not.
@deprecated method name is not indicative of what it does. Use decode
instead.
@author Paulo Soares
A type of PDF Collection
A type of PDF Collection
A type of PDF Collection
A type of PDF Collection
Constructs a PDF Collection.
@param type the type of PDF collection.
Identifies the document that will be initially presented
in the user interface.
@param description the description that was used when attaching the file to the document
Sets the Collection schema dictionary.
@param schema an overview of the collection fields
Sets the Collection sort dictionary.
@param sort a collection sort dictionary
@author blowagie
A possible type of collection field.
A possible type of collection field.
A possible type of collection field.
A possible type of collection field.
A possible type of collection field.
A possible type of collection field.
A possible type of collection field.
A possible type of collection field.
The type of the PDF collection field.
Creates a PdfCollectionField.
@param name the field name
@param type the field type
The relative order of the field name. Fields are sorted in ascending order.
@param i a number indicating the order of the field
Sets the initial visibility of the field.
@param visible the default is true (visible)
Indication if the field value should be editable in the viewer.
@param editable the default is false (not editable)
Checks if the type of the field is suitable for a Collection Item.
Returns a PdfObject that can be used as the value of a Collection Item.
@param String value the value that has to be changed into a PdfObject (PdfString, PdfDate or PdfNumber)
The PdfCollectionSchema with the names and types of the items.
Constructs a Collection Item that can be added to a PdfFileSpecification.
Sets the value of the collection item.
@param value
Sets the value of the collection item.
@param value
Sets the value of the collection item.
@param value
Sets the value of the collection item.
@param value
Sets the value of the collection item.
@param value
Sets the value of the collection item.
@param value
Sets the value of the collection item.
@param value
Sets the value of the collection item.
@param value
Adds a prefix for the Collection item.
You can only use this method after you have set the value of the item.
@param prefix a prefix
Creates a Collection Schema dictionary.
Adds a Collection field to the Schema.
@param name the name of the collection field
@param field a Collection Field
Constructs a PDF Collection Sort Dictionary.
@param key the key of the field that will be used to sort entries
Constructs a PDF Collection Sort Dictionary.
@param keys the keys of the fields that will be used to sort entries
Defines the sort order of the field (ascending or descending).
@param ascending true is the default, use false for descending order
Defines the sort order of the field (ascending or descending).
@param ascending an array with every element corresponding with a name of a field.
Creates dictionary referring to a target document that is the parent of the current document.
@param nested null if this is the actual target, another target if this is only an intermediate target.
Creates a dictionary referring to a target document.
@param child if false, this refers to the parent document; if true, this refers to a child document, and you'll have to specify where to find the child using the other methods of this class
If this dictionary refers to a child that is a document level attachment,
you need to specify the name that was used to attach the document.
@param name the name in the EmbeddedFiles name tree
If this dictionary refers to a child that is a file attachment added to a page,
you need to specify the name of the page (or use setFileAttachmentPage to specify the page number).
Once you have specified the page, you still need to specify the attachment using another method.
@param name the named destination referring to the page with the file attachment.
If this dictionary refers to a child that is a file attachment added to a page,
you need to specify the page number (or use setFileAttachmentPagename to specify a named destination).
Once you have specified the page, you still need to specify the attachment using another method.
@param page the page number of the page with the file attachment.
If this dictionary refers to a child that is a file attachment added to a page,
you need to specify the page with setFileAttachmentPage or setFileAttachmentPageName,
and then specify the name of the attachment added to this page (or use setFileAttachmentIndex).
@param name the name of the attachment
If this dictionary refers to a child that is a file attachment added to a page,
you need to specify the page with setFileAttachmentPage or setFileAttachmentPageName,
and then specify the index of the attachment added to this page (or use setFileAttachmentName).
@param name the name of the attachment
If this dictionary refers to an intermediate target, you can
add the next target in the sequence.
@param nested the next target in the sequence
Each colorSpace in the document will have an instance of this class
@author Phillip Pan (phillip@formstar.com)
The indirect reference to this color
The color name that appears in the document body stream
The color
Each spot color used in a document has an instance of this class.
@param colorName the color name
@param indirectReference the indirect reference to the font
@param scolor the PDfSpotColor
Gets the indirect reference to this color.
@return the indirect reference to this color
Gets the color name as it appears in the document body.
@return the color name
Gets the SpotColor
object.
@return the PdfSpotColor
Eliminate the arabic vowels
Compose the tashkeel in the ligatures.
Do some extra double ligatures.
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.
Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).
Digit shaping option:
Replace European digits (U+0030...U+0039) by Arabic-Indic digits
if the most recent strongly directional character
is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
The initial state at the start of the text is assumed to be not an Arabic,
letter, so European digits at the start of the text will not change.
Compare to DIGITS_ALEN2AN_INIT_AL.
Digit shaping option:
Replace European digits (U+0030...U+0039) by Arabic-Indic digits
if the most recent strongly directional character
is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
The initial state at the start of the text is assumed to be an Arabic,
letter, so European digits at the start of the text will change.
Compare to DIGITS_ALEN2AN_INT_LR.
Digit type option: Use Arabic-Indic digits (U+0660...U+0669).
Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).
Signals that there is no more text available.
Signals that there is no more column.
The column is valid.
The line is out the column limits.
The line cannot fit this column position.
Upper bound of the column.
Lower bound of the column.
The column Element. Default is left Element.
The left column bound.
The right column bound.
The chunks that form the text.
The current y line location. Text will be written at this line minus the leading.
The X position after the last line that has been written.
@since 5.0.3
The leading for the current line.
The fixed text leading.
The text leading that is multiplied by the biggest font size in the line.
The PdfContent
where the text will be written to.
The line status when trying to fit a line to a column.
The first paragraph line indent.
The following paragraph lines indent.
The right paragraph lines indent.
The extra space between paragraphs.
The width of the line when the column is defined as a simple rectangle.
Holds value of property spaceCharRatio.
Holds value of property linesWritten.
Holds value of property arabicOptions.
Pointer for the row in a table that is being dealt with
@since 5.1.0
The index of the last row that needed to be splitted.
@since 5.0.1 changed a boolean into an int
-2 value mean it is the first attempt to split the first row.
-1 means that we try to avoid splitting current row.
if true, first line height is adjusted so that the max ascender touches the top
@since 5.4.2
Creates a ColumnText
.
@param text the place where the text will be written to. Can
be a template.
Creates an independent duplicated of the instance org
.
@param org the original ColumnText
@return the duplicated
Makes this instance an independent copy of org
.
@param org the original ColumnText
@return itself
Adds a Phrase
to the current text array.
@param phrase the text
Replaces the current text array with this Phrase
.
Anything added previously with AddElement() is lost.
@param phrase the text
Adds a Chunk
to the current text array.
Will not have any effect if AddElement() was called before.
@param chunk the text
Finds the intersection between the yLine
and the column. It will
set the lineStatus
apropriatly.
@param wall the column to intersect
@return the x coordinate of the intersection
Finds the intersection between the yLine
and the two
column bounds. It will set the lineStatus
apropriatly.
@return a float[2]
with the x coordinates of the intersection
Finds the intersection between the yLine
,
the yLine-leading
and the two
column bounds. It will set the lineStatus
apropriatly.
@return a float[4]
with the x coordinates of the intersection
Sets the columns bounds. Each column bound is described by a
float[]
with the line points [x1,y1,x2,y2,...].
The array must have at least 4 elements.
@param leftLine the left column bound
@param rightLine the right column bound
Simplified method for rectangular columns.
@param phrase a Phrase
@param llx the lower left x corner
@param lly the lower left y corner
@param urx the upper right x corner
@param ury the upper right y corner
@param leading the leading
@param alignment the column alignment
Simplified method for rectangular columns.
@param llx the lower left x corner
@param lly the lower left y corner
@param urx the upper right x corner
@param ury the upper right y corner
@param leading the leading
@param alignment the column alignment
Simplified method for rectangular columns.
@param llx
@param lly
@param urx
@param ury
Simplified method for rectangular columns.
@param rect the rectangle for the column
Sets the leading fixed and variable. The resultant leading will be
fixedLeading+multipliedLeading*maxFontSize where maxFontSize is the
size of the bigest font in the line.
@param fixedLeading the fixed leading
@param multipliedLeading the variable leading
Gets the fixed leading
@return the leading
Gets the variable leading
@return the leading
Gets the yLine.
@return the yLine
Gets the number of rows that were drawn when a table is involved.
Gets the Element.
@return the alignment
Gets the first paragraph line indent.
@return the indent
Sets the first paragraph line indent.
@param indent the indent
@param repeatFirstLineIndent do we need to repeat the indentation of the first line after a newline?
Gets the following paragraph lines indent.
@return the indent
Gets the right paragraph lines indent.
@return the indent
Gets the currentLeading.
@return the currentLeading
Outputs the lines to the document. It is equivalent to go(false)
.
@return returns the result of the operation. It can be NO_MORE_TEXT
and/or NO_MORE_COLUMN
@throws DocumentException on error
Outputs the lines to the document. The output can be simulated.
@param simulate true
to simulate the writting to the document
@return returns the result of the operation. It can be NO_MORE_TEXT
and/or NO_MORE_COLUMN
@throws DocumentException on error
Call this after go() to know if any word was split into several lines.
@return
Sets the extra space between paragraphs.
@return the extra space between paragraphs
Clears the chunk array. A call to go()
will always return
NO_MORE_TEXT.
Gets the space/character extra spacing ratio for
fully justified text.
@return the space/character extra spacing ratio
Gets the run direction.
@return the run direction
Gets the number of lines written.
@return the number of lines written
Gets the X position of the end of the last line that has been written
(will not work in simulation mode!).
@since 5.0.3
Sets the arabic shaping options. The option can be AR_NOVOWEL,
AR_COMPOSEDTASHKEEL and AR_LIG.
@param arabicOptions the arabic shaping options
Gets the biggest descender value of the last line written.
@return the biggest descender value of the last line written
Gets the width that the line will occupy after writing.
Only the width of the first line is returned.
@param phrase the Phrase
containing the line
@param runDirection the run direction
@param arabicOptions the options for the arabic shaping
@return the width of the line
Gets the width that the line will occupy after writing.
Only the width of the first line is returned.
@param phrase the Phrase
containing the line
@return the width of the line
Shows a line of text. Only the first line is written.
@param canvas where the text is to be written to
@param alignment the alignment. It is not influenced by the run direction
@param phrase the Phrase
with the text
@param x the x reference position
@param y the y reference position
@param rotation the rotation to be applied in degrees counterclockwise
@param runDirection the run direction
@param arabicOptions the options for the arabic shaping
Shows a line of text. Only the first line is written.
@param canvas where the text is to be written to
@param alignment the alignment
@param phrase the Phrase
with the text
@param x the x reference position
@param y the y reference position
@param rotation the rotation to be applied in degrees counterclockwise
Fits the text to some rectangle adjusting the font size as needed.
@param font the font to use
@param text the text
@param rect the rectangle where the text must fit
@param maxFontSize the maximum font size
@param runDirection the run direction
@return the calculated font size that makes the text fit
Sets the canvas.
@param canvas
Sets the canvases.
@param canvas
Checks if the element has a height of 0.
@return true or false
@since 2.1.2
Enables/Disables adjustment of first line height based on max ascender.
@param use enable adjustment if true
Checks the status variable and looks if there's still some text.
Holds value of property filledWidth.
Sets the real width used by the largest line. Only used to set it
to zero to start another measurement.
@param filledWidth the real width used by the largest line
Replaces the filledWidth
if greater than the existing one.
@param w the new filledWidth
if greater than the existing one
Sets the first line adjustment. Some objects have properties, like spacing before, that
behave differently if the object is the first to be written after go() or not. The first line adjustment is
true
by default but can be changed if several objects are to be placed one
after the other in the same column calling go() several times.
@param adjustFirstLine true
to adjust the first line, false
otherwise
Creates an AES Cipher with CBC and no padding.
@author Paulo Soares
Creates a new instance of AESCipher
Creates a new instance of ARCFOUREncryption
An initialization vector generator for a CBC block encryption. It's a random generator based on RC4.
@author Paulo Soares
Creates a new instance of IVGenerator
Gets a 16 byte random initialization vector.
@return a 16 byte random initialization vector
Gets a random initialization vector.
@param len the length of the initialization vector
@return a random initialization vector
Creates a new instance of StandardDecryption
Creates an AES Cipher with CBC and padding PKCS5/7.
@author Paulo Soares
Creates a new instance of AESCipher
An instance of the default SplitCharacter.
Default constructor, has no custom characters to check.
Constructor with one splittable character.
@param character char
Constructor with an array of splittable characters
@param characters char[]
Returns the current character
@param current current position in the array
@param ck chunk array
@param cc the character array that has to be checked
@return the current character
Creates a new instance of DocumentFont
Creates a new instance of DocumentFont
Creates a new instance of DocumentFont
Gets the font parameter identified by key
. Valid values
for key
are ASCENT
, CAPHEIGHT
, DESCENT
,
ITALICANGLE
, BBOXLLX
, BBOXLLY
, BBOXURX
and BBOXURY
.
@param key the parameter to be extracted
@param fontSize the font size in points
@return the parameter in points
Gets the kerning between two Unicode chars.
@param char1 the first char
@param char2 the second char
@return the kerning to be applied
Gets the postscript font name.
@return the postscript font name
Gets the width from the font according to the Unicode char c
or the name
. If the name
is null it's a symbolic font.
@param c the unicode char
@param name the glyph name
@return the width of the char
Checks if the font has any kerning pairs.
@return true
if the font has any kerning pairs
Outputs to the writer the font dictionaries and streams.
@param writer the writer for this document
@param ref the font indirect reference
@param params several parameters that depend on the font type
@throws IOException on error
@throws DocumentException error in generating the object
Always returns null.
@return null
@since 2.1.3
Gets the width of a char
in normalized 1000 units.
@param char1 the unicode char
to get the width of
@return the width in normalized 1000 units
Exposes the unicode - > CID map that is constructed from the font's encoding
@return the unicode to CID map
@since 2.1.7
Exposes the CID - > unicode map that is constructed from the font's encoding
@return the CID to unicode map
@since 5.4.0
Gets the difference map
@return the difference map
@since 5.0.5
Element that draws a dotted line from left to right.
Can be added directly to a document or column.
Can also be used to create a separator chunk.
@since 2.1.2
the gap between the dots.
@see com.lowagie.text.pdf.draw.DrawInterface#draw(com.lowagie.text.pdf.PdfContentByte, float, float, float, float, float)
Setter for the gap between the center of the dots of the dotted line.
@param gap the gap between the center of the dots
Interface for an Element that allows you to draw something at the current
vertical position. Trivial implementations are LineSeparator and VerticalPositionMark.
It is also used to define what has to be drawn by a separator chunk.
@since 2.1.2
Implement this method if you want to draw something at the current Y position
(for instance a line).
@param canvas the canvas on which you can draw
@param llx the x coordinate of the left page margin
@param lly the y coordinate of the bottom page margin
@param urx the x coordinate of the right page margin
@param ury the y coordinate of the top page margin
@param y the current y position on the page
Element that draws a solid line from left to right.
Can be added directly to a document or column.
Can also be used to create a separator chunk.
@author Paulo Soares
@since 2.1.2
The thickness of the line.
The width of the line as a percentage of the available page width.
The color of the line.
The alignment of the line.
Creates a new instance of the LineSeparator class.
@param lineWidth the thickness of the line
@param percentage the width of the line as a percentage of the available page width
@param color the color of the line
@param align the alignment
@param offset the offset of the line relative to the current baseline (negative = under the baseline)
Creates a new instance of the LineSeparator class.
@param font the font
Creates a new instance of the LineSeparator class with
default values: lineWidth 1 user unit, width 100%, centered with offset 0.
@see com.lowagie.text.pdf.draw.DrawInterface#draw(com.lowagie.text.pdf.PdfContentByte, float, float, float, float, float)
Draws a horizontal line.
@param canvas the canvas to draw on
@param leftX the left x coordinate
@param rightX the right x coordindate
@param y the y coordinate
Setter for the line width.
@param lineWidth the thickness of the line that will be drawn.
Setter for the width as a percentage of the available width.
@return a width percentage
Setter for the color of the line that will be drawn.
@param color a color
Setter for the alignment of the line.
@param align an alignment value
Helper class implementing the DrawInterface. Can be used to add
horizontal or vertical separators. Won't draw anything unless
you implement the draw method.
@since 2.1.2
Another implementation of the DrawInterface; its draw method will overrule LineSeparator.Draw().
The offset for the line.
Creates a vertical position mark that won't draw anything unless
you define a DrawInterface.
Creates a vertical position mark that won't draw anything unless
you define a DrawInterface.
@param drawInterface the drawInterface for this vertical position mark.
@param offset the offset for this vertical position mark.
@see com.lowagie.text.pdf.draw.DrawInterface#draw(com.lowagie.text.pdf.PdfContentByte, float, float, float, float, float)
@see com.lowagie.text.Element#process(com.lowagie.text.ElementListener)
@see com.lowagie.text.Element#type()
@see com.lowagie.text.Element#isContent()
@see com.lowagie.text.Element#isNestable()
@see com.lowagie.text.Element#getChunks()
Setter for the interface with the overruling Draw() method.
@param drawInterface a DrawInterface implementation
Setter for the offset. The offset is relative to the current
Y position. If you want to underline something, you have to
choose a negative offset.
@param offset an offset
Enumerates all the fonts inside a True Type Collection.
@author Paulo Soares
Class for an index.
@author Michael Niedermair
Keeps a map with fields that are to be positioned in inGenericTag.
Keeps the form field that is to be positioned in a cellLayout event.
The PdfWriter to use when a field has to added in a cell event.
The PdfFormField that is the parent of the field added in a cell event.
Creates a new event. This constructor will be used if you need to position fields with Chunk objects.
Some extra padding that will be taken into account when defining the widget.
Add a PdfFormField that has to be tied to a generic Chunk.
Creates a new event. This constructor will be used if you need to position fields with a Cell Event.
Creates a new event. This constructor will be used if you need to position fields with a Cell Event.
Creates a new event. This constructor will be used if you need to position fields with a Cell Event.
@throws DocumentException
@throws IOException
Creates a new event. This constructor will be used if you need to position fields with a Cell Event.
@throws DocumentException
@throws IOException
@param padding The padding to set.
@param parent The parent to set.
@see com.lowagie.text.pdf.PdfPageEvent#onGenericTag(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document, com.lowagie.text.Rectangle, java.lang.String)
@see com.lowagie.text.pdf.PdfPCellEvent#cellLayout(com.lowagie.text.pdf.PdfPCell, com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])
Class for an index.
@author Michael Niedermair
keeps the indextag with the pagenumber
All the text that is passed to this event, gets registered in the indexentry.
@see com.lowagie.text.pdf.PdfPageEventHelper#onGenericTag(
com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document,
com.lowagie.text.Rectangle, java.lang.String)
indexcounter
the list for the index entry
Create an index entry.
@param text The text for the Chunk.
@param in1 The first level.
@param in2 The second level.
@param in3 The third level.
@return Returns the Chunk.
Create an index entry.
@param text The text for the Chunk.
@param in1 The first level.
@return Returns the Chunk.
Create an index entry.
@param text The text for the Chunk.
@param in1 The first level.
@param in2 The second level.
@return Returns the Chunk.
Create an index entry.
@param text The text.
@param in1 The first level.
@param in2 The second level.
@param in3 The third level.
Create an index entry.
@param text The text.
@param in1 The first level.
Create an index entry.
@param text The text.
@param in1 The first level.
@param in2 The second level.
Comparator for sorting the index
Set the comparator.
@param aComparator The comparator to set.
Returns the sorted list with the entries and the collected page numbers.
@return Returns the sorted list with the entries and teh collected page numbers.
Class for an index entry.
In the first step, only in1, in2,in3 and tag are used.
After the collections of the index entries, pagenumbers are used.
first level
second level
third level
the tag
the lsit of all page numbers.
the lsit of all tags.
Create a new object.
@param aIn1 The first level.
@param aIn2 The second level.
@param aIn3 The third level.
@param aTag The tag.
Returns the in1.
@return Returns the in1.
Returns the in2.
@return Returns the in2.
Returns the in3.
@return Returns the in3.
Returns the tag.
@return Returns the tag.
Returns the pagenumer for this entry.
@return Returns the pagenumer for this entry.
Add a pagenumber.
@param number The page number.
@param tag
Returns the key for the map-entry.
@return Returns the key for the map-entry.
Returns the pagenumbers.
@return Returns the pagenumbers.
Returns the tags.
@return Returns the tags.
print the entry (only for test)
@return the toString implementation of the entry
If you want to add more than one page eventa to a PdfWriter,
you have to construct a PdfPageEventForwarder, add the
different events to this object and add the forwarder to
the PdfWriter.
ArrayList containing all the PageEvents that have to be executed.
Add a page eventa to the forwarder.
@param eventa an eventa that has to be added to the forwarder.
Called when the document is opened.
@param writer
the PdfWriter
for this document
@param document
the document
Called when a page is finished, just before being written to the
document.
@param writer
the PdfWriter
for this document
@param document
the document
If you want to add more than one event to a cell,
you have to construct a PdfPCellEventForwarder, add the
different events to this object and add the forwarder to
the PdfPCell.
ArrayList containing all the PageEvents that have to be executed.
Add a page event to the forwarder.
@param event an event that has to be added to the forwarder.
@see com.lowagie.text.pdf.PdfPCellEvent#cellLayout(com.lowagie.text.pdf.PdfPCell, com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])
If you want to add more than one page event to a PdfPTable,
you have to construct a PdfPTableEventForwarder, add the
different events to this object and add the forwarder to
the PdfWriter.
ArrayList containing all the PageEvents that have to be executed.
Add a page event to the forwarder.
@param event an event that has to be added to the forwarder.
@see com.lowagie.text.pdf.PdfPTableEvent#tableLayout(com.lowagie.text.pdf.PdfPTable, float[][], float[], int, int, com.lowagie.text.pdf.PdfContentByte[])
@see com.itextpdf.text.pdf.PdfPTableEventAfterSplit#afterSplitTable(com.itextpdf.text.pdf.PdfPTable, com.itextpdf.text.pdf.PdfPRow, int)
@since iText 5.4.3
@author Paulo Soares
Constructs an extended color of a certain type and a certain color.
@param type
@param red
@param green
@param blue
@param alpha
Reads an FDF form and makes the fields available
@author Paulo Soares
Reads an FDF form.
@param filename the file name of the form
@throws IOException on error
Reads an FDF form.
@param pdfIn the byte array with the form
@throws IOException on error
Reads an FDF form.
@param url the URL of the document
@throws IOException on error
Reads an FDF form.
@param is the InputStream
containing the document. The stream is read to the
end but is not closed
@throws IOException on error
Gets all the fields. The map is keyed by the fully qualified
field name and the value is a merged PdfDictionary
with the field content.
@return all the fields
Gets the field dictionary.
@param name the fully qualified field name
@return the field dictionary
Gets a byte[] containing a file that is embedded in the FDF.
@param name the fully qualified field name
@return the bytes of the file
@throws IOException
@since 5.0.1
Gets the field value or null
if the field does not
exist or has no value defined.
@param name the fully qualified field name
@return the field value or null
Gets the PDF file specification contained in the FDF.
@return the PDF file specification contained in the FDF
Writes an FDF form.
@author Paulo Soares
The PDF file associated with the FDF.
Creates a new FdfWriter.
Writes the content to a stream.
@param os the stream
@throws DocumentException on error
@throws IOException on error
Removes the field value.
@param field the field name
@return true
if the field was found and removed,
false
otherwise
Gets all the fields. The map is keyed by the fully qualified
field name and the values are PdfObject
.
@return a map with all the fields
Gets the field value.
@param field the field name
@return the field value or null
if not found
Sets the field value as a name.
@param field the fully qualified field name
@param value the value
@return true
if the value was inserted,
false
if the name is incompatible with
an existing field
Sets the field value as a string.
@param field the fully qualified field name
@param value the value
@return true
if the value was inserted,
false
if the name is incompatible with
an existing field
Sets the field value as a PDFAction
.
For example, this method allows setting a form submit button action using {@link PdfAction#createSubmitForm(String, Object[], int)}.
This method creates an A
entry for the specified field in the underlying FDF file.
Method contributed by Philippe Laflamme (plaflamme)
@param field the fully qualified field name
@param action the field's action
@return true
if the value was inserted,
false
if the name is incompatible with
an existing field
@since 2.1.5
Sets all the fields from this FdfReader
@param fdf the FdfReader
Sets all the fields from this PdfReader
@param pdf the PdfReader
Sets all the fields from this AcroFields
@param acro the AcroFields
Gets the PDF file name associated with the FDF.
@return the PDF file name associated with the FDF
Each font in the document will have an instance of this class
where the characters used will be represented.
@author Paulo Soares
The indirect reference to this font
The font name that appears in the document body stream
The font
The font if its an instance of TrueTypeFontUnicode
The array used with single byte encodings
The map used with double byte encodings. The key is Int(glyph) and the
value is int[]{glyph, width, Unicode code}
The font type
true
if the font is symbolic
Indicates if all the glyphs and widths for that particular
encoding should be included in the document.
Each font used in a document has an instance of this class.
This class stores the characters used in the document and other
specifics unique to the current working document.
@param fontName the font name
@param indirectReference the indirect reference to the font
@param baseFont the BaseFont
Gets the indirect reference to this font.
@return the indirect reference to this font
Gets the font name as it appears in the document body.
@return the font name
Gets the BaseFont
of this font.
@return the BaseFont
of this font
Converts the text into bytes to be placed in the document.
The conversion is done according to the font and the encoding and the characters
used are stored.
@param text the text to convert
@return the conversion
Writes the font definition to the document.
@param writer the PdfWriter
of this document
Indicates if all the glyphs and widths for that particular
encoding should be included in the document. Set to false
to include all.
@param subset new value of property subset
Adds a Font
to be searched for valid characters.
@param font the Font
Process the text so that it will render with a combination of fonts
if needed.
@param text the text
@return a Phrase
with one or more chunks
@author Paulo Soares
Hyphenates words automatically accordingly to the language and country.
The hyphenator engine was taken from FOP and uses the TEX patterns. If a language
is not provided and a TEX pattern for it exists, it can be easily adapted.
@author Paulo Soares
The hyphenator engine.
The second part of the hyphenated word.
Creates a new hyphenation instance usable in Chunk
.
@param lang the language ("en" for english, for example)
@param country the country ("GB" for Great-Britain or "none" for no country, for example)
@param leftMin the minimun number of letters before the hyphen
@param rightMin the minimun number of letters after the hyphen
Gets the hyphen symbol.
@return the hyphen symbol
Hyphenates a word and returns the first part of it. To get
the second part of the hyphenated word call getHyphenatedWordPost()
.
@param word the word to hyphenate
@param font the font used by this word
@param fontSize the font size used by this word
@param remainingWidth the width available to fit this word in
@return the first part of the hyphenated word including
the hyphen symbol, if any
Gets the second part of the hyphenated word. Must be called
after getHyphenatedWordPre()
.
@return the second part of the hyphenated word
Capacity increment size
The encapsulated array
Points to next free item
return number of items in array
returns current capacity of array
This is to implement memory allocation in the array. Like Malloc().
Capacity increment size
The encapsulated array
Points to next free item
Reset Vector but don't resize or clear elements
return number of items in array
returns current capacity of array
number of hyphenation points in word
rawWord as made of alternating strings and {@link Hyphen Hyphen}
instances
@return the number of hyphenation points in the word
@return the pre-break text, not including the hyphen character
@return the post-break text
@return the hyphenation points
value space: stores the inteletter values
This map stores hyphenation exceptions
This map stores the character classes
Temporary map to store interletter values on pattern loading.
Packs the values by storing them in 4 bits, two values into a byte
Values range is from 0 to 9. We use zero as terminator,
so we'll add 1 to the value.
@param values a string of digits from '0' to '9' representing the
interletter values.
@return the index into the vspace array where the packed values
are stored.
String compare, returns 0 if equal or
t is a substring of s
Hyphenate word and return a Hyphenation object.
@param word the word to be hyphenated
@param remainCharCount Minimum number of characters allowed
before the hyphenation point.
@param pushCharCount Minimum number of characters allowed after
the hyphenation point.
@return a {@link Hyphenation Hyphenation} object representing
the hyphenated word or null if word is not hyphenated.
w = "****nnllllllnnn*****",
where n is a non-letter, l is a letter,
all n may be absent, the first n is at offset,
the first l is at offset + iIgnoreAtBeginning;
word = ".llllll.'\0'***",
where all l in w are copied into word.
In the first part of the routine len = w.length,
in the second part of the routine len = word.length.
Three indices are used:
Index(w), the index in w,
Index(word), the index in word,
Letterindex(word), the index in the letter part of word.
The following relations exist:
Index(w) = offset + i - 1
Index(word) = i - iIgnoreAtBeginning
Letterindex(word) = Index(word) - 1
(see first loop).
It follows that:
Index(w) - Index(word) = offset - 1 + iIgnoreAtBeginning
Index(w) = Letterindex(word) + offset + iIgnoreAtBeginning
Hyphenate word and return an array of hyphenation points.
@param w char array that contains the word
@param offset Offset to first character in word
@param len Length of word
@param remainCharCount Minimum number of characters allowed
before the hyphenation point.
@param pushCharCount Minimum number of characters allowed after
the hyphenation point.
@return a {@link Hyphenation Hyphenation} object representing
the hyphenated word or null if word is not hyphenated.
Add a character class to the tree. It is used by
{@link SimplePatternParser SimplePatternParser} as callback to
add character classes. Character classes define the
valid word characters for hyphenation. If a word contains
a character not defined in any of the classes, it is not hyphenated.
It also defines a way to normalize the characters in order
to compare them with the stored patterns. Usually pattern
files use only lower case characters, in this case a class
for letter 'a', for example, should be defined as "aA", the first
character being the normalization char.
Add an exception to the tree. It is used by
{@link SimplePatternParser SimplePatternParser} class as callback to
store the hyphenation exceptions.
@param word normalized word
@param hyphenatedword a vector of alternating strings and
{@link Hyphen hyphen} objects.
Add a pattern to the tree. Mainly, to be used by
{@link SimplePatternParser SimplePatternParser} class as callback to
add a pattern to the tree.
@param pattern the hyphenation pattern
@param ivalue interletter weight values indicating the
desirability and priority of hyphenating at a given point
within the pattern. It should contain only digit characters.
(i.e. '0' to '9').
TODO: Don't use statics
@param lang
@param country
@param leftMin
@param rightMin
@param lang
@param country
@return the hyphenation tree
@param key
@return a hyphenation tree
@param lang
@param country
@param word
@param leftMin
@param rightMin
@return a hyphenation object
@param lang
@param country
@param word
@param offset
@param len
@param leftMin
@param rightMin
@return a hyphenation object
@param min
@param min
@param lang
@param country
@param word
@param offset
@param len
@return a hyphenation object
@param word
@return a hyphenation object
Add a character class.
A character class defines characters that are considered
equivalent for the purpose of hyphenation (e.g. "aA"). It
usually means to ignore case.
@param chargroup character group
Add a hyphenation exception. An exception replaces the
result obtained by the algorithm for cases for which this
fails or the user wants to provide his own hyphenation.
A hyphenatedword is a vector of alternating String's and
{@link Hyphen Hyphen} instances
Add hyphenation patterns.
@param pattern the pattern
@param values interletter values expressed as a string of
digit characters.
Parses the xml hyphenation pattern.
@author Paulo Soares
Creates a new instance of PatternParser2
Ternary Search Tree
A ternary search tree is a hibrid between a binary tree and
a digital search tree (trie). Keys are limited to strings.
A data value of type char is stored in each leaf node.
It can be used as an index (or pointer) to the data.
Branches that only contain one key are compressed to one node
by storing a pointer to the trailer substring of the key.
This class is intended to serve as base class or helper class
to implement Dictionary collections or the like. Ternary trees
have some nice properties as the following: the tree can be
traversed in sorted order, partial matches (wildcard) can be
implemented, retrieval of all keys within a given distance
from the target, etc. The storage requirements are higher than
a binary tree but a lot less than a trie. Performance is
comparable with a hash table, sometimes it outperforms a hash
function (most of the time can determine a miss faster than a hash).
The main purpose of this java port is to serve as a base for
implementing TeX's hyphenation algorithm (see The TeXBook,
appendix H). Each language requires from 5000 to 15000 hyphenation
patterns which will be keys in this tree. The strings patterns
are usually small (from 2 to 5 characters), but each char in the
tree is stored in a node. Thus memory usage is the main concern.
We will sacrify 'elegance' to keep memory requirenments to the
minimum. Using java's char type as pointer (yes, I know pointer
it is a forbidden word in java) we can keep the size of the node
to be just 8 bytes (3 pointers and the data char). This gives
room for about 65000 nodes. In my tests the english patterns
took 7694 nodes and the german patterns 10055 nodes,
so I think we are safe.
All said, this is a map with strings as keys and char as value.
Pretty limited!. It can be extended to a general map by
using the string representation of an object and using the
char value as an index to an array that contains the object
values.
@author cav@uniscope.co.jp
We use 4 arrays to represent a node. I guess I should have created
a proper node class, but somehow Knuth's pascal code made me forget
we now have a portable language with memory management and
automatic garbage collection! And now is kind of late, furthermore,
if it ain't broken, don't fix it.
Pointer to low branch and to rest of the key when it is
stored directly in this node, we don't have unions in java!
Pointer to high branch.
Pointer to equal branch and to data when this node is a string terminator.
The character stored in this node: splitchar
Two special values are reserved:
- 0x0000 as string terminator
- 0xFFFF to indicate that the branch starting at
this node is compressed
This shouldn't be a problem if we give the usual semantics to
strings since 0xFFFF is garanteed not to be an Unicode character.
This vector holds the trailing of the keys when the branch is compressed.
Branches are initially compressed, needing
one node per key plus the size of the string
key. They are decompressed as needed when
another key with same prefix
is inserted. This saves a lot of space,
specially for long keys.
The actual insertion function, recursive version.
Compares 2 null terminated char arrays
Compares a string with null terminated char array
Recursively insert the median first and then the median of the
lower and upper halves, and so on in order to get a balanced
tree. The array of keys is assumed to be sorted in ascending
order.
Balance the tree for best search performance
Each node stores a character (splitchar) which is part of
some Key(s). In a compressed branch (one that only contain
a single string key) the trailer of the key which is not
already in nodes is stored externally in the kv array.
As items are inserted, key substrings decrease.
Some substrings may completely disappear when the whole
branch is totally decompressed.
The tree is traversed to find the key substrings actually
used. In addition, duplicate substrings are removed using
a map (implemented with a TernaryTree!).
current node index
current key
TernaryTree parent
Node stack
key stack implemented with a StringBuilder
traverse upwards
traverse the tree to find next key
Summary description for ICC_Profile.
Classes implementing this interface can create custom encodings or
replace existing ones. It is used in the context of PdfEncoding
.
@author Paulo Soares
Converts an Unicode string to a byte array according to some encoding.
@param text the Unicode string
@param encoding the requested encoding. It's mainly of use if the same class
supports more than one encoding.
@return the conversion or null
if no conversion is supported
Converts an Unicode char to a byte array according to some encoding.
@param char1 the Unicode char
@param encoding the requested encoding. It's mainly of use if the same class
supports more than one encoding.
@return the conversion or null
if no conversion is supported
Converts a byte array to an Unicode string according to some encoding.
@param b the input byte array
@param encoding the requested encoding. It's mainly of use if the same class
supports more than one encoding.
@return the conversion or null
if no conversion is supported
Called by Chunk
to hyphenate a word.
@author Paulo Soares
Gets the hyphen symbol.
@return the hyphen symbol
Hyphenates a word and returns the first part of it. To get
the second part of the hyphenated word call getHyphenatedWordPost()
.
@param word the word to hyphenate
@param font the font used by this word
@param fontSize the font size used by this word
@param remainingWidth the width available to fit this word in
@return the first part of the hyphenated word including
the hyphen symbol, if any
Gets the second part of the hyphenated word. Must be called
after getHyphenatedWordPre()
.
@return the second part of the hyphenated word
This is the AcroForm object for the complete document.
This is the array containing the references to annotations
that were added to the document.
This is an array containg references to some delayed annotations
(that were added for a page that doesn't exist yet).
Checks if the AcroForm is valid.
Gets the AcroForm object.
@return the PdfAcroform object of the PdfDocument
Stores the PDF version information,
knows how to write a PDF Header,
and how to add the version to the catalog (if necessary).
Contains different strings that are part of the header.
Indicates if the header was already written.
Indicates if we are working in append mode.
The version that was or will be written to the header.
The version that will be written to the catalog.
The version that user can use to get the actual version of PDF document *
The extensions dictionary.
@since 2.1.6
@see com.lowagie.text.pdf.interfaces.PdfVersion#setPdfVersion(char)
@see com.lowagie.text.pdf.interfaces.PdfVersion#setAtLeastPdfVersion(char)
@see com.lowagie.text.pdf.interfaces.PdfVersion#setPdfVersion(com.lowagie.text.pdf.PdfName)
Sets the append mode.
Writes the header to the OutputStreamCounter.
@throws IOException
Returns the PDF version as a name.
@param version the version character.
Returns the version as a byte[].
@param version the version character
Adds the version to the Catalog dictionary.
@see com.lowagie.text.pdf.interfaces.PdfVersion#addDeveloperExtension(com.lowagie.text.pdf.PdfDeveloperExtension)
@since 2.1.6
Stores the information concerning viewer preferences,
and contains the business logic that allows you to set viewer preferences.
A series of viewer preferences.
A series of viewer preferences.
A series of viewer preferences.
A series of viewer preferences
A series of viewer preferences.
This value will hold the viewer preferences for the page layout and page mode.
This dictionary holds the viewer preferences (other than page layout and page mode).
The mask to decide if a ViewerPreferences dictionary is needed
Returns the page layout and page mode value.
Returns the viewer preferences.
Sets the viewer preferences as the sum of several constants.
@param preferences
the viewer preferences
@see PdfWriter#setViewerPreferences
Given a key for a viewer preference (a PdfName object),
this method returns the index in the VIEWER_PREFERENCES array.
@param key a PdfName referring to a viewer preference
@return an index in the VIEWER_PREFERENCES array
Checks if some value is valid for a certain key.
Sets the viewer preferences for printing.
Adds the viewer preferences defined in the preferences parameter to a
PdfDictionary (more specifically the root or catalog of a PDF file).
@param catalog
The value indicating if the PDF has to be in conformance with PDF/X.
@see com.lowagie.text.pdf.interfaces.PdfXConformance#setPDFXConformance(int)
@see com.itextpdf.text.pdf.interfaces.PdfIsoConformance#isPdfIso()
Checks if the PDF/X Conformance is necessary.
@return true if the PDF has to be in conformance with any of the PDF/X specifications
Checks if the PDF has to be in conformance with PDF/X-1a:2001
@return true of the PDF has to be in conformance with PDF/X-1a:2001
Checks if the PDF has to be in conformance with PDF/X-3:2002
@return true of the PDF has to be in conformance with PDF/X-3:2002
Business logic that checks if a certain object is in conformance with PDF/X.
@param writer the writer that is supposed to write the PDF/X file
@param key the type of PDF ISO conformance that has to be checked
@param obj1 the object that is checked for conformance
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A key for an aspect that can be checked for PDF ISO Conformance.
A Hashtable that uses ints as the keys.
The hash table data.
The total number of entries in the hash table.
Rehashes the table when count exceeds this threshold.
The load factor for the hashtable.
Constructs a new, empty hashtable with the specified initial
Constructs a new, empty hashtable with the specified initial
Constructs a new, empty hashtable. A default capacity and load factor
Returns the number of elements contained in the hashtable.
Returns true if the hashtable contains no elements.
Returns true if the specified object is an element of the hashtable.
Returns true if the collection contains an element for the key.
Gets the object associated with the specified key in the
Rehashes the content of the table into a bigger table.
Removes the element corresponding to the key. Does nothing if the
Clears the hash table so that it has no more elements in it.
The interface common to all layer types.
@author Paulo Soares
Gets the PdfIndirectReference
that represents this layer.
@return the PdfIndirectReference
that represents this layer
Gets the object representing the layer.
@return the object representing the layer
Allows a class to catch several document events.
@author Paulo Soares
Called when the document is opened.
@param writer the PdfWriter
for this document
@param document the document
Called when a page is initialized.
Note that if even if a page is not written this method is still
called. It is preferable to use onEndPage
to avoid
infinite loops.
Note that this method isn't called for the first page. You should apply modifications for the first
page either before opening the document or by using the onOpenDocument() method.
@param writer the PdfWriter
for this document
@param document the document
Called when a page is finished, just before being written to the document.
@param writer the PdfWriter
for this document
@param document the document
Summary description for IPdfPCellEvent.
An interface that can be used to retrieve the position of cells in PdfPTable
.
@author Paulo Soares
Implementation of the IndicLigaturizer for Gujarati.
Constructor for the IndicLigaturizer for Gujarati.
Hebrew is written from right to left.
@return true
@see com.itextpdf.text.pdf.languages.LanguageProcessor#isRTL()
Interface that needs to be implemented by classes that process bytes
representing text in specific languages. Processing involves changing
order to Right to Left and/or applying ligatures.
Processes a String
@param s the original String
@return the processed String
Indicates if the rundirection is right-to-left.
@return true if text needs to be rendered from right to left.
Superclass for processors that can convert a String of bytes in an Indic
language to a String in the same language of which the bytes are reordered
for rendering using a font that contains the necessary glyphs.
The table mapping specific character indexes to the characters in a
specific language.
Reorders the bytes in a String making Indic ligatures
@param s
the original String
@return the ligaturized String
Indic languages are written from right to left.
@return false
@see com.itextpdf.text.pdf.languages.LanguageProcessor#isRTL()
Checks if a character is vowel letter.
@param ch
the character that needs to be checked
@return true if the characters is a vowel letter
Checks if a character is vowel sign.
@param ch
the character that needs to be checked
@return true if the characters is a vowel sign
Checks if a character is consonant letter.
@param ch
the character that needs to be checked
@return true if the chracter is a consonant letter
Swaps two characters in a StringBuilder object
@param s
the StringBuilder
@param i
the index of one character
@param j
the index of the other character
A class for performing LZW decoding.
Method to decode LZW compressed data.
@param data The compressed data.
@param uncompData Array to return the uncompressed data in.
Initialize the string table.
Write out the string just uncompressed.
Add a new string to the string table.
Add a new string to the string table.
Append newstring
to the end of oldstring
.
Represents a Bezier curve.
@since 5.5.6
If the distance between a point and a line is less than
this constant, then we consider the point lies on the line.
In the case when neither the line ((x1, y1), (x4, y4)) passes
through both (x2, y2) and (x3, y3) nor (x1, y1) = (x4, y4) we
use the square of the sum of the distances mentioned below in
compare to this field as the criterion of good approximation.
1. The distance between the line and (x2, y2)
2. The distance between the line and (x3, y3)
The Manhattan distance is used in the case when either the line
((x1, y1), (x4, y4)) passes through both (x2, y2) and (x3, y3)
or (x1, y1) = (x4, y4). The essential observation is that when
the curve is a uniform speed straight line from end to end, the
control points are evenly spaced from beginning to end. Our measure
of how far we deviate from that ideal uses distance of the middle
controls: point 2 should be halfway between points 1 and 3; point 3
should be halfway between points 2 and 4.
Constructs new bezier curve.
@param controlPoints Curve's control points.
{@inheritDoc}
You can adjust precision of the approximation by varying the following
parameters: {@link #curveCollinearityEpsilon}, {@link #distanceToleranceSquare},
{@link #distanceToleranceManhattan}
@return {@link java.util.List} containing points of piecewise linear approximation
for this bezier curve.
@since 5.5.6
@author kevin
@since 5.0.1
Gets the content bytes from a content object, which may be a reference
a stream or an array.
@param contentObject the object to read bytes from
@return the content bytes
@throws IOException
Gets the content bytes of a page from a reader
@param reader the reader to get content bytes from
@param pageNum the page number of page you want get the content stream from
@return a byte array with the effective content stream of a page
@throws IOException
@since 5.0.1
Simply extends the {@link com.itextpdf.text.pdf.parser.RenderListener} interface to provide
additional methods.
{@inheritDoc}
@since 5.5.6
Called when the current path is being modified. E.g. new segment is being added,
new subpath is being started etc.
@param renderInfo Contains information about the path segment being added to the current path.
Called when the current path should be rendered.
@param renderInfo Contains information about the current path which should be rendered.
@return The path which can be used as a new clipping path.
Called when the current path should be set as a new clipping path.
@param rule Either {@link PathPaintingRenderInfo#EVEN_ODD_RULE} or {@link PathPaintingRenderInfo#NONZERO_WINDING_RULE}
A text render listener that filters text operations before passing them on to a deleg
@since 5.0.1
The deleg that will receive the text render operation if the filters all pass
The filters to be applied
Construction
@param deleg the deleg {@link RenderListener} that will receive filtered text operations
@param filters the Filter(s) to apply
Applies filters, then delegates to the deleg if all filters pass
@param renderInfo contains info to render text
@see com.itextpdf.text.pdf.parser.RenderListener#renderText(com.itextpdf.text.pdf.parser.TextRenderInfo)
This class delegates this call
@see com.itextpdf.text.pdf.parser.RenderListener#beginTextBlock()
This class delegates this call
@see com.itextpdf.text.pdf.parser.RenderListener#endTextBlock()
Applies filters, then delegates to the deleg if all filters pass
@see com.itextpdf.text.pdf.parser.RenderListener#renderImage(com.itextpdf.text.pdf.parser.ImageRenderInfo)
@since 5.0.1
A text render listener that filters text operations before passing them on to a deleg
@since 5.0.1
The deleg that will receive the text render operation if the filters all pass
Construction
@param deleg the deleg {@link RenderListener} that will receive filtered text operations
@param filters the Filter(s) to apply
This class delegates this call
@see com.itextpdf.text.pdf.parser.TextExtractionStrategy#getResultantText()
Keeps all the parameters of the graphics state.
@since 2.1.4
The current transformation matrix.
The current character spacing.
The current word spacing.
The current horizontal scaling
The current leading.
The active font.
The current font size.
The current render mode.
The current text rise
The current knockout value.
The current color space for stroke.
The current color space for stroke.
The current fill color.
The current stroke color.
The line width for stroking operations
The line cap style. For possible values
see {@link PdfContentByte}
The line join style. For possible values
see {@link PdfContentByte}
The mitir limit value
The line dash pattern
Constructs a new Graphics State object with the default values.
Copy constructor.
@param source another GraphicsState object
Getter for the current transformation matrix
@return the ctm
@since iText 5.0.1
Getter for the character spacing.
@return the character spacing
@since iText 5.0.1
Getter for the word spacing
@return the word spacing
@since iText 5.0.1
Getter for the horizontal scaling
@return the horizontal scaling
@since iText 5.0.1
Getter for the leading
@return the leading
@since iText 5.0.1
Getter for the font
@return the font
@since iText 5.0.1
Getter for the font size
@return the font size
@since iText 5.0.1
Getter for the render mode
@return the renderMode
@since iText 5.0.1
Getter for text rise
@return the text rise
@since iText 5.0.1
Getter for knockout
@return the knockout
@since iText 5.0.1
Gets the current color space for fill operations
Gets the current color space for stroke operations
Gets the current fill color
@return a BaseColor
Gets the current stroke color
@return a BaseColor
Getter and setter for the line width.
@return The line width
@since 5.5.6
Getter and setter for the line cap style.
For possible values see {@link PdfContentByte}
@return The line cap style.
@since 5.5.6
Getter and setter for the line join style.
For possible values see {@link PdfContentByte}
@return The line join style.
@since 5.5.6
Getter and setter for the miter limit value.
@return The miter limit.
@since 5.5.6
Getter for the line dash pattern.
@return The line dash pattern.
@since 5.5.6
Setter for the line dash pattern.
@param lineDashPattern New line dash pattern.
@since 5.5.6
Interface implemented by a series of content operators
@since 2.1.4
Invokes a content operator.
@param processor the processor that is dealing with the PDF content
@param operator the literal PDF syntax of the operator
@param operands the operands that come with the operator
@throws Exception any exception can be thrown - it will be re-packaged into a runtime exception and re-thrown by the {@link PdfContentStreamProcessor}
Represents image data from a PDF
@since 5.0.1
The graphics state that was in effect when the image was rendered
A reference to the image XObject
A reference to an inline image
the color space associated with the image
the image object to be rendered, if it has been parsed already. Null otherwise.
Array containing marked content info for the text.
@since 5.5.11
Create an ImageRenderInfo object based on an XObject (this is the most common way of including an image in PDF)
@param ctm the coordinate transformation matrix at the time the image is rendered
@param ref a reference to the image XObject
@return the ImageRenderInfo representing the rendered XObject
@since 5.0.1
Create an ImageRenderInfo object based on an XObject (this is the most common way of including an image in PDF)
@param ctm the coordinate transformation matrix at the time the image is rendered
@param ref a reference to the image XObject
@return the ImageRenderInfo representing the rendered XObject
@since 5.0.1
Create an ImageRenderInfo object based on inline image data. This is nowhere near completely thought through
and really just acts as a placeholder.
@param ctm the coordinate transformation matrix at the time the image is rendered
@param imageObject the image object representing the inline image
@return the ImageRenderInfo representing the rendered embedded image
@since 5.0.1
Gets an object containing the image dictionary and bytes.
@return an object containing the image dictionary and byte[]
@since 5.0.2
@return a vector in User space representing the start point of the xobject
@return The coordinate transformation matrix active when this image was rendered. Coordinates are in User space.
@since 5.0.3
@return the size of the image, in User space units
@return an indirect reference to the image
@since 5.0.2
@return the current fill color from the graphics state at the time this render operation occured
@since 5.5.7
Checks if the image belongs to a marked content sequence
with a given mcid.
@param mcid a marked content id
@return true if the text is marked with this id
@since 5.5.11
* Checks if the image belongs to a marked content sequence
* with a given mcid.
* @param mcid a marked content id
* @param checkTheTopmostLevelOnly indicates whether to check the topmost level of marked content stack only
* @return true if the text is marked with this id
* @since 5.5.11
@return the marked content associated with the ImageRenderInfo instance.
Called when a new text block is beginning (i.e. BT)
@since iText 5.0.1
Called when text should be rendered
@param renderInfo information specifying what to render
Called when a text block has ended (i.e. ET)
@since iText 5.0.1
Called when image should be rendered
@param renderInfo information specifying what to render
@since iText 5.0.1
Defines an interface for {@link RenderListener}s that can return text
@since 5.0.2
Returns the result so far.
@return a String with the resulting text.
Represents a line.
@since 5.5.6
Constructs a new zero-length line starting at zero.
Constructs a new line based on the given coordinates.
Constructs a new line based on the given coordinates.
Represents the line dash pattern. The line dash pattern shall control the pattern
of dashes and gaps used to stroke paths. It shall be specified by a dash array and
a dash phase.
@since 5.5.6
Creates new {@link LineDashPattern} object.
@param dashArray The dash array. See {@link #getDashArray()}
@param dashPhase The dash phase. See {@link #getDashPhase()}
Getter and setter for the dash array.
The dash array’s elements is number that specify the lengths of
alternating dashes and gaps; the numbers are nonnegative. The
elements are expressed in user space units.
@return The dash array.
Getter and setter for the dash phase.
The dash phase shall specify the distance into the dash pattern at which
to start the dash. The elements are expressed in user space units.
@return The dash phase.
Calculates and returns the next element which is either gap or dash.
@return The next dash array's element.
Checks whether the dashed pattern is solid or not. It's solid when the
size of a dash array is even and sum of all the units off in the array
is 0.
For example: [3 0 4 0 5 0 6 0] (sum is 0), [3 0 4 0 5 1] (sum is 1).
Resets the dash array so that the {@link #next()} method will start
from the beginning of the dash array.
Represents a line segment in a particular coordinate system. This class is immutable.
@since 5.0.2
Start vector of the segment.
End vector of the segment.
Creates a new line segment.
@param startPoint the start point of a line segment.
@param endPoint the end point of a line segment.
@return the start point
@return the end point
@return the length of this line segment
@since 5.0.2
Computes the bounding rectangle for this line segment. The rectangle has a rotation 0 degrees
with respect to the coordinate system that the line system is in. For example, if a line segment
is 5 unit long and sits at a 37 degree angle from horizontal, the bounding rectangle will have
origin of the lower left hand end point of the segment, with width = 4 and height = 3.
@return the bounding rectangle
@since 5.0.2
Transforms the segment by the specified matrix
@param m the matrix for the transformation
@return the transformed segment
set to true for debugging
a summary of all found text
Creates a new text extraction renderer.
Creates a new text extraction renderer, with a custom strategy for
creating new TextChunkLocation objects based on the input of the
TextRenderInfo.
@param strat the custom strategy
@see com.itextpdf.text.pdf.parser.RenderListener#beginTextBlock()
@see com.itextpdf.text.pdf.parser.RenderListener#endTextBlock()
@param str
@return true if the string starts with a space character, false if the string is empty or starts with a non-space character
@param str
@return true if the string ends with a space character, false if the string is empty or ends with a non-space character
Filters the provided list with the provided filter
@param textChunks a list of all TextChunks that this strategy found during processing
@param filter the filter to apply. If null, filtering will be skipped.
@return the filtered list
@since 5.3.3
Determines if a space character should be inserted between a previous chunk and the current chunk.
This method is exposed as a callback so subclasses can fine time the algorithm for determining whether a space should be inserted or not.
By default, this method will insert a space if the there is a gap of more than half the font space character width between the end of the
previous chunk and the beginning of the current chunk. It will also indicate that a space is needed if the starting point of the new chunk
appears *before* the end of the previous chunk (i.e. overlapping text).
@param chunk the new chunk being evaluated
@param previousChunk the chunk that appeared immediately before the current chunk
@return true if the two chunks represent different words (i.e. should have a space between them). False otherwise.
Gets text that meets the specified filter
If multiple text extractions will be performed for the same page (i.e. for different physical regions of the page),
filtering at this level is more efficient than filtering using {@link FilteredRenderListener} - but not nearly as powerful
because most of the RenderInfo state is not captured in {@link TextChunk}
@param chunkFilter the filter to to apply
@return the text results so far, filtered using the specified filter
Returns the result so far.
@return a String with the resulting text.
Used for debugging only
@see com.itextpdf.text.pdf.parser.RenderListener#renderText(com.itextpdf.text.pdf.parser.TextRenderInfo)
the starting location of the chunk
the ending location of the chunk
the orientation as a scalar for quick sorting
perpendicular distance to the orientation unit vector (i.e. the Y position in an unrotated coordinate system)
we round to the nearest integer to handle the fuzziness of comparing floats
distance of the start of the chunk parallel to the orientation unit vector (i.e. the X position in an unrotated coordinate system)
distance of the end of the chunk parallel to the orientation unit vector (i.e. the X position in an unrotated coordinate system)
the width of a single space character in the font of the chunk
@param comparedLine the location to compare to
@return true is this location is on the the same line as the other
Computes the distance between the end of 'other' and the beginning of this chunk
in the direction of this chunk's orientation vector. Note that it's a bad idea
to call this for chunks that aren't on the same line and orientation, but we don't
explicitly check for that condition for performance reasons.
@param other
@return the number of spaces between the end of 'other' and the beginning of this chunk
unit vector in the orientation of the chunk
Compares based on orientation, perpendicular distance, then parallel distance
@see java.lang.Comparable#compareTo(java.lang.Object)
Represents a chunk of text, it's orientation, and location relative to the orientation vector
the text of the chunk
@return the start location of the text
@return the end location of the text
@return the width of a single space character as rendered by this chunk
Computes the distance between the end of 'other' and the beginning of this chunk
in the direction of this chunk's orientation vector. Note that it's a bad idea
to call this for chunks that aren't on the same line and orientation, but we don't
explicitly check for that condition for performance reasons.
@param other
@return the number of spaces between the end of 'other' and the beginning of this chunk
Compares based on orientation, perpendicular distance, then parallel distance
@see java.lang.Comparable#compareTo(java.lang.Object)
@param as the location to compare to
@return true is this location is on the the same line as the other
@param int1
@param int2
@return comparison of the two integers
no-op method - this renderer isn't interested in image events
@see com.itextpdf.text.pdf.parser.RenderListener#renderImage(com.itextpdf.text.pdf.parser.ImageRenderInfo)
@since 5.0.1
Specifies a filter for filtering {@link TextChunk} objects during text extraction
@see LocationTextExtractionStrategy#getResultantText(TextChunkFilter)
@since 5.3.3
@param textChunk the chunk to check
@return true if the chunk should be allowed
Represents a Marked Content block in a PDF
@since 5.0.2
Get the tag of this marked content
@return the tag of this marked content
Determine if an MCID is available
@return true if the MCID is available, false otherwise
Gets the MCID value If the Marked Content contains
an MCID entry, returns that value. Otherwise, a {@link NullPointerException} is thrown.
@return the MCID value
@throws NullPointerException if there is no MCID (see {@link MarkedContentInfo#hasMcid()})
A {@link RenderFilter} that only allows text within a specified marked content sequence.
@since 5.0.2
The MCID to match.
Constructs a filter
@param mcid the MCID to match
@see com.itextpdf.text.pdf.parser.RenderFilter#allowText(com.itextpdf.text.pdf.parser.TextRenderInfo)
Keeps all the values of a 3 by 3 matrix
and allows you to do some math with matrices.
@since 2.1.4
the row=1, col=1 position ('a') in the matrix.
the row=1, col=2 position ('b') in the matrix.
the row=1, col=3 position (always 0 for 2-D) in the matrix.
the row=2, col=1 position ('c') in the matrix.
the row=2, col=2 position ('d') in the matrix.
the row=2, col=3 position (always 0 for 2-D) in the matrix.
the row=3, col=1 ('e', or X translation) position in the matrix.
the row=3, col=2 ('f', or Y translation) position in the matrix.
the row=3, col=3 position (always 1 for 2-D) in the matrix.
the values inside the matrix (the identity matrix by default).
default initialization is performed in the default constructor.
constructs a new Matrix with identity.
!shall be called from any other constructor!
Constructs a matrix that represents translation
@param tx
@param ty
Creates a Matrix with 6 specified entries
@param a
@param b
@param c
@param d
@param e
@param f
Gets a specific value inside the matrix.
@param index an array index corresponding with a value inside the matrix
@return the value at that specific position.
multiplies this matrix by 'b' and returns the result
See http://en.wikipedia.org/wiki/Matrix_multiplication
@param by The matrix to multiply by
@return the resulting matrix
Subtracts a matrix from this matrix and returns the results
@param arg the matrix to subtract from this matrix
@return a Matrix object
Computes the determinant of the matrix.
@return the determinant of the matrix
Checks equality of matrices.
@param obj the other Matrix that needs to be compared with this matrix.
@return true if both matrices are equal
@see java.lang.Object#equals(java.lang.Object)
Generates a hash code for this object.
@return the hash code of this object
@see java.lang.Object#hashCode()
Generates a String representation of the matrix.
@return the values, delimited with tabs and newlines.
@see java.lang.Object#toString()
Attaches a {@link RenderListener} for the corresponding filter set.
@param delegate RenderListener instance to be attached.
@param filterSet filter set to be attached. The delegate will be invoked if all the filters pass.
Paths define shapes, trajectories, and regions of all sorts. They shall be used
to draw lines, define the shapes of filled areas, and specify boundaries for clipping
other graphics. A path shall be composed of straight and curved line segments, which
may connect to one another or may be disconnected.
@since 5.5.6
@return A {@link java.util.List} of subpaths forming this path.
Adds the subpath to this path.
@param subpath The subpath to be added to this path.
Adds the subpaths to this path.
@param subpaths {@link java.util.List} of subpaths to be added to this path.
The current point is the trailing endpoint of the segment most recently added to the current path.
@return The current point.
Begins a new subpath by moving the current point to coordinates (x, y)
.
Appends a straight line segment from the current point to the point (x, y)
.
Appends a cubic Bezier curve to the current path. The curve shall extend from
the current point to the point (x3, y3)
.
Appends a cubic Bezier curve to the current path. The curve shall extend from
the current point to the point (x3, y3)
with the note that the current
point represents two control points.
Appends a cubic Bezier curve to the current path. The curve shall extend from
the current point to the point (x3, y3)
with the note that the (x3, y3)
point represents two control points.
Appends a rectangle to the current path as a complete subpath.
Closes the current subpath.
Closes all subpathes contained in this path.
Adds additional line to each closed subpath and makes the subpath unclosed.
The line connects the last and the first points of the subpaths.
@returns Indices of modified subpaths.
Path is empty if it contains no subpaths.
Contains information relating to construction the current path.
@since 5.5.6
See {@link com.itextpdf.text.pdf.parser.Path#moveTo(float, float)}
See {@link com.itextpdf.text.pdf.parser.Path#lineTo(float, float)}
See {@link com.itextpdf.text.pdf.parser.Path#curveTo(float, float, float, float, float, float)}
See {@link com.itextpdf.text.pdf.parser.Path#curveTo(float, float, float, float)}
See {@link com.itextpdf.text.pdf.parser.Path#curveFromTo(float, float, float, float)}
See {@link com.itextpdf.text.pdf.parser.Path#closeSubpath()}
See {@link com.itextpdf.text.pdf.parser.Path#rectangle(float, float, float, float)}
@param operation Indicates which path-construction operation should be performed.
@param segmentData Contains data of a new segment being added to the current path.
E.g. x, y, w, h for rectangle; x, y for line etc.
@param ctm Current transformation matrix.
See {@link #PathConstructionRenderInfo(int, java.util.List, Matrix)}
@return construction operation should be performed on the current path.
@return {@link java.util.List} containing data of a new segment (E.g. x, y, w, h for rectangle;
x, y for line etc.) if the specified operation relates to adding the segment to the
current path, null
otherwise.
@return Current transformation matrix.
Contains information relating to painting current path.
@since 5.5.6
The nonzero winding number rule determines whether a given point is inside a path by
conceptually drawing a ray from that point to infinity in any direction and then examining
the places where a segment of the path crosses the ray. Starting with a count of 0, the rule
adds 1 each time a path segment crosses the ray from left to right and subtracts 1 each time a
segment crosses from right to left. After counting all the crossings, if the result is 0, the
point is outside the path; otherwise, it is inside.
For more details see PDF spec.
The even-odd rule determines whether a point is inside a path by drawing a ray from that point in
any direction and simply counting the number of path segments that cross the ray, regardless of
direction. If this number is odd, the point is inside; if even, the point is outside.
For more details see PDF spec.
End the path object without filling or stroking it. This operator shall be a path-painting no-op,
used primarily for the side effect of changing the current clipping path
Value specifying stroke operation to perform on the current path.
Value specifying fill operation to perform on the current path. When the fill operation
is performed it should use either nonzero winding or even-odd rule.
@param operation One of the possible combinations of {@link #STROKE} and {@link #FILL} values or {@link #NO_OP}
@param rule Either {@link #NONZERO_WINDING_RULE} or {@link #EVEN_ODD_RULE}.
@param gs The graphics state.
If the operation is {@link #NO_OP} then the rule is ignored,
otherwise {@link #NONZERO_WINDING_RULE} is used by default.
See {@link #PathPaintingRenderInfo(int, int, GraphicsState)}
@return int
value which is either {@link #NO_OP} or one of possible
combinations of {@link #STROKE} and {@link #FILL}
@return Either {@link #NONZERO_WINDING_RULE} or {@link #EVEN_ODD_RULE}.
@return Current transformation matrix.
Tool that parses the content of a PDF document.
@since 2.1.4
Shows the detail of a dictionary.
This is similar to the PdfLister functionality.
@param dic the dictionary of which you want the detail
@return a String representation of the dictionary
Shows the detail of a dictionary.
@param dic the dictionary of which you want the detail
@param depth the depth of the current dictionary (for nested dictionaries)
@return a String representation of the dictionary
Displays a summary of the entries in the XObject dictionary for the stream
@param resourceDic the resource dictionary for the stream
@return a string with the summary of the entries
@throws IOException
@since 5.0.2
Writes information about a specific page from PdfReader to the specified output stream.
@since 2.1.5
@param reader the PdfReader to read the page content from
@param pageNum the page number to read
@param out the output stream to send the content to
@throws IOException
Writes information about each page in a PDF file to the specified output stream.
@since 2.1.5
@param pdfFile a File instance referring to a PDF file
@param out the output stream to send the content to
@throws IOException
Writes information about the specified page in a PDF file to the specified output stream.
@since 2.1.5
@param pdfFile a File instance referring to a PDF file
@param pageNum the page number to read
@param out the output stream to send the content to
@throws IOException
Writes information about each page in a PDF file to the specified file, or System.out.
@param args
Processor for a PDF content Stream.
@since 2.1.4
Default oper
@since 5.0.1
A map with all supported operators (PDF syntax).
Resources for the content stream.
Stack keeping track of the graphics state.
Text matrix.
Text line matrix.
Listener that will be notified of render events
A map with all supported XObject handlers
The font cache.
@since 5.0.6
A stack containing marked content info.
@since 5.0.2
Creates a new PDF Content Stream Processor that will send it's output to the
designated render listener.
@param renderListener the {@link RenderListener} that will receive rendering notifications
Gets the font pointed to by the indirect reference. The font may have been cached.
@param ind the indirect reference ponting to the font
@return the font
@since 5.0.6
Loads all the supported graphics and text state operators in a map.
@return {@link java.util.Collection} containing all the registered operators strings
@since 5.5.6
Resets the graphics state stack, matrices and resources.
Returns the current graphics state.
@return the graphics state
Invokes an oper.
@param oper the PDF Syntax of the oper
@param operands a list with operands
Add to the marked content stack
@param tag the tag of the marked content
@param dict the PdfDictionary associated with the marked content
@since 5.0.2
Remove the latest marked content from the stack. Keeps track of the BMC, BDC and EMC operators.
@since 5.0.2
Used to trigger beginTextBlock on the renderListener
Used to trigger endTextBlock on the renderListener
Displays text.
@param string the text to display
Displays an XObject using the registered handler for this XObject's subtype
@param xobjectName the name of the XObject to retrieve from the resource dictionary
Displays the current path.
@param operation One of the possible combinations of {@link com.itextpdf.text.pdf.parser.PathPaintingRenderInfo#STROKE}
and {@link com.itextpdf.text.pdf.parser.PathPaintingRenderInfo#FILL} values or
{@link com.itextpdf.text.pdf.parser.PathPaintingRenderInfo#NO_OP}
@param rule Either {@link com.itextpdf.text.pdf.parser.PathPaintingRenderInfo#NONZERO_WINDING_RULE} or
{@link com.itextpdf.text.pdf.parser.PathPaintingRenderInfo#EVEN_ODD_RULE}
In case it isn't applicable pass any int
value.
@param close Indicates whether the path should be closed or not.
@since 5.5.6
Modifies the current path.
@param operation Indicates which path-construction operation should be performed.
@param segmentData Contains x, y components of points of a new segment being added to the current path.
E.g. x1 y1 x2 y2 x3 y3 etc. It's ignored for "close subpath" operarion (h).
Adjusts the text matrix for the specified adjustment value (see TJ oper in the PDF spec for information)
@param tj the text adjustment
Processes PDF syntax.
Note: If you re-use a given {@link PdfContentStreamProcessor}, you must call {@link PdfContentStreamProcessor#reset()}
@param contentBytes the bytes of a content stream
@param resources the resources that come with the content stream
Callback when an inline image is found. This requires special handling because inline images don't follow the standard operator syntax
@param info the inline image
@param colorSpaceDic the color space for the inline immage
Property for the RenderListener object maintained in this class.
Necessary for implementing custom ContentOperator implementations.
@return the renderListener
A resource dictionary that allows stack-like behavior to support resource dictionary inheritance
A content oper implementation (unregistered).
A content oper implementation (TJ).
A content oper implementation (").
A content oper implementation (').
A content oper implementation (Tj).
A content oper implementation (T*).
A content oper implementation (Tm).
A content oper implementation (TD).
A content oper implementation (Td).
A content oper implementation (Tf).
A content oper implementation (Tr).
A content oper implementation (Ts).
A content oper implementation (TL).
A content oper implementation (Tz).
A content oper implementation (Tc).
A content oper implementation (Tw).
A content oper implementation (gs).
A content oper implementation (q).
A content oper implementation (cm).
Gets a color based on a list of operands.
Gets a color based on a list of operands.
A content operator implementation (g).
A content operator implementation (G).
A content operator implementation (rg).
A content operator implementation (RG).
A content operator implementation (rg).
A content operator implementation (RG).
A content operator implementation (cs).
A content operator implementation (CS).
A content operator implementation (sc / scn).
A content operator implementation (SC / SCN).
A content oper implementation (Q).
A content oper implementation (BT).
A content oper implementation (ET).
A content oper implementation (BMC).
@since 5.0.2
A content oper implementation (BDC).
@since 5.0.2
A content oper implementation (EMC).
@since 5.0.2
A content oper implementation (Do).
A content operator implementation (w).
A content operator implementation (J).
A content operator implementation (j).
A content operator implementation (M).
A content operator implementation (d).
A content operator implementation (m).
@since 5.5.6
A content operator implementation (l).
@since 5.5.6
A content operator implementation (c).
@since 5.5.6
A content operator implementation (v).
@since 5.5.6
A content operator implementation (y).
@since 5.5.6
A content operator implementation (h).
@since 5.5.6
A content operator implementation (re).
@since 5.5.6
A content operator implementation (S, s, f, F, f*, B, B*, b, b*).
@since 5.5.6
Constructs PainPath object.
@param operation One of the possible combinations of {@link com.itextpdf.text.pdf.parser.PathPaintingRenderInfo#STROKE}
and {@link com.itextpdf.text.pdf.parser.PathPaintingRenderInfo#FILL} values or
{@link com.itextpdf.text.pdf.parser.PathPaintingRenderInfo#NO_OP}
@param rule Either {@link com.itextpdf.text.pdf.parser.PathPaintingRenderInfo#NONZERO_WINDING_RULE} or
{@link com.itextpdf.text.pdf.parser.PathPaintingRenderInfo#EVEN_ODD_RULE}
In case it isn't applicable pass any value.
@param close Indicates whether the path should be closed or not.
A content operator implementation (n).
@since 5.5.6
An XObject subtype handler for FORM
An XObject subtype handler for IMAGE
An XObject subtype handler that does nothing
An object that contains an image dictionary and image bytes.
@since 5.0.2
Different types of data that can be stored in the bytes of a {@link PdfImageObject}
@since 5.0.4
the recommended file extension for streams of this type
@param fileExtension the recommended file extension for use with data of this type (for example, if the bytes were just saved to a file, what extension should the file have)
@return the file extension registered when this type was created
A filter that does nothing, but keeps track of the filter type that was used
@since 5.0.4
The image dictionary.
The decoded image bytes (after applying filters), or the raw image bytes if unable to decode
Tracks the type of data that is actually stored in the streamBytes member
@return the type of image data that is returned by getImageBytes()
Creates a PdfImage object.
@param stream a PRStream
@throws IOException
Creates a PdfImage object.
@param stream a PRStream
@param colorSpaceDic a color space dictionary
@throws IOException
Creats a PdfImage object using an explicitly provided dictionary and image bytes
@param dictionary the dictionary for the image
@param samples the samples
@since 5.0.3
Returns an entry from the image dictionary.
@param key a key
@return the value
Returns the image dictionary.
@return the dictionary
Sets state of this object according to the color space
@param colorspace the colorspace to use
@param allowIndexed whether indexed color spaces will be resolved (used for recursive call)
@throws IOException if there is a problem with reading from the underlying stream
decodes the bytes currently captured in the streamBytes and replaces it with an image representation of the bytes
(this will either be a png or a tiff, depending on the color depth of the image)
@throws IOException
@return the bytes of the image (the format will be as specified in {@link PdfImageObject#getImageBytesType()}
@throws IOException
@since 5.0.4
A utility class that makes it cleaner to process content from pages of a PdfReader
through a specified RenderListener.
@since 5.0.2
the reader this parser will process
Extracts text from a PDF file.
@since 2.1.4
Extract text from a specified page using an extraction strategy.
Also allows registration of custom ContentOperators
@param reader the reader to extract text from
@param pageNumber the page to extract text from
@param strategy the strategy to use for extracting text
@param additionalContentOperators an optional dictionary of custom IContentOperators for rendering instructions
@return the extracted text
@throws IOException if any operation fails while reading from the provided PdfReader
Extract text from a specified page using an extraction strategy.
@param reader the reader to extract text from
@param pageNumber the page to extract text from
@param strategy the strategy to use for extracting text
@return the extracted text
@throws IOException if any operation fails while reading from the provided PdfReader
@since 5.0.2
A {@link RenderFilter} that only allows text within a specified rectangular region
@since 5.0.1
the region to allow text from
Constructs a filter
@param filterRect the rectangle to filter text against. Note that this is a java.awt.Rectangle !
Constructs a filter
@param filterRect the rectangle to filter text against.
@see com.itextpdf.text.pdf.parser.RenderFilter#allowText(com.itextpdf.text.pdf.parser.TextRenderInfo)
Interface for defining filters for use with {@link FilteredRenderListener}
@since 5.0.1
@param renderInfo
@return true if the text render operation should be performed
@param renderInfo
@return true if the image render operation should be performed
Represents segment from a PDF path.
@since 5.5.6
Treat base points as the points which are enough to construct a shape.
E.g. for a bezier curve they are control points, for a line segment - the start and the end points
of the segment.
@return Ordered list consisting of shape's base points.
A simple text extraction renderer.
This renderer keeps track of the current Y position of each string. If it detects
that the y position has changed, it inserts a line break into the output. If the
PDF renders text in a non-top-to-bottom fashion, this will result in the text not
being a true representation of how it appears in the PDF.
This renderer also uses a simple strategy based on the font metrics to determine if
a blank space should be inserted into the output.
@since 2.1.5
used to store the resulting String.
Creates a new text extraction renderer.
@since 5.0.1
@since 5.0.1
Returns the result so far.
@return a String with the resulting text.
Used to actually append text to the text results. Subclasses can use this to insert
text that wouldn't normally be included in text parsing (e.g. result of OCR performed against
image content)
@param text the text to append to the text results accumulated so far
Captures text using a simplified algorithm for inserting hard returns and spaces
@param renderInfo render info
no-op method - this renderer isn't interested in image events
@see com.itextpdf.text.pdf.parser.RenderListener#renderImage(com.itextpdf.text.pdf.parser.ImageRenderInfo)
@since 5.0.1
As subpath is a part of a path comprising a sequence of connected segments.
@since 5.5.6
Copy constuctor.
@param subpath
Constructs a new subpath starting at the given point.
Constructs a new subpath starting at the given point.
Sets the start point of the subpath.
@param startPoint
Sets the start point of the subpath.
@param x
@param y
@return The point this subpath starts at.
@return The last point of the subpath.
Adds a segment to the subpath.
Note: each new segment shall start at the end of the previous segment.
@param segment new segment.
@return {@link java.util.List} comprising all the segments
the subpath made on.
Checks whether subpath is empty or not.
@return true if the subpath is empty, false otherwise.
@return true
if this subpath contains only one point and it is not closed,
false
otherwise
Returns or sets a bool
value indicating whether the subpath must be closed or not.
Ignore this value if the subpath is a rectangle because in this case it is already closed
(of course if you paint the path using re
operator)
@return bool
value indicating whether the path must be closed or not.
@since 5.5.6
Returns a bool
indicating whether the subpath is degenerate or not.
A degenerate subpath is the subpath consisting of a single-point closed path or of
two or more points at the same coordinates.
@return bool
value indicating whether the path is degenerate or not.
@since 5.5.6
@return {@link java.util.List} containing points of piecewise linear approximation
for this subpath.
@since 5.5.6
Converts a tagged PDF document into an XML file.
@since 5.0.2
The reader obj from which the content streams are read.
The writer obj to which the XML will be written
Parses a string with structured content.
@param reader
the PdfReader that has access to the PDF file
@param os
the Stream to which the resulting xml will be written
@param charset
the charset to encode the data
@since 5.0.5
Parses a string with structured content.
@param reader
the PdfReader that has access to the PDF file
@param os
the Stream to which the resulting xml will be written
Inspects a child of a structured element. This can be an array or a
dictionary.
@param k
the child to inspect
@throws IOException
If the child of a structured element is an array, we need to loop over
the elements.
@param k
the child array to inspect
If the child of a structured element is a dictionary, we inspect the
child; we may also draw a tag.
@param k
the child dictionary to inspect
If the child of a structured element is a dictionary, we inspect the
child; we may also draw a tag.
@param k
the child dictionary to inspect
Searches for a tag in a page.
@param tag
the name of the tag
@param obj
an identifier to find the marked content
@param page
a page dictionary
@throws IOException
Allows you to find the rectangle that contains all the text in a page.
@since 5.0.2
Method invokes by the PdfContentStreamProcessor.
Passes a TextRenderInfo for every text chunk that is encountered.
We'll use this object to obtain coordinates.
@see com.itextpdf.text.pdf.parser.RenderListener#renderText(com.itextpdf.text.pdf.parser.TextRenderInfo)
Getter for the left margin.
@return the X position of the left margin
Getter for the bottom margin.
@return the Y position of the bottom margin
Getter for the right margin.
@return the X position of the right margin
Getter for the top margin.
@return the Y position of the top margin
Gets the width of the text block.
@return a width
Gets the height of the text block.
@return a height
@see com.itextpdf.text.pdf.parser.RenderListener#beginTextBlock()
@see com.itextpdf.text.pdf.parser.RenderListener#endTextBlock()
@see com.itextpdf.text.pdf.parser.RenderListener#renderImage(com.itextpdf.text.pdf.parser.ImageRenderInfo)
! .NET SPECIFIC !
is used for caching "UTF-16BE" encoding to improve performance
Array containing marked content info for the text.
@since 5.0.2
Creates a new TextRenderInfo object
@param string the PDF string that should be displayed
@param gs the graphics state (note: at this time, this is not immutable, so don't cache it)
@param textMatrix the text matrix at the time of the render operation
@param markedContentInfo the marked content sequence, if available
Used for creating sub-TextRenderInfos for each individual character
@param parent the parent TextRenderInfo
@param string the content of a TextRenderInfo
@param horizontalOffset the unscaled horizontal offset of the character that this TextRenderInfo represents
@since 5.3.3
@return the text to render
@return original PDF string
Checks if the text belongs to a marked content sequence
with a given mcid.
@param mcid a marked content id
@return true if the text is marked with this id
@since 5.0.2
* Checks if the text belongs to a marked content sequence
* with a given mcid.
* @param mcid a marked content id
* @param checkTheTopmostLevelOnly indicates whether to check the topmost level of marked content stack only
* @return true if the text is marked with this id
* @since 5.3.5
@return the marked content associated with the TextRenderInfo instance.
@return the unscaled (i.e. in Text space) width of the text
Gets the baseline for the text (i.e. the line that the text 'sits' on)
This value includes the Rise of the draw operation - see {@link #getRise()} for the amount added by Rise
@return the baseline line segment
@since 5.0.2
Gets the ascentline for the text (i.e. the line that represents the topmost extent that a string of the current font could have)
This value includes the Rise of the draw operation - see {@link #getRise()} for the amount added by Rise
@return the ascentline line segment
@since 5.0.2
Gets the descentline for the text (i.e. the line that represents the bottom most extent that a string of the current font could have)
This value includes the Rise of the draw operation - see {@link #getRise()} for the amount added by Rise
@return the descentline line segment
@since 5.0.2
Getter for the font
@return the font
@since iText 5.0.2
The rise represents how far above the nominal baseline the text should be rendered. The {@link #getBaseline()}, {@link #getAscentLine()} and {@link #getDescentLine()} methods already include Rise.
This method is exposed to allow listeners to determine if an explicit rise was involved in the computation of the baseline (this might be useful, for example, for identifying superscript rendering)
@return The Rise for the text draw operation, in user space units (Ts value, scaled to user space)
@since 5.3.3
@param width the width, in text space
@return the width in user space
@since 5.3.3
@param height the height, in text space
@return the height in user space
@since 5.3.3
@return The width, in user space units, of a single space character in the current font
@return the text render mode that should be used for the text. From the
PDF specification, this means:
- 0 = Fill text
- 1 = Stroke text
- 2 = Fill, then stroke text
- 3 = Invisible
- 4 = Fill text and add to path for clipping
- 5 = Stroke text and add to path for clipping
- 6 = Fill, then stroke text and add to path for clipping
- 7 = Add text to padd for clipping
@since iText 5.0.1
@return the current fill color.
@return the current stroke color.
Calculates the width of a space character. If the font does not define
a width for a standard space character \u0020, we also attempt to use
the width of \u00A0 (a non-breaking space in many fonts)
@return the width of a single space character in text space units
Gets the width of a String in text space units
@param string the string that needs measuring
@return the width of a String in text space units
Gets the width of a PDF string in text space units
@param string the string that needs measuring
@return the width of a String in text space units
Provides detail useful if a listener needs access to the position of each individual glyph in the text render operation
@return A list of {@link TextRenderInfo} objects that represent each glyph used in the draw operation. The next effect is if there was a separate Tj opertion for each character in the rendered string
@since 5.3.3
Calculates width and word spacing of a single character PDF string.
@param string a character to calculate width.
@param singleCharString true if PDF string represents single character, false otherwise.
@return array of 2 items: first item is a character width, second item is a calculated word spacing.
Decodes a PdfString (which will contain glyph ids encoded in the font's encoding)
based on the active font, and determine the unicode equivalent
@param in the String that needs to be encoded
@return the encoded String
! .NET SPECIFIC; this method is used to avoid unecessary using of StringBuilder because it is slow in .NET !
Decodes a single character PdfString (which will contain glyph ids encoded in the font's encoding)
based on the active font, and determine the unicode equivalent
@param in the String that needs to be encoded
@return the encoded String
Converts a single character string to char code.
@param string single character string to convert to.
@return char code.
Split PDF string into array of single character PDF strings.
@param string PDF string to be splitted.
@return splitted PDF string.
index of the X coordinate
index of the Y coordinate
index of the Z coordinate
the values inside the vector
Creates a new Vector
@param x the X coordinate
@param y the Y coordinate
@param z the Z coordinate
Gets the value from a coordinate of the vector
@param index the index of the value to get (I1, I2 or I3)
@return a coordinate value
Computes the cross product of this vector and the specified matrix
@param by the matrix to cross this vector with
@return the result of the cross product
Computes the difference between this vector and the specified vector
@param v the vector to subtract from this one
@return the results of the subtraction
Computes the cross product of this vector and the specified vector
@param with the vector to cross this vector with
@return the cross product
Normalizes the vector (i.e. returns the unit vector in the same orientation as this vector)
@return the unit vector
@since 5.0.1
Multiplies the vector by a scalar
@param by the scalar to multiply by
@return the result of the scalar multiplication
@since 5.0.1
Computes the dot product of this vector with the specified vector
@param with the vector to dot product this vector with
@return the dot product
@see java.lang.Object#toString()
@since 5.0.1
@see java.lang.Object#equals(java.lang.Object)
@author Kevin Day
@since iText 5.0.1
Represents an inline image from a PDF
@since 5.1.4
@return the image dictionary associated with this inline image
@return the raw samples associated with this inline image
Utility methods to help with processing of inline images
@since 5.0.4
Simple class in case users need to differentiate an exception from processing
inline images vs other exceptions
@since 5.0.4
Map between key abbreviations allowed in dictionary of inline images and their
equivalent image dictionary keys
Map between value abbreviations allowed in dictionary of inline images for COLORSPACE
Map between value abbreviations allowed in dictionary of inline images for FILTER
Parses an inline image from the provided content parser. The parser must be positioned immediately following the BI operator in the content stream.
The parser will be left with current position immediately following the EI operator that terminates the inline image
@param ps the content parser to use for reading the image.
@return the parsed image
@throws IOException if anything goes wring with the parsing
@throws InlineImageParseException if parsing of the inline image failed due to issues specific to inline image processing
Parses the next inline image dictionary from the parser. The parser must be positioned immediately following the EI operator.
The parser will be left with position immediately following the whitespace character that follows the ID operator that ends the inline image dictionary.
@param ps the parser to extract the embedded image information from
@return the dictionary for the inline image, with any abbreviations converted to regular image dictionary keys and values
@throws IOException if the parse fails
Transforms value abbreviations into their corresponding real value
@param key the key that the value is for
@param value the value that might be an abbreviation
@return if value is an allowed abbreviation for the key, the expanded value for that abbreviation. Otherwise, value is returned without modification
@param colorSpaceName the name of the color space. If null, a bi-tonal (black and white) color space is assumed.
@return the components per pixel for the specified color space
Computes the number of unfiltered bytes that each row of the image will contain.
If the number of bytes results in a partial terminating byte, this number is rounded up
per the PDF specification
@param imageDictionary the dictionary of the inline image
@return the number of bytes per row of the image
Parses the samples of the image from the underlying content parser, ignoring all filters.
The parser must be positioned immediately after the ID operator that ends the inline image's dictionary.
The parser will be left positioned immediately following the EI operator.
This is primarily useful if no filters have been applied.
@param imageDictionary the dictionary of the inline image
@param ps the content parser
@return the samples of the image
@throws IOException if anything bad happens during parsing
Parses the samples of the image from the underlying content parser, accounting for filters
The parser must be positioned immediately after the ID operator that ends the inline image's dictionary.
The parser will be left positioned immediately following the EI operator.
Note:This implementation does not actually apply the filters at this time
@param imageDictionary the dictionary of the inline image
@param ps the content parser
@return the samples of the image
@throws IOException if anything bad happens during parsing
Represents a pattern. Can be used in high-level constructs (Paragraph, Cell, etc.).
The actual pattern.
Creates a color representing a pattern.
@param painter the actual pattern
Gets the pattern.
@return the pattern
Each PDF document can contain maximum 1 AcroForm.
This is a map containing FieldTemplates.
This is an array containing DocumentFields.
This is an array containing the calculationorder of the fields.
Contains the signature flags.
Creates new PdfAcroForm
Adds fieldTemplates.
Adds documentFields.
Closes the AcroForm.
Adds an object to the calculationOrder.
Sets the signature flags.
Adds a formfield to the AcroForm.
@param field
@param name
@param llx
@param lly
@param urx
@param ury
@param field
@param llx
@param lly
@param urx
@param ury
A PdfAction
defines an action that can be triggered from a PDF file.
@see PdfDictionary
A named action to go to the first page.
A named action to go to the previous page.
A named action to go to the next page.
A named action to go to the last page.
A named action to open a print dialog.
a possible submitvalue
a possible submitvalue
a possible submitvalue
a possible submitvalue
a possible submitvalue
a possible submitvalue
a possible submitvalue
a possible submitvalue
a possible submitvalue
Create an empty action.
Constructs a new PdfAction
of Subtype URI.
@param url the Url to go to
Constructs a new PdfAction
of Subtype URI.
@param url the url to go to
Constructs a new PdfAction
of Subtype GoTo.
@param destination the destination to go to
Constructs a new PdfAction
of Subtype GoToR.
@param filename the file name to go to
@param name the named destination to go to
Constructs a new PdfAction
of Subtype GoToR.
@param filename the file name to go to
@param page the page destination to go to
Implements name actions. The action can be FIRSTPAGE, LASTPAGE,
NEXTPAGE and PREVPAGE.
@param named the named action
Launchs an application or a document.
@param application the application to be launched or the document to be opened or printed.
@param parameters (Windows-specific) A parameter string to be passed to the application.
It can be null
.
@param operation (Windows-specific) the operation to perform: "open" - Open a document,
"print" - Print a document.
It can be null
.
@param defaultDir (Windows-specific) the default directory in standard DOS syntax.
It can be null
.
Launchs an application or a document.
@param application the application to be launched or the document to be opened or printed.
@param parameters (Windows-specific) A parameter string to be passed to the application.
It can be null
.
@param operation (Windows-specific) the operation to perform: "open" - Open a document,
"print" - Print a document.
It can be null
.
@param defaultDir (Windows-specific) the default directory in standard DOS syntax.
It can be null
.
@return a Launch action
Creates a Rendition action
@param file
@param fs
@param mimeType
@param ref
@return a Media Clip action
@throws IOException
Creates a JavaScript action. If the JavaScript is smaller than
50 characters it will be placed as a string, otherwise it will
be placed as a compressed stream.
@param code the JavaScript code
@param writer the writer for this action
@param unicode select JavaScript unicode. Note that the internal
Acrobat JavaScript engine does not support unicode,
so this may or may not work for you
@return the JavaScript action
Creates a JavaScript action. If the JavaScript is smaller than
50 characters it will be place as a string, otherwise it will
be placed as a compressed stream.
@param code the JavaScript code
@param writer the writer for this action
@return the JavaScript action
Add a chained action.
@param na the next action
Creates a GoTo action to an internal page.
@param page the page to go. First page is 1
@param dest the destination for the page
@param writer the writer for this action
@return a GoTo action
Creates a GoTo action to a named destination.
@param dest the named destination
@param isName if true sets the destination as a name, if false sets it as a String
@return a GoToR action
Creates a GoToR action to a named destination.
@param filename the file name to go to
@param dest the destination name
@param isName if true sets the destination as a name, if false sets it as a String
@param newWindow open the document in a new window if true
, if false the current document is replaced by the new document.
@return a GoToR action
Creates a GoToE action to an embedded file.
@param filename the root document of the target (null if the target is in the same document)
@param dest the named destination
@param isName if true sets the destination as a name, if false sets it as a String
@return a GoToE action
Creates a GoToE action to an embedded file.
@param filename the root document of the target (null if the target is in the same document)
@param target a path to the target document of this action
@param dest the destination inside the target document, can be of type PdfDestination, PdfName, or PdfString
@param newWindow if true, the destination document should be opened in a new window
@return a GoToE action
A PdfAnnotation
is a note that is associated with a page.
@see PdfDictionary
flagvalue PDF 1.7
attributevalue
Holds value of property used.
Holds value of property placeInPage.
Constructs a new PdfAnnotation
of subtype text.
Constructs a new PdfAnnotation
of subtype link (Action).
Creates a screen PdfAnnotation
@param writer
@param rect
@param clipTitle
@param fs
@param mimeType
@param playOnDisplay
@return a screen PdfAnnotation
@throws IOException
Creates a file attachment annotation.
@param writer the PdfWriter
@param rect the dimensions in the page of the annotation
@param contents the file description
@param fileStore an array with the file. If it's null
the file will be read from the disk
@param file the path to the file. It will only be used if
fileStore
is not null
@param fileDisplay the actual file name stored in the pdf
@throws IOException on error
@return the annotation
Creates a file attachment annotation
@param writer
@param rect
@param contents
@param fs
@return the annotation
@throws IOException
Creates a polygon or -line annotation
@param writer the PdfWriter
@param rect the annotation position
@param contents the textual content of the annotation
@param polygon if true, the we're creating a polygon annotation, if false, a polyline
@param vertices an array with the vertices of the polygon or -line
@since 5.0.2
Sets the annotation's highlighting mode. The values can be
HIGHLIGHT_NONE
, HIGHLIGHT_INVERT
,
HIGHLIGHT_OUTLINE
and HIGHLIGHT_PUSH
;
@param highlight the annotation's highlighting mode
Getter for property form.
@return Value of property form.
Getter for property annotation.
@return Value of property annotation.
Getter for property placeInPage.
@return Value of property placeInPage.
Sets the layer this annotation belongs to.
@param layer the layer this annotation belongs to
Sets the name of the annotation.
With this name the annotation can be identified among
all the annotations on a page (it has to be unique).
This class processes links from imported pages so that they may be active. The following example code reads a group
of files and places them all on the output PDF, four pages in a single page, keeping the links active.
String[] files = new String[] {"input1.pdf", "input2.pdf"};
String outputFile = "output.pdf";
int firstPage=1;
Document document = new Document();
PdfWriter writer = PdfWriter.GetInstance(document, new FileOutputStream(outputFile));
document.SetPageSize(PageSize.A4);
float W = PageSize.A4.GetWidth() / 2;
float H = PageSize.A4.GetHeight() / 2;
document.Open();
PdfContentByte cb = writer.GetDirectContent();
for (int i = 0; i < files.length; i++) {
PdfReader currentReader = new PdfReader(files[i]);
currentReader.ConsolidateNamedDestinations();
for (int page = 1; page <= currentReader.GetNumberOfPages(); page++) {
PdfImportedPage importedPage = writer.GetImportedPage(currentReader, page);
float a = 0.5f;
float e = (page % 2 == 0) ? W : 0;
float f = (page % 4 == 1 || page % 4 == 2) ? H : 0;
ArrayList links = currentReader.GetLinks(page);
cb.AddTemplate(importedPage, a, 0, 0, a, e, f);
for (int j = 0; j < links.Size(); j++) {
PdfAnnotation.PdfImportedLink link = (PdfAnnotation.PdfImportedLink)links.Get(j);
if (link.IsInternal()) {
int dPage = link.GetDestinationPage();
int newDestPage = (dPage-1)/4 + firstPage;
float ee = (dPage % 2 == 0) ? W : 0;
float ff = (dPage % 4 == 1 || dPage % 4 == 2) ? H : 0;
link.SetDestinationPage(newDestPage);
link.TransformDestination(a, 0, 0, a, ee, ff);
}
link.TransformRect(a, 0, 0, a, e, f);
writer.AddAnnotation(link.CreateAnnotation(writer));
}
if (page % 4 == 0)
document.NewPage();
}
if (i < files.length - 1)
document.NewPage();
firstPage += (currentReader.GetNumberOfPages()+3)/4;
}
document.Close();
Returns a String representation of the link.
@return a String representation of the imported link
@since 2.1.6
Implements the appearance stream to be used with form fields..
Creates a PdfAppearance
.
Creates new PdfTemplate
@param wr the PdfWriter
Creates a new appearance to be used with form fields.
@param width the bounding box width
@param height the bounding box height
@return the appearance created
Set the font and the size for the subsequent text writing.
@param bf the font
@param size the font size in points
this is the actual array of PdfObjects
Constructs an empty PdfArray
-object.
Constructs an PdfArray
-object, containing 1 PdfObject
.
@param object a PdfObject
that has to be added to the array
Constructs a PdfArray with the elements of an ArrayList.
Throws a ClassCastException if the ArrayList contains something
that isn't a PdfObject.
@param l an ArrayList with PdfObjects
@since 2.1.3
Constructs an PdfArray
-object, containing all the PdfObject
s in a given PdfArray
.
@param array a PdfArray
that has to be added to the array
Returns the PDF representation of this PdfArray
.
@return an array of byte
s
Overwrites a specified location of the array.
@param idx The index of the element to be overwritten
@param obj new value for the specified index
@throws IndexOutOfBoundsException if the specified position doesn't exist
@return the previous value
@since 2.1.5
Returns the PdfObject
with the specified index.
A possible indirect references is not resolved, so the returned
PdfObject
may be either a direct object or an indirect
reference, depending on how the object is stored in the
PdfArray
.
@param idx The index of the PdfObject
to be returned
@return A PdfObject
Overwrites a specified location of the array, returning the previous
value
@param idx The index of the element to be overwritten
@param obj new value for the specified index
@throws IndexOutOfBoundsException if the specified position doesn't exist
@return the previous value
@since 2.1.5
Remove the element at the specified position from the array.
Shifts any subsequent elements to the left (subtracts one from their
indices).
@param idx The index of the element to be removed.
@throws IndexOutOfBoundsException the specified position doesn't exist
@since 2.1.5
Returns an ArrayList containing PdfObject
s.
@return an ArrayList
Returns the number of entries in the array.
@return the size of the ArrayList
Returns true
if the array is empty.
@return true
if the array is empty
@since 2.1.5
Adds a PdfObject
to the PdfArray
.
@param object PdfObject
to add
@return true
Inserts the specified element at the specified position.
Shifts the element currently at that position (if any) and
any subsequent elements to the right (adds one to their indices).
@param index The index at which the specified element is to be inserted
@param element The element to be inserted
@throws IndexOutOfBoundsException if the specified index is larger than the
last position currently set, plus 1.
@since 2.1.5
Inserts a PdfObject
at the beginning of the
PdfArray
.
The PdfObject
will be the first element, any other elements
will be shifted to the right (adds one to their indices).
@param object The PdfObject
to add
Checks if the PdfArray
already contains a certain PdfObject
.
@param object PdfObject
to check
@return true
@return this PdfArray's values as a long[]
@since 5.3.5
@return this PdfArray's values as a double[]
@since 5.5.6
A possible value of PdfBoolean
A possible value of PdfBoolean
the bool value of this object
Constructs a PdfBoolean
-object.
@param value the value of the new PdfObject
Constructs a PdfBoolean
-object.
@param value the value of the new PdfObject
, represented as a string
@throws BadPdfFormatException thrown if the value isn't 'true
' or 'false
'
Returns the primitive value of the PdfBoolean
-object.
@return the actual value of the object.
A PdfBorderArray
defines the border of a PdfAnnotation
.
@see PdfArray
Constructs a new PdfBorderArray
.
Constructs a new PdfBorderArray
.
A PdfBorderDictionary
define the appearance of a Border (Annotations).
@see PdfDictionary
Constructs a PdfBorderDictionary
.
The allowed attributes in variable attributes
.
The allowed attributes in variable noStroke
.
The value of this object.
The encoding.
The font for this PdfChunk
.
true
if the chunk split was cause by a newline.
The image in this PdfChunk
, if it has one
The offset in the x direction for the image
The offset in the y direction for the image
Indicates if the height and offset of the Image has to be taken into account
The leading that can overrule the existing leading.
Constructs a PdfChunk
-object.
@param string the content of the PdfChunk
-object
@param font the PdfFont
@param attributes the metrics attributes
@param noStroke the non metric attributes
Constructs a PdfChunk
-object.
@param chunk the original Chunk
-object
@param action the PdfAction
if the Chunk
comes from an Anchor
Constructs a PdfChunk
-object.
@param chunk the original Chunk
-object
@param action the PdfAction
if the Chunk
comes from an Anchor
@param tabSettings the Phrase tab settings
Returns the font of this Chunk
.
@return a PdfFont
Returns the color of this Chunk
.
@return a BaseColor
Returns the width of this PdfChunk
.
@return a width
Checks if the PdfChunk
split was caused by a newline.
@return true
if the PdfChunk
split was caused by a newline.
Gets the width of the PdfChunk
taking into account the
extra character and word spacing.
@param charSpacing the extra character spacing
@param wordSpacing the extra word spacing
@return the calculated width
Gets the text displacement relatiev to the baseline.
@return a displacement in points
Trims the last space.
@return the width of the space trimmed, otherwise 0
Gets an attribute. The search is made in attributes
and noStroke
.
@param name the attribute key
@return the attribute value or null if not found
Checks if the attribute exists.
@param name the attribute key
@return true
if the attribute exists
Checks if this PdfChunk
needs some special metrics handling.
@return true
if this PdfChunk
needs some special metrics handling.
Checks if this PdfChunk
is a Separator Chunk.
@return true if this chunk is a separator.
@since 2.1.2
Checks if this PdfChunk
is a horizontal Separator Chunk.
@return true if this chunk is a horizontal separator.
@since 2.1.2
Checks if this PdfChunk
is a tab Chunk.
@return true if this chunk is a separator.
@since 2.1.2
Correction for the tab position based on the left starting position.
@param newValue the new value for the left X.
@since 2.1.2
Checks if there is an image in the PdfChunk
.
@return true
if an image is present
Gets the image in the PdfChunk
.
@return the image or null
Returns a scalePercentage in case the image needs to be scaled.
Sets a scale percentage in case the image needs to be scaled.
Gets the image offset in the x direction
@return the image offset in the x direction
Gets the image offset in the y direction
@return Gets the image offset in the y direction
sets the value.
Tells you if this string is in Chinese, Japanese, Korean or Identity-H.
Gets the encoding of this string.
@return a string
A PdfColor
defines a Color (it's a PdfArray
containing 3 values).
@see PdfDictionary
Constructs a new PdfColor
.
@param red a value between 0 and 255
@param green a value between 0 and 255
@param blue a value between 0 and 255
PdfContentByte
is an object containing the user positioned
text and graphic contents of a page. It knows how to apply the proper
font encoding.
This class keeps the graphic state of the current page
This is the font in use
This is the color in use
This is the font size in use
The x position of the text line matrix.
The y position of the text line matrix.
The current text leading.
The current horizontal scaling
The current character spacing
The current word spacing
The alignement is center
The alignement is left
The alignement is right
A possible line cap value
A possible line cap value
A possible line cap value
A possible line join value
A possible line join value
A possible line join value
A possible text rendering value
A possible text rendering value
A possible text rendering value
A possible text rendering value
A possible text rendering value
A possible text rendering value
A possible text rendering value
A possible text rendering value
This is the actual content
This is the writer
This is the PdfDocument
This is the GraphicState in use
The list were we save/restore the layer depth
The list were we save/restore the state
The separator between commands.
Constructs a new PdfContentByte
-object.
@param wr the writer associated to this content
Returns the string
representation of this PdfContentByte
-object.
@return a string
[SUP-1395] If set, prevents iText from marking content and creating structure tags for items added to this content stream.
(By default, iText automatically marks content using BDC/EMC operators, and adds a structure tag for the new content
at the end of the page.)
Checks if the content needs to be tagged.
@return false if no tags need to be added
Gets the internal buffer.
@return the internal buffer
Returns the PDF representation of this PdfContentByte
-object.
@param writer the PdfWriter
@return a byte
array with the representation
Adds the content of another PdfContent
-object to this object.
@param other another PdfByteContent
-object
Gets the x position of the text line matrix.
@return the x position of the text line matrix
Gets the y position of the text line matrix.
@return the y position of the text line matrix
Gets the current character spacing.
@return the current character spacing
Gets the current word spacing.
@return the current word spacing
Gets the current character spacing.
@return the current character spacing
Gets the current text leading.
@return the current text leading
Set the rendering intent, possible values are: PdfName.ABSOLUTECOLORIMETRIC,
PdfName.RELATIVECOLORIMETRIC, PdfName.SATURATION, PdfName.PERCEPTUAL.
@param ri
Modify the current clipping path by intersecting it with the current path, using the
nonzero winding number rule to determine which regions lie inside the clipping
path.
Modify the current clipping path by intersecting it with the current path, using the
even-odd rule to determine which regions lie inside the clipping path.
Changes the currentgray tint for filling paths (device dependent colors!).
Sets the color space to DeviceGray (or the DefaultGray color space),
and sets the gray tint to use for filling paths.
@param gray a value between 0 (black) and 1 (white)
Changes the current gray tint for filling paths to black.
Changes the currentgray tint for stroking paths (device dependent colors!).
Sets the color space to DeviceGray (or the DefaultGray color space),
and sets the gray tint to use for stroking paths.
@param gray a value between 0 (black) and 1 (white)
Changes the current gray tint for stroking paths to black.
Helper to validate and write the RGB color components
@param red the intensity of red. A value between 0 and 1
@param green the intensity of green. A value between 0 and 1
@param blue the intensity of blue. A value between 0 and 1
Changes the current color for filling paths (device dependent colors!).
Sets the color space to DeviceRGB (or the DefaultRGB color space),
and sets the color to use for filling paths.
Following the PDF manual, each operand must be a number between 0 (minimum intensity) and
1 (maximum intensity).
@param red the intensity of red. A value between 0 and 1
@param green the intensity of green. A value between 0 and 1
@param blue the intensity of blue. A value between 0 and 1
Changes the current color for filling paths to black.
Changes the current color for stroking paths to black.
Helper to validate and write the CMYK color components.
@param cyan the intensity of cyan. A value between 0 and 1
@param magenta the intensity of magenta. A value between 0 and 1
@param yellow the intensity of yellow. A value between 0 and 1
@param black the intensity of black. A value between 0 and 1
Changes the current color for filling paths (device dependent colors!).
Sets the color space to DeviceCMYK (or the DefaultCMYK color space),
and sets the color to use for filling paths.
Following the PDF manual, each operand must be a number between 0 (no ink) and
1 (maximum ink).
@param cyan the intensity of cyan. A value between 0 and 1
@param magenta the intensity of magenta. A value between 0 and 1
@param yellow the intensity of yellow. A value between 0 and 1
@param black the intensity of black. A value between 0 and 1
Changes the current color for filling paths to black.
Changes the current color for stroking paths to black.
Move the current point (x, y), omitting any connecting line segment.
@param x new x-coordinate
@param y new y-coordinate
Move the current point (x, y), omitting any connecting line segment.
@param x new x-coordinate
@param y new y-coordinate
Appends a straight line segment from the current point (x, y). The new current
point is (x, y).
@param x new x-coordinate
@param y new y-coordinate
Appends a straight line segment from the current point (x, y). The new current
point is (x, y).
@param x new x-coordinate
@param y new y-coordinate
Appends a Bezier curve to the path, starting from the current point.
@param x1 x-coordinate of the first control point
@param y1 y-coordinate of the first control point
@param x2 x-coordinate of the second control point
@param y2 y-coordinate of the second control point
@param x3 x-coordinaat of the ending point (= new current point)
@param y3 y-coordinaat of the ending point (= new current point)
Appends a Bezier curve to the path, starting from the current point.
@param x1 x-coordinate of the first control point
@param y1 y-coordinate of the first control point
@param x2 x-coordinate of the second control point
@param y2 y-coordinate of the second control point
@param x3 x-coordinaat of the ending point (= new current point)
@param y3 y-coordinaat of the ending point (= new current point)
Appends a Bezier curve to the path, starting from the current point.
@param x2 x-coordinate of the second control point
@param y2 y-coordinate of the second control point
@param x3 x-coordinaat of the ending point (= new current point)
@param y3 y-coordinaat of the ending point (= new current point)
Appends a Bezier curve to the path, starting from the current point.
@param x2 x-coordinate of the second control point
@param y2 y-coordinate of the second control point
@param x3 x-coordinaat of the ending point (= new current point)
@param y3 y-coordinaat of the ending point (= new current point)
Appends a Bezier curve to the path, starting from the current point.
@param x1 x-coordinate of the first control point
@param y1 y-coordinate of the first control point
@param x3 x-coordinaat of the ending point (= new current point)
@param y3 y-coordinaat of the ending point (= new current point)
Appends a Bezier curve to the path, starting from the current point.
@param x1 x-coordinate of the first control point
@param y1 y-coordinate of the first control point
@param x3 x-coordinaat of the ending point (= new current point)
@param y3 y-coordinaat of the ending point (= new current point)
Draws a circle. The endpoint will (x+r, y).
@param x x center of circle
@param y y center of circle
@param r radius of circle
Draws a circle. The endpoint will (x+r, y).
@param x x center of circle
@param y y center of circle
@param r radius of circle
Adds a rectangle to the current path.
@param x x-coordinate of the starting point
@param y y-coordinate of the starting point
@param w width
@param h height
Adds a rectangle to the current path.
@param x x-coordinate of the starting point
@param y y-coordinate of the starting point
@param w width
@param h height
Adds a variable width border to the current path.
Only use if {@link com.lowagie.text.Rectangle#isUseVariableBorders() Rectangle.isUseVariableBorders}
= true.
@param rect a Rectangle
Adds a border (complete or partially) to the current path..
@param rectangle a Rectangle
Closes the current subpath by appending a straight line segment from the current point
to the starting point of the subpath.
Ends the path without filling or stroking it.
Strokes the path.
Closes the path and strokes it.
Fills the path, using the non-zero winding number rule to determine the region to fill.
Fills the path, using the even-odd rule to determine the region to fill.
Fills the path using the non-zero winding number rule to determine the region to fill and strokes it.
Closes the path, fills it using the non-zero winding number rule to determine the region to fill and strokes it.
Fills the path, using the even-odd rule to determine the region to fill and strokes it.
Closes the path, fills it using the even-odd rule to determine the region to fill and strokes it.
Adds an Image
to the page. The Image
must have
absolute positioning.
@param image the Image
object
@throws DocumentException if the Image
does not have absolute positioning
Adds an Image
to the page. The Image
must have
absolute positioning. The image can be placed inline.
@param image the Image
object
@param inlineImage true
to place this image inline, false
otherwise
@throws DocumentException if the Image
does not have absolute positioning
Adds an Image
to the page. The positioning of the Image
is done with the transformation matrix. To position an image
at (x,y)
use AddImage(image, image_width, 0, 0, image_height, x, y).
@param image the Image
object
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
@throws DocumentException on error
Adds an Image
to the page. The positioning of the Image
is done with the transformation matrix. To position an image
at (x,y)
use AddImage(image, image_width, 0, 0, image_height, x, y).
@param image the Image
object
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
@throws DocumentException on error
adds an image with the given matrix.
@param image image to add
@param transform transform to apply to the template prior to adding it.
adds an image with the given matrix.
@param image image to add
@param transform transform to apply to the template prior to adding it.
@since 5.0.1
Adds an Image
to the page. The positioning of the Image
is done with the transformation matrix. To position an image
at (x,y)
use AddImage(image, image_width, 0, 0, image_height, x, y). The image can be placed inline.
@param image the Image
object
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
@param inlineImage true
to place this image inline, false
otherwise
@throws DocumentException on error
Adds an Image
to the page. The positioning of the Image
is done with the transformation matrix. To position an image
at (x,y)
use AddImage(image, image_width, 0, 0, image_height, x, y). The image can be placed inline.
@param image the Image
object
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
@param inlineImage true
to place this image inline, false
otherwise
@throws DocumentException on error
Adds an Image
to the page. The positioning of the Image
is done with the transformation matrix. To position an image
at (x,y)
The image can be placed inline.
@param image the Image
object
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
@param inlineImage true
to place this image inline, false
otherwise
@param isMCBlockOpened true
not to open MCBlock, false
otherwise
@throws DocumentException on error
Makes this PdfContentByte
empty.
Calls reset( true )
Makes this PdfContentByte
empty.
@param validateContent will call sanityCheck()
if true.
@since 2.1.6
Starts the writing of text.
@param restoreTM indicates if to restore text matrix of the previous text block.
Starts the writing of text.
Ends the writing of text and makes the current font invalid.
Saves the graphic state. saveState
and
restoreState
must be balanced.
Restores the graphic state. saveState
and
restoreState
must be balanced.
Sets the character spacing parameter.
@param charSpace a parameter
Sets the word spacing parameter.
@param wordSpace a parameter
Sets the horizontal scaling parameter.
@param scale a parameter
Set the font and the size for the subsequent text writing.
@param bf the font
@param size the font size in points
Sets the text rendering parameter.
@param rendering a parameter
Sets the text rise parameter.
This allows to write text in subscript or basescript mode.
@param rise a parameter
Sets the text rise parameter.
This allows to write text in subscript or basescript mode.
@param rise a parameter
A helper to insert into the content stream the text
converted to bytes according to the font's encoding.
@param text the text to write
Shows the text
.
@param text the text to write
Constructs a kern array for a text in a certain font
@param text the text
@param font the font
@return a PdfTextArray
Shows the text
kerned.
@param text the text to write
Moves to the next line and shows text
.
@param text the text to write
Moves to the next line and shows text string, using the given values of the character and word spacing parameters.
@param wordSpacing a parameter
@param charSpacing a parameter
@param text the text to write
Changes the text matrix.
Remark: this operation also initializes the current point position.
@param a operand 1,1 in the matrix
@param b operand 1,2 in the matrix
@param c operand 2,1 in the matrix
@param d operand 2,2 in the matrix
@param x operand 3,1 in the matrix
@param y operand 3,2 in the matrix
Changes the text matrix. The first four parameters are {1,0,0,1}.
Remark: this operation also initializes the current point position.
@param x operand 3,1 in the matrix
@param y operand 3,2 in the matrix
Moves to the start of the next line, offset from the start of the current line.
@param x x-coordinate of the new current point
@param y y-coordinate of the new current point
Moves to the start of the next line, offset from the start of the current line.
As a side effect, this sets the leading parameter in the text state.
@param x offset of the new current point
@param y y-coordinate of the new current point
Moves to the start of the next line.
Gets the size of this content.
@return the size of the content
Adds a named outline to the document.
@param outline the outline
@param name the name for the local destination
Gets the root outline.
@return the root outline
Computes the width of the given string taking in account
the current values of "Character spacing", "Word Spacing"
and "Horizontal Scaling".
The additional spacing is not computed for the last character
of the string.
@param text the string to get width of
@param kerned the kerning option
@return the width
Computes the width of the given string taking in account
the current values of "Character spacing", "Word Spacing"
and "Horizontal Scaling".
The spacing for the last character is also computed.
It also takes into account kerning that can be specified within TJ operator (e.g. [(Hello) 123 (World)] TJ)
@param text the string to get width of
@param kerned the kerning option
@param kerning the kerning option from TJ array
@return the width
Shows text right, left or center aligned with rotation.
@param alignment the alignment can be ALIGN_CENTER, ALIGN_RIGHT or ALIGN_LEFT
@param text the text to show
@param x the x pivot position
@param y the y pivot position
@param rotation the rotation to be applied in degrees counterclockwise
Shows text kerned right, left or center aligned with rotation.
@param alignment the alignment can be ALIGN_CENTER, ALIGN_RIGHT or ALIGN_LEFT
@param text the text to show
@param x the x pivot position
@param y the y pivot position
@param rotation the rotation to be applied in degrees counterclockwise
Concatenate a matrix to the current transformation matrix.
@param transform added to the Current Transformation Matrix
Concatenate a matrix to the current transformation matrix.
@param transform added to the Current Transformation Matrix
@since 5.0.1
Draws a partial ellipse inscribed within the rectangle x1,y1,x2,y2,
starting at startAng degrees and covering extent degrees. Angles
start with 0 to the right (+x) and increase counter-clockwise.
@param x1 a corner of the enclosing rectangle
@param y1 a corner of the enclosing rectangle
@param x2 a corner of the enclosing rectangle
@param y2 a corner of the enclosing rectangle
@param startAng starting angle in degrees
@param extent angle extent in degrees
Draws a partial ellipse inscribed within the rectangle x1,y1,x2,y2,
starting at startAng degrees and covering extent degrees. Angles
start with 0 to the right (+x) and increase counter-clockwise.
@param x1 a corner of the enclosing rectangle
@param y1 a corner of the enclosing rectangle
@param x2 a corner of the enclosing rectangle
@param y2 a corner of the enclosing rectangle
@param startAng starting angle in degrees
@param extent angle extent in degrees
Draws an ellipse inscribed within the rectangle x1,y1,x2,y2.
@param x1 a corner of the enclosing rectangle
@param y1 a corner of the enclosing rectangle
@param x2 a corner of the enclosing rectangle
@param y2 a corner of the enclosing rectangle
Draws an ellipse inscribed within the rectangle x1,y1,x2,y2.
@param x1 a corner of the enclosing rectangle
@param y1 a corner of the enclosing rectangle
@param x2 a corner of the enclosing rectangle
@param y2 a corner of the enclosing rectangle
Create a new colored tiling pattern.
@param width the width of the pattern
@param height the height of the pattern
@param xstep the desired horizontal spacing between pattern cells.
May be either positive or negative, but not zero.
@param ystep the desired vertical spacing between pattern cells.
May be either positive or negative, but not zero.
@return the PdfPatternPainter
where the pattern will be created
Create a new colored tiling pattern. Variables xstep and ystep are set to the same values
of width and height.
@param width the width of the pattern
@param height the height of the pattern
@return the PdfPatternPainter
where the pattern will be created
Create a new uncolored tiling pattern.
@param width the width of the pattern
@param height the height of the pattern
@param xstep the desired horizontal spacing between pattern cells.
May be either positive or negative, but not zero.
@param ystep the desired vertical spacing between pattern cells.
May be either positive or negative, but not zero.
@param color the default color. Can be null
@return the PdfPatternPainter
where the pattern will be created
Create a new uncolored tiling pattern.
Variables xstep and ystep are set to the same values
of width and height.
@param width the width of the pattern
@param height the height of the pattern
@param color the default color. Can be null
@return the PdfPatternPainter
where the pattern will be created
Creates a new appearance to be used with form fields.
@param width the bounding box width
@param height the bounding box height
@return the appearance created
Adds a PostScript XObject to this content.
@param psobject the object
Adds a template to this content.
@param template the template
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
Adds a template to this content.
@param template the template
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
Adds a template to this content.
@param template the template
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
@param tagContent true
- template content will be tagged(all that will be added after), false
- only a Do operator will be tagged.
taken into account only if isTagged()
- true
.
Adds a template to this content.
@param template the template
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
@param tagContent true
- template content will be tagged(all that will be added after), false
- only a Do operator will be tagged.
taken into account only if isTagged()
- true
.
Adds a template to this content.
@param template the template
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
@param tagContent true
- template content will be tagged(all that will be added after), false
- only a Do operator will be tagged.
taken into account only if isTagged()
- true
.
Adds a form XObject to this content.
@param formXObj the form XObject
@param name the name of form XObject in content stream. The name is changed, if if it already exists in page resources
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
@return Name under which XObject was stored in resources. See name
parameter
Adds a form XObject to this content.
@param formXObj the form XObject
@param name the name of form XObject in content stream. The name is changed, if if it already exists in page resources
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an element of the transformation matrix
@return Name under which XObject was stored in resources. See name
parameter
adds a template with the given matrix.
@param template template to add
@param transform transform to apply to the template prior to adding it.
adds a template with the given matrix.
@param template template to add
@param transform transform to apply to the template prior to adding it.
@param tagContent true
- template content will be tagged(all that will be added after), false
- only a Do operator will be tagged.
taken into account only if isTagged()
- true
.
adds a template with the given matrix.
@param template template to add
@param transform transform to apply to the template prior to adding it.
@param tagContent true
- template content will be tagged(all that will be added after), false
- only a Do operator will be tagged.
taken into account only if isTagged()
- true
.
adds a template with the given matrix.
@param template template to add
@param transform transform to apply to the template prior to adding it.
@since 5.0.1
Adds a template to this content.
@param template the template
@param x the x location of this template
@param y the y location of this template
Adds a template to this content.
@param template the template
@param x the x location of this template
@param y the y location of this template
Changes the current color for filling paths (device dependent colors!).
Sets the color space to DeviceCMYK (or the DefaultCMYK color space),
and sets the color to use for filling paths.
This method is described in the 'Portable Document Format Reference Manual version 1.3'
section 8.5.2.1 (page 331).
Following the PDF manual, each operand must be a number between 0 (no ink) and
1 (maximum ink). This method however accepts only ints between 0x00 and 0xFF.
@param cyan the intensity of cyan
@param magenta the intensity of magenta
@param yellow the intensity of yellow
@param black the intensity of black
Changes the current color for stroking paths (device dependent colors!).
Sets the color space to DeviceCMYK (or the DefaultCMYK color space),
and sets the color to use for stroking paths.
This method is described in the 'Portable Document Format Reference Manual version 1.3'
section 8.5.2.1 (page 331).
Following the PDF manual, each operand must be a number between 0 (miniumum intensity) and
1 (maximum intensity). This method however accepts only ints between 0x00 and 0xFF.
@param cyan the intensity of red
@param magenta the intensity of green
@param yellow the intensity of blue
@param black the intensity of black
Changes the current color for filling paths (device dependent colors!).
Sets the color space to DeviceRGB (or the DefaultRGB color space),
and sets the color to use for filling paths.
This method is described in the 'Portable Document Format Reference Manual version 1.3'
section 8.5.2.1 (page 331).
Following the PDF manual, each operand must be a number between 0 (miniumum intensity) and
1 (maximum intensity). This method however accepts only ints between 0x00 and 0xFF.
@param red the intensity of red
@param green the intensity of green
@param blue the intensity of blue
Changes the current color for stroking paths (device dependent colors!).
Sets the color space to DeviceRGB (or the DefaultRGB color space),
and sets the color to use for stroking paths.
This method is described in the 'Portable Document Format Reference Manual version 1.3'
section 8.5.2.1 (page 331).
Following the PDF manual, each operand must be a number between 0 (miniumum intensity) and
1 (maximum intensity). This method however accepts only ints between 0x00 and 0xFF.
@param red the intensity of red
@param green the intensity of green
@param blue the intensity of blue
Sets the stroke color. color
can be an
ExtendedColor
.
@param color the color
Sets the fill color. color
can be an
ExtendedColor
.
@param color the color
Sets the fill color to a spot color.
@param sp the spot color
@param tint the tint for the spot color. 0 is no color and 1
is 100% color
Sets the stroke color to a spot color.
@param sp the spot color
@param tint the tint for the spot color. 0 is no color and 1
is 100% color
Sets the fill color to a pattern. The pattern can be
colored or uncolored.
@param p the pattern
Outputs the color values to the content.
@param color The color
@param tint the tint if it is a spot color, ignored otherwise
Sets the fill color to an uncolored pattern.
@param p the pattern
@param color the color of the pattern
Sets the fill color to an uncolored pattern.
@param p the pattern
@param color the color of the pattern
@param tint the tint if the color is a spot color, ignored otherwise
Sets the stroke color to an uncolored pattern.
@param p the pattern
@param color the color of the pattern
Sets the stroke color to an uncolored pattern.
@param p the pattern
@param color the color of the pattern
@param tint the tint if the color is a spot color, ignored otherwise
Sets the stroke color to a pattern. The pattern can be
colored or uncolored.
@param p the pattern
Paints using a shading object.
@param shading the shading object
Paints using a shading pattern.
@param shading the shading pattern
Sets the shading fill pattern.
@param shading the shading pattern
Sets the shading stroke pattern
@param shading the shading pattern
Check if we have a valid PdfWriter.
Show an array of text.
@param text array of text
Gets the PdfWriter
in use by this object.
@return the PdfWriter
in use by this object
Gets the PdfDocument
in use by this object.
@return the PdfDocument
in use by this object
Implements a link to other part of the document. The jump will
be made to a local destination with the same name, that must exist.
@param name the name for this link
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper right y corner of the activation area
The local destination to where a local goto with the same
name will jump.
@param name the name of this local destination
@param destination the PdfDestination
with the jump coordinates
@return true
if the local destination was added,
false
if a local destination with the same name
already exists
Gets a duplicate of this PdfContentByte
. All
the members are copied by reference but the buffer stays different.
@return a copy of this PdfContentByte
Implements a link to another document.
@param filename the filename for the remote document
@param name the name to jump to
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper right y corner of the activation area
Implements a link to another document.
@param filename the filename for the remote document
@param page the page to jump to
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper right y corner of the activation area
Adds a round rectangle to the current path.
@param x x-coordinate of the starting point
@param y y-coordinate of the starting point
@param w width
@param h height
@param r radius of the arc corner
Adds a round rectangle to the current path.
@param x x-coordinate of the starting point
@param y y-coordinate of the starting point
@param w width
@param h height
@param r radius of the arc corner
Implements an action in an area.
@param action the PdfAction
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper right y corner of the activation area
Outputs a string
directly to the content.
@param s the string
Outputs a char
directly to the content.
@param c the char
Outputs a float
directly to the content.
@param n the float
Throws an error if it is a pattern.
@param t the object to check
Draws a TextField.
Draws a TextField.
Draws a TextField.
Draws a TextField.
Draws a button.
Draws a button.
Sets the graphic state
@param gstate the graphic state
Ends a layer controled graphic block. It will end the most recent open block.
Sets the default colorspace.
@param name the name of the colorspace. It can be PdfName.DEFAULTGRAY
, PdfName.DEFAULTRGB
or PdfName.DEFAULTCMYK
@param obj the colorspace. A null
or PdfNull
removes any colorspace with the same name
Concatenates a transformation to the current transformation
matrix.
@param af the transformation
Begins a marked content sequence. This sequence will be tagged with the structure struc
.
The same structure can be used several times to connect text that belongs to the same logical segment
but is in a different location, like the same paragraph crossing to another page, for example.
@param struc the tagging structure
Begins a marked content sequence. This sequence will be tagged with the structure struc
.
The same structure can be used several times to connect text that belongs to the same logical segment
but is in a different location, like the same paragraph crossing to another page, for example.
@param struc the tagging structure
Ends a marked content sequence
Begins a marked content sequence. If property is null
the mark will be of the type
BMC
otherwise it will be BDC
.
@param tag the tag
@param property the property
@param inline true
to include the property in the content or false
to include the property in the resource dictionary with the possibility of reusing
This is just a shorthand to beginMarkedContentSequence(tag, null, false)
.
@param tag the tag
Checks for any dangling state: Mismatched save/restore state, begin/end text,
begin/end layer, or begin/end marked content sequence.
If found, this function will throw. This function is called automatically
during a Reset() (from Document.NewPage() for example), and before writing
itself out in ToPdf().
One possible cause: not calling myPdfGraphics2D.Dispose() will leave dangling
SaveState() calls.
@since 2.1.6
@throws IllegalPdfSyntaxException (a runtime exception)
Parses the page or template content.
@author Paulo Soares
Commands have this type.
Holds value of property tokeniser.
Creates a new instance of PdfContentParser
@param tokeniser the tokeniser with the content
Parses a single command from the content. Each command is output as an array of arguments
having the command itself as the last element. The returned array will be empty if the
end of content was reached.
@param ls an ArrayList
to use. It will be cleared before using. If it's
null
will create a new ArrayList
@return the same ArrayList
given as argument or a new one
@throws IOException on error
Gets the tokeniser.
@return the tokeniser.
Sets the tokeniser.
@param tokeniser the tokeniser
Reads a dictionary. The tokeniser must be positioned past the "<<" token.
@return the dictionary
@throws IOException on error
Reads an array. The tokeniser must be positioned past the "[" token.
@return an array
@throws IOException on error
Reads a pdf object.
@return the pdf object
@throws IOException on error
Reads the next token skipping over the comments.
@return true
if a token was read, false
if the end of content was reached
@throws IOException on error
PdfContents
is a PdfStream
containing the contents (text + graphics) of a PdfPage
.
Constructs a PdfContents
-object, containing text and general graphics.
@param under the direct content that is under all others
@param content the graphics in a page
@param text the text in a page
@param secondContent the direct content that is over all others
@throws BadPdfFormatException on error
Make copies of PDF documents. Documents can be edited after reading and
before writing them out.
@author Mark Thompson
This class holds information about indirect references, since they are
renumbered by iText.
Holds value of property rotateContents.
Constructor
@param document
@param os outputstream
Setting page events isn't possible with Pdf(Smart)Copy.
Use the PageStamp class if you want to add content to copied pages.
@see com.itextpdf.text.pdf.PdfWriter#setPageEvent(com.itextpdf.text.pdf.PdfPageEvent)
Checks if the content is automatically adjusted to compensate
the original page rotation.
@return the auto-rotation status
Flags the content to be automatically adjusted to compensate
the original page rotation. The default is true
.
@param rotateContents true
to set auto-rotation, false
otherwise
Grabs a page from the input document
@param reader the reader of the document
@param pageNumber which page to get
@return the page
Translate a PRIndirectReference to a PdfIndirectReference
In addition, translates the object numbers, and copies the
referenced object to the output file.
NB: PRIndirectReferences (and PRIndirectObjects) really need to know what
file they came from, because each file has its own namespace. The translation
we do from their namespace to ours is *at best* heuristic, and guaranteed to
fail under some circumstances.
Translate a PRIndirectReference to a PdfIndirectReference
In addition, translates the object numbers, and copies the
referenced object to the output file.
NB: PRIndirectReferences (and PRIndirectObjects) really need to know what
file they came from, because each file has its own namespace. The translation
we do from their namespace to ours is *at best* heuristic, and guaranteed to
fail under some circumstances.
Translate a PRDictionary to a PdfDictionary. Also translate all of the
objects contained in it.
Translate a PRDictionary to a PdfDictionary. Also translate all of the
objects contained in it.
Translate a PRStream to a PdfStream. The data part copies itself.
Translate a PRArray to a PdfArray. Also translate all of the objects contained
in it
Translate a PRArray to a PdfArray. Also translate all of the objects contained
in it
Translate a PR-object to a Pdf-object
Translate a PR-object to a Pdf-object
convenience method. Given an importedpage, set our "globals"
convenience method. Given a reader, set our "globals"
Add an imported page to our output
@param iPage an imported page
@throws IOException, BadPdfFormatException
Adds a blank page.
@param rect The page dimension
@param rotation The rotation angle in degrees
@since 2.1.5
@throws DocumentException
Copy document fields to a destination document.
@param reader a document where fields are copied from.
@throws DocumentException
@throws IOException
Creates a new instance of StampContent
Gets a duplicate of this PdfContentByte
. All
the members are copied by reference but the buffer stays different.
@return a copy of this PdfContentByte
Concatenates PDF documents including form fields. The rules for the form field
concatenation are the same as in Acrobat. All the documents are kept in memory unlike
PdfCopy.
@author Paulo Soares
Creates a new instance.
@param os the output stream
@throws DocumentException on error
@throws IOException on error
Creates a new instance.
@param os the output stream
@param pdfVersion the pdf version the output will have
@throws DocumentException on error
@throws IOException on error
Concatenates a PDF document.
@param reader the PDF document
@throws DocumentException on error
Concatenates a PDF document selecting the pages to keep. The pages are described as a
List
of Integer
. The page ordering can be changed but
no page repetitions are allowed.
@param reader the PDF document
@param pagesToKeep the pages to keep
@throws DocumentException on error
Concatenates a PDF document selecting the pages to keep. The pages are described as
ranges. The page ordering can be changed but
no page repetitions are allowed.
@param reader the PDF document
@param ranges the comma separated ranges as described in {@link SequenceList}
@throws DocumentException on error
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param strength128Bits true
for 128 bit key length, false
for 40 bit key length
@throws DocumentException if the document is already open
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param strength true for 128 bit key length. false for 40 bit key length
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@throws DocumentException if the document is already open
Closes the output document.
Opens the document. This is usually not needed as AddDocument() will do it
automatically.
Adds JavaScript to the global document
@param js the JavaScript
Sets the bookmarks. The list structure is defined in
{@link SimpleBookmark}.
@param outlines the bookmarks or null
to remove any
Gets the underlying PdfWriter.
@return the underlying PdfWriter
Gets the 1.5 compression status.
@return true
if the 1.5 compression is on
Sets the document's compression to the new 1.5 mode with object streams and xref
streams. It can be set at any time but once set it can't be unset.
@see com.lowagie.text.pdf.interfaces.PdfEncryptionSettings#setEncryption(byte[], byte[], int, int)
@see com.lowagie.text.pdf.interfaces.PdfViewerPreferences#addViewerPreference(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject)
@see com.lowagie.text.pdf.interfaces.PdfViewerPreferences#setViewerPreferences(int)
@see com.lowagie.text.pdf.interfaces.PdfEncryptionSettings#setEncryption(java.security.cert.Certificate[], int[], int)
@author psoares
Sets a reference to "visited" in the copy process.
@param ref the reference that needs to be set to "visited"
@return true if the reference was set to visited
Checks if a reference has already been "visited" in the copy process.
@param ref the reference that needs to be checked
@return true if the reference was already visited
Checks if a reference refers to a page object.
@param ref the reference that needs to be checked
@return true is the reference refers to a page object.
Allows you to add one (or more) existing PDF document(s) to
create a new PDF and add the form of another PDF document to
this new PDF.
@since 2.1.5
@deprecated since 5.5.2
The class with the actual implementations.
Creates a new instance.
@param os the output stream
@throws DocumentException on error
Concatenates a PDF document.
@param reader the PDF document
@throws DocumentException on error
Concatenates a PDF document selecting the pages to keep. The pages are described as a
List
of Integer
. The page ordering can be changed but
no page repetitions are allowed.
@param reader the PDF document
@param pagesToKeep the pages to keep
@throws DocumentException on error
Concatenates a PDF document selecting the pages to keep. The pages are described as
ranges. The page ordering can be changed but
no page repetitions are allowed.
@param reader the PDF document
@param ranges the comma separated ranges as described in {@link SequenceList}
@throws DocumentException on error
Copies the form fields of this PDFDocument onto the PDF-Document which was added
@param reader the PDF document
@throws DocumentException on error
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param strength128Bits true
for 128 bit key length, false
for 40 bit key length
@throws DocumentException if the document is already open
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param strength true for 128 bit key length. false for 40 bit key length
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@throws DocumentException if the document is already open
Closes the output document.
Opens the document. This is usually not needed as addDocument() will do it
automatically.
Adds JavaScript to the global document
@param js the JavaScript
Sets the bookmarks. The list structure is defined in
SimpleBookmark#
.
@param outlines the bookmarks or null
to remove any
Gets the underlying PdfWriter.
@return the underlying PdfWriter
Gets the 1.5 compression status.
@return true
if the 1.5 compression is on
@see com.lowagie.text.pdf.interfaces.PdfEncryptionSettings#setEncryption(byte[], byte[], int, int)
@see com.lowagie.text.pdf.interfaces.PdfViewerPreferences#addViewerPreference(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject)
@see com.lowagie.text.pdf.interfaces.PdfViewerPreferences#setViewerPreferences(int)
@see com.lowagie.text.pdf.interfaces.PdfEncryptionSettings#setEncryption(java.security.cert.Certificate[], int[], int)
Allows you to add one (or more) existing PDF document(s)
and add the form(s) of (an)other PDF document(s).
@since 2.1.5
@deprecated since 5.5.2
This sets up the output document
@param os The Outputstream pointing to the output document
@throws DocumentException
This method feeds in the source document
@param reader The PDF reader containing the source document
@throws DocumentException
This merge fields is slightly different from the mergeFields method
of PdfCopyFields.
A PdfDashPattern
defines a dash pattern as described in
the PDF Reference Manual version 1.3 p 325 (section 8.4.3).
@see PdfArray
This is the length of a dash.
This is the length of a gap.
This is the phase.
Constructs a new PdfDashPattern
.
Constructs a new PdfDashPattern
.
Constructs a new PdfDashPattern
.
Constructs a new PdfDashPattern
.
Returns the PDF representation of this PdfArray
.
@return an array of byte
s
Constructs a PdfDate
-object.
@param d the date that has to be turned into a PdfDate
-object
Constructs a PdfDate
-object, representing the current day and time.
Adds a number of leading zeros to a given string
in order to get a string
of a certain length.
@param i a given number
@param length the length of the resulting string
@return the resulting string
Gives the W3C format of the PdfDate.
@return a formatted date
Gives the W3C format of the PdfDate.
@param d the date in the format D:YYYYMMDDHHmmSSOHH'mm'
@return a formatted date
A PdfColor
defines a Color (it's a PdfArray
containing 3 values).
@see PdfDictionary
This is a possible destination type
This is a possible destination type
This is a possible destination type
This is a possible destination type
This is a possible destination type
This is a possible destination type
This is a possible destination type
This is a possible destination type
Is the indirect reference to a page already added?
Creates a PdfDestination based on a String.
Valid Strings are for instance the values returned by SimpleNamedDestination:
"Fit", "XYZ 36 806 0",...
@param dest a String notation of a destination.
@since iText 5.0
Checks if an indirect reference to a page has been added.
@return true
or false
Adds the indirect reference of the destination page.
@param page an indirect reference
@return true if the page reference was added
Beginning with BaseVersion 1.7, the extensions dictionary lets developers
designate that a given document contains extensions to PDF. The presence
of the extension dictionary in a document indicates that it may contain
developer-specific PDF properties that extend a particular base version
of the PDF specification.
The extensions dictionary enables developers to identify their own extensions
relative to a base version of PDF. Additionally, the convention identifies
extension levels relative to that base version. The intent of this dictionary
is to enable developers of PDF-producing applications to identify company-specific
specifications (such as this one) that PDF-consuming applications use to
interpret the extensions.
@since 2.1.6
An instance of this class for Adobe 1.7 Extension level 3.
An instance of this class for ETSI 1.7 Extension level 2.
An instance of this class for ETSI 1.7 Extension level 5.
The prefix used in the Extensions dictionary added to the Catalog.
The base version.
The extension level within the baseversion.
Creates a PdfDeveloperExtension object.
@param prefix the prefix referring to the developer
@param baseversion the number of the base version
@param extensionLevel the extension level within the baseverion.
Gets the prefix name.
@return a PdfName
Gets the baseversion name.
@return a PdfName
Gets the extension level within the baseversion.
@return an integer
Generations the developer extension dictionary corresponding
with the prefix.
@return a PdfDictionary
This is a possible type of dictionary
This is a possible type of dictionary
This is a possible type of dictionary
This is a possible type of dictionary
This is a possible type of dictionary
This is the type of this dictionary
This is the hashmap that contains all the values and keys of the dictionary
Constructs an empty PdfDictionary
-object.
Constructs a PdfDictionary
-object of a certain type.
@param type a PdfName
Returns the PDF representation of this PdfDictionary
.
@return an array of byte
Adds a PdfObject
and its key to the PdfDictionary
.
If the value is null
or PdfNull
the key is deleted.
@param key key of the entry (a PdfName
)
@param value value of the entry (a PdfObject
)
Adds a PdfObject
and its key to the PdfDictionary
.
If the value is null it does nothing.
@param key key of the entry (a PdfName
)
@param value value of the entry (a PdfObject
)
Copies all of the mappings from the specified PdfDictionary
to this PdfDictionary
.
These mappings will replace any mappings previously contained in this
PdfDictionary
.
@param dic The PdfDictionary
with the mappings to be
copied over
Removes a PdfObject
and its key from the PdfDictionary
.
@param key key of the entry (a PdfName
)
Removes all the PdfObject
s and its keys from the
PdfDictionary
.
@since 5.0.2
Checks if a Dictionary
is of the type FONT.
@return true
if it is, false
if it isn't.
Checks if a Dictionary
is of the type PAGE.
@return true
if it is, false
if it isn't.
Checks if a Dictionary
is of the type PAGES.
@return true
if it is, false
if it isn't.
Checks if a Dictionary
is of the type CATALOG.
@return true
if it is, false
if it isn't.
Checks if a Dictionary
is of the type OUTLINES.
@return true
if it is, false
if it isn't.
Checks the type of the dictionary.
@param type the type you're looking for
@return true if the type of the dictionary corresponds with the type you're looking for
This function behaves the same as 'get', but will never return an indirect reference,
it will always look such references up and return the actual object.
@param key
@return null, or a non-indirect object
All the getAs functions will return either null, or the specified object type
This function will automatically look up indirect references. There's one obvious
exception, the one that will only return an indirect reference. All direct objects
come back as a null.
Mark A Storer (2/17/06)
@param key
@return the appropriate object in its final type, or null
Construct a PdfInfo
-object.
Constructs a PdfInfo
-object.
@param author name of the author of the document
@param title title of the document
@param subject subject of the document
Adds the title of the document.
@param title the title of the document
Adds the subject to the document.
@param subject the subject of the document
Adds some keywords to the document.
@param keywords the keywords of the document
Adds the name of the author to the document.
@param author the name of the author
Adds the name of the creator to the document.
@param creator the name of the creator
Adds the name of the producer to the document.
Adds the date of creation to the document.
Constructs a PdfCatalog
.
@param pages an indirect reference to the root of the document's Pages tree.
@param writer the writer the catalog applies to
Adds the names of the named destinations to the catalog.
@param localDestinations the local destinations
@param documentJavaScript the javascript used in the document
@param writer the writer the catalog applies to
Sets the document level additional actions.
@param actions dictionary of actions
Constructs a new PDF document.
@throws DocumentException on error
The PdfWriter
.
Adds a PdfWriter
to the PdfDocument
.
@param writer the PdfWriter
that writes everything
what is added to this document to an outputstream.
@throws DocumentException on error
This is the PdfContentByte object, containing the text.
This is the PdfContentByte object, containing the borders and other Graphics.
This represents the leading of the lines.
Getter for the current leading.
@return the current leading
@since 2.1.2
This is the current height of the document.
Signals that onParagraph is valid (to avoid that a Chapter/Section title is treated as a Paragraph).
@since 2.1.2
This represents the current alignment of the PDF Elements.
The current active PdfAction
when processing an Anchor
.
The current tab settings.
@return the current
@since 5.4.0
Signals that the current leading has to be subtracted from a YMark object when positive
and save current leading
@since 2.1.2
Save current @leading
Restore @leading from leadingStack
Getter and setter for the current tab stops.
@since 5.4.0
Signals that an Element
was added to the Document
.
@param element the element to add
@return true
if the element was added, false
if not.
@throws DocumentException when a document isn't open yet, or has been closed
Use this method to set the XMP Metadata.
@param xmpMetadata The xmpMetadata to set.
@throws IOException
Makes a new page and sends it to the PdfWriter
.
@return true if new page was added
@throws DocumentException on error
Sets the pagesize.
@param pageSize the new pagesize
@return true
if the page size was set
margin in x direction starting from the left. Will be valid in the next page
margin in x direction starting from the right. Will be valid in the next page
margin in y direction starting from the top. Will be valid in the next page
margin in y direction starting from the bottom. Will be valid in the next page
Sets the margins.
@param marginLeft the margin on the left
@param marginRight the margin on the right
@param marginTop the margin on the top
@param marginBottom the margin on the bottom
@return a bool
@see com.lowagie.text.DocListener#setMarginMirroring(bool)
@see com.lowagie.text.DocListener#setMarginMirroring(boolean)
@since 2.1.6
Sets the page number.
@param pageN the new page number
Sets the page number to 0.
Signals that OnOpenDocument should be called.
The line that is currently being written.
The lines that are written until now.
Adds the current line to the list of lines and also adds an empty line.
@throws DocumentException on error
line.height() is usually the same as the leading
We should take leading into account if it is not the same as the line.height
@return float combined height of the line
@since 5.5.1
If the current line is not empty or null, it is added to the arraylist
of lines and a new empty line is added.
@throws DocumentException on error
Gets the current vertical page position.
@param 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.
@return The current vertical page position.
Holds the type of the last element, that has been added to the document.
Ensures that a new line has been started.
Writes all the lines to the text-object.
@return the displacement that was caused
@throws DocumentException on error
The characters to be applied the hanging punctuation.
This represents the current indentation of the PDF Elements on the left side.
Indentation to the left caused by a section.
This represents the current indentation of the PDF Elements on the left side.
This is the indentation caused by an image on the left.
This represents the current indentation of the PDF Elements on the right side.
Indentation to the right caused by a section.
This is the indentation caused by an image on the right.
This represents the current indentation of the PDF Elements on the top side.
This represents the current indentation of the PDF Elements on the bottom side.
Gets the indentation on the left side.
@return a margin
Gets the indentation on the right side.
@return a margin
Gets the indentation on the top side.
@return a margin
Gets the indentation on the bottom side.
@return a margin
Calls addSpacing(float, float, Font, boolean (false)).
Adds extra space.
some meta information about the Document.
Gets the PdfCatalog
-object.
@param pages an indirect reference to this document pages
@return PdfCatalog
This is the root outline of the document.
This is the current PdfOutline
in the hierarchy of outlines.
Adds a named outline to the document .
@param outline the outline to be added
@param name the name of this local destination
Gets the root outline. All the outlines must be created with a parent.
The first level is created with this outline.
@return the root outline
Contains the Viewer preferences of this PDF document.
@see com.lowagie.text.pdf.interfaces.PdfViewerPreferences#setViewerPreferences(int)
@see com.lowagie.text.pdf.interfaces.PdfViewerPreferences#addViewerPreference(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject)
Implements a link to other part of the document. The jump will
be made to a local destination with the same name, that must exist.
@param name the name for this link
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper right y corner of the activation area
Implements a link to another document.
@param filename the filename for the remote document
@param name the name to jump to
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper right y corner of the activation area
Implements a link to another document.
@param filename the filename for the remote document
@param page the page to jump to
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper right y corner of the activation area
Implements an action in an area.
@param action the PdfAction
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper right y corner of the activation area
Stores the destinations keyed by name. Value is
Object[]{PdfAction,PdfIndirectReference,PdfDestintion}
.
The local destination to where a local goto with the same
name will jump to.
@param name the name of this local destination
@param destination the PdfDestination
with the jump coordinates
@return true
if the local destination was added,
false
if a local destination with the same name
already existed
Stores a list of document level JavaScript actions.
Sets the collection dictionary.
@param collection a dictionary of type PdfCollection
Gets the AcroForm object.
@return the PdfAcroform object of the PdfDocument
This is the size of the next page.
This is the size of the several boxes of the current Page.
This is the size of the several boxes that will be used in
the next page.
Gives the size of a trim, art, crop or bleed box, or null if not defined.
@param boxName crop, trim, art or bleed
This checks if the page is empty.
Sets the display duration for the page (for presentations)
@param seconds the number of seconds to display the page
Sets the transition for the page
@param transition the PdfTransition object
This are the page resources of the current Page.
Holds value of property strictImageSequence.
Setter for property strictImageSequence.
@param strictImageSequence New value of property strictImageSequence.
This is the position where the image ends.
Method added by Pelikan Stephan
@see com.lowagie.text.DocListener#clearTextWrap()
This is the image that could not be shown on a previous page.
Adds an image to the document.
@param image the Image
to add
@throws PdfException on error
@throws DocumentException on error
Adds a PdfPTable
to the document.
@param ptable the PdfPTable
to be added to the document.
@throws DocumentException on error
@since 5.0.1
Extends PdfStream and should be used to create Streams for Embedded Files
(file attachments).
@since 2.1.3
Creates a Stream object using an InputStream and a PdfWriter object
@param in the InputStream that will be read to get the Stream object
@param writer the writer to which the stream will be added
Creates a Stream object using a byte array
@param fileStore the bytes for the stream
@see com.lowagie.text.pdf.PdfDictionary#toPdf(com.lowagie.text.pdf.PdfWriter, java.io.OutputStream)
Supports fast encodings for winansi and PDFDocEncoding.
@author Paulo Soares
Checks is text
only has PdfDocEncoding characters.
@param text the String
to test
@return true
if only PdfDocEncoding characters are present
Adds an extra encoding.
@param name the name of the encoding. The encoding recognition is case insensitive
@param enc the conversion class
@author Paulo Soares
The encryption key for a particular object/generation
The encryption key length for a particular object/generation
The global encryption key
Work area to prepare the object/generation bytes
The message digest algorithm MD5
The encryption key for the owner
The encryption key for the user
The public key security handler for certificate encryption
The generic key length. It may be 40 or 128.
Indicates if the encryption is only necessary for embedded files.
@since 2.1.3
Indicates if only the embedded files have to be encrypted.
@return if true only the embedded files will be encrypted
@since 2.1.3
ownerKey, documentID must be setuped
mkey must be setuped
Computes user password if standard encryption handler is used with Standard40, Standard128 or AES128 algorithm (Revision 2 - 4).
@param ownerPassword owner password of the encrypted document.
@return user password, or null if revision 5 (AES256) or greater of standard encryption handler was used.
This class takes any PDF and returns exactly the same but
encrypted. All the content, links, outlines, etc, are kept.
It is also possible to change the info dictionary.
Entry point to encrypt a PDF document. The encryption parameters are the same as in
PdfWriter
. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param reader the read PDF
@param os the output destination
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param strength128Bits true
for 128 bit key length, false
for 40 bit key length
@throws DocumentException on error
@throws IOException on error
Entry point to encrypt a PDF document. The encryption parameters are the same as in
PdfWriter
. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param reader the read PDF
@param os the output destination
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param strength128Bits true
for 128 bit key length, false
for 40 bit key length
@param newInfo an optional String
map to add or change
the info dictionary. Entries with null
values delete the key in the original info dictionary
@throws DocumentException on error
@throws IOException on error
Entry point to encrypt a PDF document. The encryption parameters are the same as in
PdfWriter
. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param reader the read PDF
@param os the output destination
@param strength true
for 128 bit key length, false
for 40 bit key length
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@throws DocumentException on error
@throws IOException on error
Entry point to encrypt a PDF document. The encryption parameters are the same as in
PdfWriter
. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param reader the read PDF
@param os the output destination
@param strength true
for 128 bit key length, false
for 40 bit key length
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param newInfo an optional String
map to add or change
the info dictionary. Entries with null
values delete the key in the original info dictionary
@throws DocumentException on error
@throws IOException on error
Entry point to encrypt a PDF document. The encryption parameters are the same as in
PdfWriter
. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param reader the read PDF
@param os the output destination
@param type 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 cleartext
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param newInfo an optional String
map to add or change
the info dictionary. Entries with null
values delete the key in the original info dictionary
@throws DocumentException on error
@throws IOException on error
Entry point to encrypt a PDF document. The encryption parameters are the same as in
PdfWriter
. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param reader the read PDF
@param os the output destination
@param type 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 cleartext
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
values delete the key in the original info dictionary
@throws DocumentException on error
@throws IOException on error
Give you a verbose analysis of the permissions.
@param permissions the permissions value of a PDF file
@return a String that explains the meaning of the permissions value
Tells you if printing is allowed.
@param permissions the permissions value of a PDF file
@return true if printing is allowed
@since 2.0.7
Tells you if modifying content is allowed.
@param permissions the permissions value of a PDF file
@return true if modifying content is allowed
@since 2.0.7
Tells you if copying is allowed.
@param permissions the permissions value of a PDF file
@return true if copying is allowed
@since 2.0.7
Tells you if modifying annotations is allowed.
@param permissions the permissions value of a PDF file
@return true if modifying annotations is allowed
@since 2.0.7
Tells you if filling in fields is allowed.
@param permissions the permissions value of a PDF file
@return true if filling in fields is allowed
@since 2.0.7
Tells you if repurposing for screenreaders is allowed.
@param permissions the permissions value of a PDF file
@return true if repurposing for screenreaders is allowed
@since 2.0.7
Tells you if document assembly is allowed.
@param permissions the permissions value of a PDF file
@return true if document assembly is allowed
@since 2.0.7
Tells you if degraded printing is allowed.
@param permissions the permissions value of a PDF file
@return true if degraded printing is allowed
@since 2.0.7
Signals that an unspecified problem while constructing a PDF document.
@see BadPdfFormatException
Specifies a file or an URL. The file can be extern or embedded.
@author Paulo Soares
Creates a new instance of PdfFileSpecification. The static methods are preferred.
Creates a file specification of type URL.
@param writer the PdfWriter
@param url the URL
@return the file specification
Creates a file specification with the file embedded. The file may
come from the file system or from a byte array. The data is flate compressed.
@param writer the PdfWriter
@param filePath the file path
@param fileDisplay the file information that is presented to the user
@param fileStore the byte array with the file. If it is not null
it takes precedence over filePath
@throws IOException on error
@return the file specification
Creates a file specification with the file embedded. The file may
come from the file system or from a byte array. The data is flate compressed.
@param writer the PdfWriter
@param filePath the file path
@param fileDisplay the file information that is presented to the user
@param fileStore the byte array with the file. If it is not null
it takes precedence over filePath
@param compressionLevel the compression level to be used for compressing the file
it takes precedence over filePath
@throws IOException on error
@return the file specification
@since 2.1.3
Creates a file specification with the file embedded. The file may
come from the file system or from a byte array.
@param writer the PdfWriter
@param filePath the file path
@param fileDisplay the file information that is presented to the user
@param fileStore the byte array with the file. If it is not null
it takes precedence over filePath
@param compress sets the compression on the data. Multimedia content will benefit little
from compression
@throws IOException on error
@return the file specification
Creates a file specification with the file embedded. The file may
come from the file system or from a byte array.
@param writer the PdfWriter
@param filePath the file path
@param fileDisplay the file information that is presented to the user
@param fileStore the byte array with the file. If it is not null
it takes precedence over filePath
@param compress sets the compression on the data. Multimedia content will benefit little
from compression
@param mimeType the optional mimeType
@param fileParameter the optional extra file parameters such as the creation or modification date
@throws IOException on error
@return the file specification
Creates a file specification with the file embedded. The file may
come from the file system or from a byte array.
@param writer the PdfWriter
@param filePath the file path
@param fileDisplay the file information that is presented to the user
@param fileStore the byte array with the file. If it is not null
it takes precedence over filePath
@param mimeType the optional mimeType
@param fileParameter the optional extra file parameters such as the creation or modification date
@param compressionLevel the level of compression
@throws IOException on error
@return the file specification
@since 2.1.3
Creates a file specification for an external file.
@param writer the PdfWriter
@param filePath the file path
@return the file specification
Gets the indirect reference to this file specification.
Multiple invocations will retrieve the same value.
@throws IOException on error
@return the indirect reference
Sets the file name (the key /F) string as an hex representation
to support multi byte file names. The name must have the slash and
backslash escaped according to the file specification rules
@param fileName the file name as a byte array
Adds the unicode file name (the key /UF). This entry was introduced
in PDF 1.7. The filename must have the slash and backslash escaped
according to the file specification rules.
@param filename the filename
@param unicode if true, the filename is UTF-16BE encoded; otherwise PDFDocEncoding is used;
Sets a flag that indicates whether an external file referenced by the file
specification is volatile. If the value is true, applications should never
cache a copy of the file.
@param volatile_file if true, the external file should not be cached
Adds a description for the file that is specified here.
@param description some text
@param unicode if true, the text is added as a unicode string
Adds the Collection item dictionary.
the font metrics.
the size.
Compares this PdfFont
with another
@param object the other PdfFont
@return a value
Returns the size of this font.
@return a size
Returns the approximative width of 1 character of this font.
@return a width in Text Space
Returns the width of a certain character of this font.
@param character a certain character
@return a width in Text Space
Implements form fields.
@author Paulo Soares
Allows text fields to support rich text.
@since 5.0.6
Holds value of property parent.
Constructs a new PdfAnnotation
of subtype link (Action).
Creates new PdfFormField
Getter for property parent.
@return Value of property parent.
Sets the rich value for this field.
It is suggested that the regular value of this field be set to an
equivalent value. Rich text values are only supported since PDF 1.5,
and require that the FF_RV flag be set. See PDF Reference chapter
12.7.3.4 for details.
@param rv HTML markup for the rich value of this field
@since 5.0.6
PdfFormObject
is a type of XObject containing a template-object.
This is a PdfNumber representing 0.
This is a PdfNumber representing 1.
This is the 1 - matrix.
Constructs a PdfFormXObject
-object.
@param template the template
@param compressionLevel the compression level for the stream
@since 2.1.3 (Replacing the existing constructor with param compressionLevel)
Implements PDF functions.
@author Paulo Soares
Creates new PdfFunction
The graphic state dictionary.
@author Paulo Soares
A possible blend mode
A possible blend mode
A possible blend mode
A possible blend mode
A possible blend mode
A possible blend mode
A possible blend mode
A possible blend mode
A possible blend mode
A possible blend mode
A possible blend mode
A possible blend mode
A possible blend mode
Sets the flag whether to apply overprint for stroking.
@param ov
Sets the flag whether to apply overprint for non stroking painting operations.
@param ov
Sets the flag whether to toggle knockout behavior for overprinted objects.
@param ov - accepts 0 or 1
Sets the current stroking alpha constant, specifying the constant shape or
constant opacity value to be used for stroking operations in the transparent
imaging model.
@param n
Sets the current stroking alpha constant, specifying the constant shape or
constant opacity value to be used for nonstroking operations in the transparent
imaging model.
@param n
The alpha source flag specifying whether the current soft mask
and alpha constant are to be interpreted as shape values (true)
or opacity values (false).
@param v
Determines the behaviour of overlapping glyphs within a text object
in the transparent imaging model.
@param v
The current blend mode to be used in the transparent imaging model.
@param bm
Set the rendering intent, possible values are: PdfName.ABSOLUTECOLORIMETRIC,
PdfName.RELATIVECOLORIMETRIC, PdfName.SATURATION, PdfName.PERCEPTUAL.
@param ri
A PdfICCBased
defines a ColorSpace
@see PdfStream
Creates an ICC stream.
@param profile an ICC profile
Creates an ICC stream.
@param compressionLevel the compressionLevel
@param profile an ICC profile
@since 2.1.3 (replacing the constructor without param compressionLevel)
PdfImage
is a PdfStream
containing an image-Dictionary
and -stream.
This is the PdfName
of the image.
Constructs a PdfImage
-object.
@param image the Image
-object
@param name the PdfName
for this image
@throws BadPdfFormatException on error
Returns the PdfName
of the image.
@return the name
Called when no resource name is provided in our constructor. This generates a
name that is required to be unique within a given resource dictionary.
@since 5.0.1
Represents an imported page.
@author Paulo Soares
True if the imported page has been copied to a writer.
@since iText 5.0.4
Reads the content from this PdfImportedPage
-object from a reader.
@return self
Always throws an error. This operation is not allowed.
@param image dummy
@param a dummy
@param b dummy
@param c dummy
@param d dummy
@param e dummy
@param f dummy
@throws DocumentException dummy
Always throws an error. This operation is not allowed.
@param template dummy
@param a dummy
@param b dummy
@param c dummy
@param d dummy
@param e dummy
@param f dummy
Always throws an error. This operation is not allowed.
@return dummy
Gets the stream representing this page.
@param compressionLevel the compressionLevel
@return the stream representing this page
@since 2.1.3 (replacing the method without param compressionLevel)
Always throws an error. This operation is not allowed.
@param bf dummy
@param size dummy
Checks if the page has to be copied.
@return true if the page has to be copied.
@since iText 5.0.4
Indicate that the resources of the imported page have been copied.
@since iText 5.0.4
The object number
the generation number
Constructs a PdfIndirectObject
.
@param number the objecti number
@param objecti the direct objecti
Constructs a PdfIndirectObject
.
@param number the objecti number
@param generation the generation number
@param objecti the direct objecti
Returns a PdfIndirectReference
to this PdfIndirectObject
.
@return a PdfIndirectReference
Writes eficiently to a stream
@param os the stream to write to
@throws IOException on write error
the object number
the generation number
Constructs a PdfIndirectReference
.
@param type the type of the PdfObject
that is referenced to
@param number the object number.
@param generation the generation number.
Constructs a PdfIndirectReference
.
@param type the type of the PdfObject
that is referenced to
@param number the object number.
Returns the number of the object.
@return a number.
Returns the generation of the object.
@return a number.
An optional content group is a dictionary representing a collection of graphics
that can be made visible or invisible dynamically by users of viewer applications.
In iText they are referenced as layers.
@author Paulo Soares
Holds value of property on.
Holds value of property onPanel.
Creates a title layer. A title layer is not really a layer but a collection of layers
under the same title heading.
@param title the title text
@param writer the PdfWriter
@return the title layer
Creates a new layer.
@param name the name of the layer
@param writer the writer
Adds a child layer. Nested layers can only have one parent.
@param child the child layer
Gets the parent layer.
@return the parent layer or null
if the layer has no parent
Gets the children layers.
@return the children layers or null
if the layer has no children
Gets the PdfIndirectReference
that represents this layer.
@return the PdfIndirectReference
that represents this layer
Sets the name of this layer.
@param name the name of this layer
Gets the dictionary representing the layer. It just returns this
.
@return the dictionary representing the layer
Gets the initial visibility of the layer.
@return the initial visibility of the layer
Used by the creating application to store application-specific
data associated with this optional content group.
@param creator a text string specifying the application that created the group
@param subtype a string defining the type of content controlled by the group. Suggested
values include but are not limited to Artwork, for graphic-design or publishing
applications, and Technical, for technical designs such as building plans or
schematics
Specifies the language of the content controlled by this
optional content group
@param lang a language string which specifies a language and possibly a locale
(for example, es-MX represents Mexican Spanish)
@param preferred used by viewer applications when there is a partial match but no exact
match between the system language and the language strings in all usage dictionaries
Specifies the recommended state for content in this
group when the document (or part of it) is saved by a viewer application to a format
that does not support optional content (for example, an earlier version of
PDF or a raster image format).
@param export the export state
Specifies a range of magnifications at which the content
in this optional content group is best viewed.
@param min the minimum recommended magnification factors at which the group
should be ON. A negative value will set the default to 0
@param max the maximum recommended magnification factor at which the group
should be ON. A negative value will set the largest possible magnification supported by the
viewer application
Specifies that the content in this group is intended for
use in printing
@param subtype a name specifying the kind of content controlled by the group;
for example, Trapping, PrintersMarks and Watermark
@param printstate indicates that the group should be
set to that state when the document is printed from a viewer application
Indicates that the group should be set to that state when the
document is opened in a viewer application.
@param view the view state
Indicates that the group contains a pagination artifact.
@param pe one of the following names: "HF" (Header Footer),
"FG" (Foreground), "BG" (Background), or "L" (Logo).
@since 5.0.2
One of more users for whom this optional content group is primarily intended.
@param type should be "Ind" (Individual), "Ttl" (Title), or "Org" (Organization).
@param names one or more names
@since 5.0.2
Gets the layer visibility in Acrobat's layer panel
@return the layer visibility in Acrobat's layer panel
Sets the visibility of the layer in Acrobat's layer panel. If false
the layer cannot be directly manipulated by the user. Note that any children layers will
also be absent from the panel.
@param onPanel the visibility of the layer in Acrobat's layer panel
Content typically belongs to a single optional content group,
and is visible when the group is ON and invisible when it is OFF. To express more
complex visibility policies, content should not declare itself to belong to an optional
content group directly, but rather to an optional content membership dictionary
represented by this class.
@author Paulo Soares
Visible only if all of the entries are ON.
Visible if any of the entries are ON.
Visible if any of the entries are OFF.
Visible only if all of the entries are OFF.
Creates a new, empty, membership layer.
@param writer the writer
Gets the PdfIndirectReference
that represents this membership layer.
@return the PdfIndirectReference
that represents this layer
Adds a new member to the layer.
@param layer the new member to the layer
Gets the member layers.
@return the member layers
Sets the visibility policy for content belonging to this
membership dictionary. Possible values are ALLON, ANYON, ANYOFF and ALLOFF.
The default value is ANYON.
@param type the visibility policy
Sets the visibility expression for content belonging to this
membership dictionary.
@param ve A (nested) array of which the first value is /And, /Or, or /Not
followed by a series of indirect references to OCGs or other visibility
expressions.
@since 5.0.2
Gets the dictionary representing the membership layer. It just returns this
.
@return the dictionary representing the layer
PdfLine
defines an array with PdfChunk
-objects
that fit into 1 line.
The arraylist containing the chunks.
The left indentation of the line.
The width of the line.
The alignment of the line.
The heigth of the line.
true
if the chunk splitting was caused by a newline.
The original width.
Constructs a new PdfLine
-object.
@param left the limit of the line at the left
@param right the limit of the line at the right
@param alignment the alignment of the line
@param height the height of the line
Creates a PdfLine object.
@param left the left offset
@param originalWidth the original width of the line
@param remainingWidth bigger than 0 if the line isn't completely filled
@param alignment the alignment of the line
@param newlineSplit was the line splitted (or does the paragraph end with this line)
@param line an array of PdfChunk objects
@param isRTL do you have to read the line from Right to Left?
Adds a PdfChunk
to the PdfLine
.
@param chunk the PdfChunk
to add
@param currentLeading new value for the height of the line
@return null
if the chunk could be added completely; if not
a PdfChunk
containing the part of the chunk that could
not be added is returned
Adds a PdfChunk
to the PdfLine
.
@param chunk the PdfChunk
to add
@return null
if the chunk could be added completely; if not
a PdfChunk
containing the part of the chunk that could
not be added is returned
Returns the number of chunks in the line.
@return a value
Returns an iterator of PdfChunk
s.
@return an Iterator
Returns the height of the line.
@return a value
Returns the left indentation of the line taking the alignment of the line into account.
@return a value
Checks if this line has to be justified.
@return true
if the alignment equals ALIGN_JUSTIFIED and there is some width left.
Adds extra indentation to the left (for Paragraph.setFirstLineIndent).
Returns the width that is left, after a maximum of characters is added to the line.
@return a value
Returns the number of space-characters in this line.
@return a value
Returns the listsymbol of this line.
@return a PdfChunk
if the line has a listsymbol; null
otherwise
Return the indentation needed to show the listsymbol.
@return a value
Get the string representation of what is in this line.
@return a string
Checks if a newline caused the line split.
@return true
if a newline caused the line split
Gets the index of the last PdfChunk
with metric attributes
@return the last PdfChunk
with metric attributes
Gets a PdfChunk
by index.
@param idx the index
@return the PdfChunk
or null if beyond the array
Gets the original width of the line.
@return the original width of the line
Gets the difference between the "normal" leading and the maximum
size (for instance when there are images in the chunk and the leading
has to be taken into account).
@return an extra leading for images
@since 2.1.5
Gets the number of separators in the line.
Returns -1 if there's a tab in the line.
@return the number of separators in the line
@since 2.1.2
Gets the maximum size of the ascender for all the fonts used
in this line.
@return maximum size of all the ascenders used in this line
Gets the biggest descender for all the fonts used
in this line. Note that this is a negative number.
@return maximum size of all the ascenders used in this line
a Literal
A name
@since 2.1.6
A name
A name
A name
A name
@since 2.1.5 renamed from ABSOLUTECALORIMETRIC
A name
A name
A name
A name
@since 2.1.6
A name
@since 2.1.6
a name used in PDF structure
@since 2.1.6
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 5.4.5
A name
@since 5.0.3
A name
A name
A name
Use ALT to specify alternate texts in Tagged PDF.
For alternate ICC profiles, use {@link #ALTERNATE}
Use ALTERNATE only in ICC profiles. It specifies an alternative color
space, in case the primary one is not supported, for legacy purposes.
For various types of alternate texts in Tagged PDF, use {@link #ALT}
A name
@since 5.5.8
A name
@since 5.4.5
A name
@since 5.4.3
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
A name
@since 5.4.2
A name
A name
A name
A name
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 5.4.2
A name
A name
A name
A name
@since 2.1.6
A name
@since 5.3.5
A name
A name
A name
@since 2.1.6
A name
A name
A name
A name
@since 2.1.6
A name
A name
@since 2.1.6
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
A name
A name
A name
A name
@since 5.4.0
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 5.4.5
A name
@since 2.1.6
A name
A name
A name
@since 5.4.4
A name
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 2.0.7
A name
A name
A name
A name
@since 5.3.2
A name
@since 5.1.0
A name
@since 2.1.6
A name
A name
@since 2.1.6
A name
@since 5.3.4
A name
A name
A name
@since 5.4.4
A name
A name
A name
A name
A name
A name
A name
@since 5.4.0
A name
@since 5.4.0
A name
A name
@since 2.1.6
A name
@since 5.4.2
A name
@since 2.1.6
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name of a base 14 type 1 font
A name of a base 14 type 1 font
A name of a base 14 type 1 font
A name of a base 14 type 1 font
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
@since 2.1.6
A name of an attribute.
@since 5.1.0
A name
A name
A name
A name
A name of an attribute.
@since 5.1.0
A name
A name
@since 5.4.0
A name
@since 2.1.6
A name
A name
A name
@since 2.1.6
A name
@since 2.1.5 renamed from DEFAULTCRYPTFILER
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 5.2.1
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 5.2.1
A name
A name
A name
@since 5.1.3
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 2.1.3
A name
@since 2.1.3
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
A name
A name
@since 5.3.4
A name
@since 5.3.4
A name
A name
A name of an attribute.
@since 5.1.0
A name
@since 5.4.3
A name
A name
A name
@since 2.1.6
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
A name
@since 5.1.0
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
A name
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
A name
A name
A name of an attribute.
A name of an attribute.
A name of an attribute.
@since 5.1.0
A name of an attribute.
@since 5.1.0
A name of an attribute.
@since 5.1.0
A name of an attribute.
A name of an attribute.
A name
@since 5.4.5
A name of an attribute.
A name of an attribute.
A name of an attribute.
@since 5.1.0
A name of an attribute.
A name of an attribute.
A name of an attribute.
A name of an attribute.
A name of an attribute.
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 5.4.5
A name
@since 5.4.5
A name
@since 2.1.6
A name
@since 5.4.0
A name of an attribute.
A name
A name of a base 14 type 1 font
A name of a base 14 type 1 font
A name of a base 14 type 1 font
A name of a base 14 type 1 font
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
@since 5.4.5
A name
@since 5.4.5
A name
A name
@since 5.4.3
A name
A name
A name
A name
A name
A name
@since 5.5.3
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
A name
A name
@since 2.1.5
A name
@since 2.1.5
A name
A name
A name
@since 5.3.4
A name
A name
A name
A name
A name
A name
@since 5.1.4
An entry specifying the natural language, and optionally locale. Use this
to specify the Language attribute on a Tagged Pdf element.
For the content usage dictionary, use {@link #LANGUAGE}
A dictionary type, strictly for use in the content usage dictionary. For
dictionary entries in Tagged Pdf, use {@link #LANG}
A name
A name
A name
A name
A name
@since 5.5.0
A name
@since 2.1.6
A name
@since 2.1.6
A name
A name
A name
@since 2.1.6
A name
A name
A name
@since 2.1.6
A name
@since 5.3.5
A name
A name
@since 5.4.0
A name
A name
@since 5.4.0
A name
A name
A name
@since 2.1.2
A name
@since 5.4.0
A name
@since 5.4.0
A name of an attribute.
@since 5.1.0
A name
A name
A name
@since 5.2.1
A name
@since 2.1.6
A name
A name of an encoding
A name of an encoding
A name
A name
A name
A name
@since 2.1.6 renamed from MAX
A name
@since 2.1.6
A name
A name
A name
A name
A name
@since 5.1.0
A name
A name
@since 2.1.6 renamed from MIN
A name
@since 2.1.6
A name
A name
A name
A name
@since 5.4.3
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
A name.
@since 5.4.5
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 5.1.0
A name
A name
A name
A name used with Document Structure
@since 2.1.5
a name used with Document Structure
@since 2.1.5
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 5.4.3
A name
A name
A name
A name
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
@since 5.5.4
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name used in defining Document Structure.
@since 2.1.5
A name
@since 2.1.6
A name
@since 2.1.6
A name
A name
A name
@since 5.4.4
A name
@since 2.1.6
A name
A name
A name
@since 5.1.0
A name
A name
A name
A name
@since 2.1.6
A name
A name
@since 5.5.0
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 5.0.2
A name
@since 5.0.2
A name
A name
@since 2.1.6
A name
A name
A name
@since 2.1.6
A name
A name.
@since 5.4.5
A name
A name
A name
A name
A name
A name
@since 5.4.3
A name
@since 5.4.4
A name
A name
A name
A name
@since 2.1.6
A name
A name
A name of an attribute.
@since 5.1.0
A name
A name
A name
A name
@since 5.1.0
A name
A name
@since 2.1.6
A name
A name
A name
@since 2.1.6
A name
A name
A name
A name
@since 5.4.3
A name
@since 5.4.4
A name
A name
A name
@since 5.1.0
A name
A name
A name
A name
@since 5.4.4
A name
A name
A name
A name
@since 2.1.5 renamed from RELATIVECALORIMETRIC
A name
A name
@since 5.5.4
A name
A name
A name
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 5.1.0
A name
@since 5.4.4
A name
@since 5.4.4
A name
A name
A name
A name
@since 5.4.0
A name
A name
@since 5.4.0
A name
@since 5.4.3
A name
@since 5.1.0
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
@since 5.4.0
A name
A name
@since 2.1.6
A name
A name
A name
A name
@since 2.1.6
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 2.1.6
A name
@since 5.3.4
A name
@since 5.3.4
A name
A name
@since 2.1.6
A name
A name
A name
@since 2.1.3
A name
@since 5.1.0
A name
A name
A name
A name
@since 5.3.4
A name
@since 5.3.4
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name of a base 14 type 1 font
T is very commonly used for various dictionary entries, including title
entries in a Tagged PDF element dictionary, and target dictionaries.
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.5
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 5.3.5
A name
@since 5.4.3
A name
A name
@since 5.3.4
A name
@since 5.3.5
A name
@since 5.3.5
A name
@since 5.3.5
A name
@since 5.3.4
A name
@since 2.1.6
A name
@since 2.1.6
A name
@since 2.1.6
A name
A name
A name
A name
@since 2.1.6
A name
A name of a base 14 type 1 font
A name of a base 14 type 1 font
A name of a base 14 type 1 font
A name of a base 14 type 1 font
Use Title for the document's top level title (optional), and for document
outline dictionaries, which can store bookmarks.
For all other uses of a title entry, including Tagged PDF, use {@link #T}
A name
A name
A name
@since 2.1.6
A name
@since 2.1.6
A name
A name
@since 2.1.6
A name
A name
A name
@since 2.1.6
A name
A name
A name
A name
A name
@since 2.1.6
A name
@since 5.4.3
A name
A name
A name
A name
A name
@since 5.4.4
A name
A name
A name
A name
A name
A name
A name
A name
A name of an attribute.
A name of an attribute.
A name
A name of an attribute.
A name of an attribute.
A name of an attribute.
A name
@since 5.2.1
A name
@since 5.4.0
A name
@since 5.4.0
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
A name
@since 5.4.0
A name
A name
A name
@since 2.1.6
A name
A name
A name
@since 5.0.2
A name
@since 2.1.6
A name
A name
@since 2.1.6
A name
A name
A name
A name
@since 5.1.0
A name
A name
A name
@since 2.1.6
A name
@since 5.1.0
A name of an attribute.
A name of an attribute.
A name
@since 2.1.6
A name
@since 5.4.5
A name of an attribute.
A name of an attribute.
A name of an attribute.
A name
A name of an encoding
A name of an encoding
A name
@since 2.1.6
A name
@since 2.1.6
A name of an encoding
A name
A name of an attribute.
@since 5.1.0
A name
A name of an encoding
A name
@since 5.4.3
A name
A name
@since 2.1.6
A name
@since 2.1.6
A name
A name
A name
A name
@since 5.1.0
A name
A name
A name
A name
A name
A name
A name of a base 14 type 1 font
A name
map strings to all known static names
@since 2.1.6
Use reflection to cache all the static public readonly names so
future PdfName
additions don't have to be "added twice".
A bit less efficient (around 50ms spent here on a 2.2ghz machine),
but Much Less error prone.
@since 2.1.6
Constructs a new PdfName
. The name length will be checked.
@param name the new name
Constructs a new PdfName
.
@param name the new name
@param lengthCheck if true
check the lenght validity, if false
the name can
have any length
Indicates whether some other object is "equal to" this one.
@param obj the reference object with which to compare.
@return true
if this object is the same as the obj
argument; false
otherwise.
Returns a hash code value for the object. This method is
supported for the benefit of hashtables such as those provided by
java.util.Hashtable
.
@return a hash code value for this object.
Encodes a plain name given in the unescaped form "AB CD" into "/AB#20CD".
@param name the name to encode
@return the encoded name
@since 2.1.5
Decodes an escaped name in the form "/AB#20CD" into "AB CD".
@param name the name to decode
@return the decoded name
Creates a name tree.
@author Paulo Soares
Creates a name tree.
@param items the item of the name tree. The key is a String
and the value is a PdfObject
. Note that although the
keys are strings only the lower byte is used and no check is made for chars
with the same lower byte and different upper byte. This will generate a wrong
tree name.
@param writer the writer
@throws IOException on error
@return the dictionary with the name tree. This dictionary is the one
generally pointed to by the key /Dests, for example
This is an instance of the PdfNull
-object.
actual value of this PdfNumber
, represented as a double
Constructs a PdfNumber
-object.
@param content value of the new PdfNumber
-object
Constructs a new int PdfNumber
-object.
@param value value of the new PdfNumber
-object
Constructs a new long PdfNumber
-object.
@param value value of the new PdfNumber
-object
Constructs a new REAL PdfNumber
-object.
@param value value of the new PdfNumber
-object
Constructs a new REAL PdfNumber
-object.
@param value value of the new PdfNumber
-object
Returns the primitive int
value of this object.
@return a value
Returns the primitive long
value of this object.
@return a value
Returns the primitive double
value of this object.
@return a value
Increments the value of the PdfNumber
-object with 1.
Creates a number tree.
@author Paulo Soares
Creates a number tree.
@param items the item of the number tree. The key is an Integer
and the value is a PdfObject
.
@param writer the writer
@throws IOException on error
@return the dictionary with the number tree.
a possible type of PdfObject
a possible type of PdfObject
a possible type of PdfObject
a possible type of PdfObject
a possible type of PdfObject
a possible type of PdfObject
a possible type of PdfObject
a possible type of PdfObject
a possible type of PdfObject
This is an empty string used for the PdfNull
-object and for an empty PdfString
-object.
This is the default encoding to be used for converting strings into bytes and vice versa.
The default encoding is PdfDocEcoding.
This is the encoding to be used to output text in Unicode.
the content of this PdfObject
the type of this PdfObject
Holds value of property indRef.
Hash code of the PdfObject instance.
Unfortunately, default C# behavior does not generate unique hash code.
Used for generating hash code.
Making hash code generation thread safe.
Constructs a PdfObject
of a certain type without any content.
@param type type of the new PdfObject
Constructs a PdfObject
of a certain type with a certain content.
@param type type of the new PdfObject
@param content content of the new PdfObject
as a String
.
Constructs a PdfObject
of a certain type with a certain content.
@param type type of the new PdfObject
@param bytes content of the new PdfObject
as an array of byte
.
Writes the PDF representation of this PdfObject
as an array of byte
s to the writer.
@param writer for backwards compatibility
@param os the outputstream to write the bytes to.
@throws IOException
Gets the presentation of this object in a byte array
@return a byte array
Can this object be in an object stream?
@return true if this object can be in an object stream.
Returns the String
-representation of this PdfObject
.
@return a String
Returns the length of the actual content of the PdfObject
.
In some cases, namely for PdfString
and PdfStream
,
this method differs from the method pdfLength
because pdfLength
returns the length of the PDF representation of the object, not of the actual content
as does the method length
.
Remark: the actual content of an object is in some cases identical to its representation.
The following statement is always true: Length() >= PdfLength().
@return a length
Changes the content of this PdfObject
.
@param content the new content of this PdfObject
Returns the type of this PdfObject
.
@return a type
Checks if this PdfObject
is of the type PdfNull
.
@return true
or false
Checks if this PdfObject
is of the type PdfBoolean
.
@return true
or false
Checks if this PdfObject
is of the type PdfNumber
.
@return true
or false
Checks if this PdfObject
is of the type PdfString
.
@return true
or false
Checks if this PdfObject
is of the type PdfName
.
@return true
or false
Checks if this PdfObject
is of the type PdfArray
.
@return true
or false
Checks if this PdfObject
is of the type PdfDictionary
.
@return true
or false
Checks if this PdfObject
is of the type PdfStream
.
@return true
or false
Checks if this is an indirect object.
@return true if this is an indirect object
the PdfIndirectReference
of this object
value of the Count-key
value of the Parent-key
value of the Destination-key
The PdfAction
for this outline.
Holds value of property tag.
Holds value of property open.
Holds value of property color.
Holds value of property style.
Helper for the constructors.
@param parent the parent outline
@param title the title for this outline
@param open true
if the children are visible
Gets the indirect reference of this PdfOutline
.
@return the PdfIndirectReference
to this outline.
Gets the parent of this PdfOutline
.
@return the PdfOutline
that is the parent of this outline.
Set the page of the PdfDestination
-object.
@param pageReference indirect reference to the page
@return true
if this page was set as the PdfDestination
-page.
Gets the destination for this outline.
@return the destination
returns the level of this outline.
@return a level
Returns the PDF representation of this PdfOutline
.
@param writer the encryption information
@param os
@throws IOException
Getter for property tag.
@return Value of property tag.
Setter for property open.
@param open New value of property open.
value of the Rotate key for a page in PORTRAIT
value of the Rotate key for a page in LANDSCAPE
value of the Rotate key for a page in INVERTEDPORTRAIT
value of the Rotate key for a page in SEASCAPE
value of the MediaBox key
Constructs a PdfPage
.
@param mediaBox a value for the MediaBox key
@param resources an indirect reference to a PdfResources
-object
@param rotate a value for the Rotate key
@throws DocumentException
Constructs a PdfPage
.
@param mediaBox a value for the MediaBox key
@param resources an indirect reference to a PdfResources
-object
@throws DocumentException
Adds an indirect reference pointing to a PdfContents
-object.
@param contents an indirect reference to a PdfContents
-object
Rotates the mediabox, but not the text in it.
@return a PdfRectangle
Returns the MediaBox of this Page.
@return a PdfRectangle
Helps the use of PdfPageEvent
by implementing all the interface methods.
A class can extend PdfPageEventHelper
and only implement the
needed methods.
@author Paulo Soares
Called when the document is opened.
@param writer the PdfWriter
for this document
@param document the document
Called when a page is finished, just before being written to the document.
@param writer the PdfWriter
for this document
@param document the document
Page labels are used to identify each
page visually on the screen or in print.
@author Paulo Soares
Logical pages will have the form 1,2,3,...
Logical pages will have the form I,II,III,IV,...
Logical pages will have the form i,ii,iii,iv,...
Logical pages will have the form of uppercase letters
(A to Z for the first 26 pages, AA to ZZ for the next 26, and so on)
Logical pages will have the form of uppercase letters
(a to z for the first 26 pages, aa to zz for the next 26, and so on)
No logical page numbers are generated but fixed text may
still exist
Dictionary values to set the logical page styles
The sequence of logical pages. Will contain at least a value for page 1
Creates a new PdfPageLabel with a default logical page 1
Adds or replaces a page label.
@param page the real page to start the numbering. First page is 1
@param numberStyle the numbering style such as LOWERCASE_ROMAN_NUMERALS
@param text the text to prefix the number. Can be null
or empty
@param firstPage the first logical page number
Adds or replaces a page label.
@param page the real page to start the numbering. First page is 1
@param numberStyle the numbering style such as LOWERCASE_ROMAN_NUMERALS
@param text the text to prefix the number. Can be null
or empty
@param firstPage the first logical page number
@param includeFirstPage If true, the page label will be added to the first page if it is page 1.
If the first page is not page 1 or this value is false, the value will not be added to the dictionary.
Adds or replaces a page label. The first logical page has the default
of 1.
@param page the real page to start the numbering. First page is 1
@param numberStyle the numbering style such as LOWERCASE_ROMAN_NUMERALS
@param text the text to prefix the number. Can be null
or empty
Adds or replaces a page label. There is no text prefix and the first
logical page has the default of 1.
@param page the real page to start the numbering. First page is 1
@param numberStyle the numbering style such as LOWERCASE_ROMAN_NUMERALS
Adds or replaces a page label.
Removes a page label. The first page lagel can not be removed, only changed.
@param page the real page to remove
Gets the page label dictionary to insert into the document.
@return the page label dictionary
Retrieves the page labels from a PDF as an array of String objects.
@param reader a PdfReader object that has the page labels you want to retrieve
@return a String array or null
if no page labels are present
Retrieves the page labels from a PDF as an array of {@link PdfPageLabelFormat} objects.
@param reader a PdfReader object that has the page labels you want to retrieve
@return a PdfPageLabelEntry array, containing an entry for each format change
or null
if no page labels are present
Creates a page label format.
@param physicalPage the real page to start the numbering. First page is 1
@param numberStyle the numbering style such as LOWERCASE_ROMAN_NUMERALS
@param prefix the text to prefix the number. Can be null
or empty
@param logicalPage the first logical page number
Constructs a PdfPages
-object.
A PdfPattern
defines a ColorSpace
@see PdfStream
Creates a PdfPattern object.
@param painter a pattern painter instance
Creates a PdfPattern object.
@param painter a pattern painter instance
@param compressionLevel the compressionLevel for the stream
@since 2.1.3
Implements the pattern.
Creates a PdfPattern
.
Creates new PdfPattern
@param wr the PdfWriter
Gets the stream representing this pattern
@return the stream representing this pattern
Gets the stream representing this pattern
@param compressionLevel the compression level of the stream
@return the stream representing this pattern
@since 2.1.3
Gets a duplicate of this PdfPatternPainter
. All
the members are copied by reference but the buffer stays different.
@return a copy of this PdfPatternPainter
@see com.lowagie.text.pdf.PdfContentByte#setGrayFill(float)
@see com.lowagie.text.pdf.PdfContentByte#resetGrayFill()
@see com.lowagie.text.pdf.PdfContentByte#setGrayStroke(float)
@see com.lowagie.text.pdf.PdfContentByte#resetGrayStroke()
@see com.lowagie.text.pdf.PdfContentByte#setRGBColorFillF(float, float, float)
@see com.lowagie.text.pdf.PdfContentByte#resetRGBColorFill()
@see com.lowagie.text.pdf.PdfContentByte#setRGBColorStrokeF(float, float, float)
@see com.lowagie.text.pdf.PdfContentByte#resetRGBColorStroke()
@see com.lowagie.text.pdf.PdfContentByte#setCMYKColorFillF(float, float, float, float)
@see com.lowagie.text.pdf.PdfContentByte#resetCMYKColorFill()
@see com.lowagie.text.pdf.PdfContentByte#setCMYKColorStrokeF(float, float, float, float)
@see com.lowagie.text.pdf.PdfContentByte#resetCMYKColorStroke()
@see com.lowagie.text.pdf.PdfContentByte#addImage(com.lowagie.text.Image, float, float, float, float, float, float)
@see com.lowagie.text.pdf.PdfContentByte#setCMYKColorFill(int, int, int, int)
@see com.lowagie.text.pdf.PdfContentByte#setCMYKColorStroke(int, int, int, int)
@see com.lowagie.text.pdf.PdfContentByte#setRGBColorFill(int, int, int)
@see com.lowagie.text.pdf.PdfContentByte#setRGBColorStroke(int, int, int)
@see com.lowagie.text.pdf.PdfContentByte#setColorStroke(java.awt.Color)
@see com.lowagie.text.pdf.PdfContentByte#setColorFill(java.awt.Color)
@see com.lowagie.text.pdf.PdfContentByte#setColorFill(com.lowagie.text.pdf.PdfSpotColor, float)
@see com.lowagie.text.pdf.PdfContentByte#setColorStroke(com.lowagie.text.pdf.PdfSpotColor, float)
@see com.lowagie.text.pdf.PdfContentByte#setPatternFill(com.lowagie.text.pdf.PdfPatternPainter)
@see com.lowagie.text.pdf.PdfContentByte#setPatternFill(com.lowagie.text.pdf.PdfPatternPainter, java.awt.Color, float)
@see com.lowagie.text.pdf.PdfContentByte#setPatternStroke(com.lowagie.text.pdf.PdfPatternPainter, java.awt.Color, float)
@see com.lowagie.text.pdf.PdfContentByte#setPatternStroke(com.lowagie.text.pdf.PdfPatternPainter)
A cell in a PdfPTable.
Holds value of property verticalAlignment.
Holds value of property paddingLeft.
Holds value of property paddingLeft.
Holds value of property paddingTop.
Holds value of property paddingBottom.
Holds value of property fixedHeight.
Fixed height of the cell.
Holds value of property noWrap.
Holds value of property table.
Holds value of property minimumHeight.
This field is used to cache the height which is calculated on getMaxHeight() method call;
this helps to avoid unnecessary recalculations on table drawing.
Holds value of property colspan.
Holds value of property rowspan.
@since 2.1.6
Holds value of property image.
Holds value of property cellEvent.
Holds value of property useDescender.
Increases padding to include border if true
The text in the cell.
The rotation of the cell. Possible values are
0, 90, 180 and 270.
Constructs an empty PdfPCell
.
The default padding is 2.
Constructs a PdfPCell
with a Phrase
.
The default padding is 2.
@param phrase the text
Constructs a PdfPCell
with an Image
.
The default padding is 0.
@param image the Image
Constructs a PdfPCell
with an Image
.
The default padding is 0.25 for a border width of 0.5.
@param image the Image
@param fit true
to fit the image to the cell
Constructs a PdfPCell
with a PdfPtable
.
This constructor allows nested tables.
The default padding is 0.
@param table The PdfPTable
Constructs a PdfPCell
with a PdfPtable
.
This constructor allows nested tables.
@param table The PdfPTable
@param style The style to apply to the cell (you could use getDefaultCell())
@since 2.1.0
Constructs a deep copy of a PdfPCell
.
@param cell the PdfPCell
to duplicate
Adds an iText element to the cell.
@param element
Gets the Phrase
from this cell.
@return the Phrase
Gets the horizontal alignment for the cell.
@return the horizontal alignment for the cell
Gets the vertical alignment for the cell.
@return the vertical alignment for the cell
Gets the effective left padding. This will include
the left border width if {@link #UseBorderPadding} is true.
@return effective value of property paddingLeft.
@return Value of property paddingLeft.
Gets the effective right padding. This will include
the right border width if {@link #UseBorderPadding} is true.
@return effective value of property paddingRight.
Getter for property paddingRight.
@return Value of property paddingRight.
Gets the effective top padding. This will include
the top border width if {@link #isUseBorderPadding()} is true.
@return effective value of property paddingTop.
Getter for property paddingTop.
@return Value of property paddingTop.
/** Gets the effective bottom padding. This will include
* the bottom border width if {@link #UseBorderPadding} is true.
* @return effective value of property paddingBottom.
Getter for property paddingBottom.
@return Value of property paddingBottom.
Sets the padding of the contents in the cell (space between content and border).
@param padding
Adjusts effective padding to include border widths.
@param use adjust effective padding if true
Sets the leading fixed and variable. The resultant leading will be
fixedLeading+multipliedLeading*maxFontSize where maxFontSize is the
size of the bigest font in the line.
@param fixedLeading the fixed leading
@param multipliedLeading the variable leading
Gets the fixed leading
@return the leading
Gets the variable leading
@return the leading
Gets the first paragraph line indent.
@return the indent
Gets the extra space between paragraphs.
@return the extra space between paragraphs
Getter for property fixedHeight.
@return Value of property fixedHeight.
Tells you whether the cell has a fixed height.
@return true is a fixed height was set.
@since 2.1.5
Gets the height which was calculated on last call of getMaxHeight().
If cell's bBox and content wasn't changed this value is actual maxHeight of the cell.
@return max height which was calculated on last call of getMaxHeight(); if getMaxHeight() wasn't called the return value is 0
Setter for property noWrap.
@param noWrap New value of property noWrap.
Getter for property table.
@return Value of property table.
Getter for property minimumHeight.
@return Value of property minimumHeight.
Tells you whether the cell has a minimum height.
@return true if a minimum height was set.
@since 2.1.5
Getter for property colspan.
@return Value of property colspan.
Getter for property rowspan.
@return Value of property rowspan.
Gets the following paragraph lines indent.
@return the indent
Gets the right paragraph lines indent.
@return the indent
Gets the space/character extra spacing ratio for
fully justified text.
@return the space/character extra spacing ratio
Gets the run direction of the text content in the cell
@return One of the following values: PdfWriter.RUN_DIRECTION_DEFAULT, PdfWriter.RUN_DIRECTION_NO_BIDI, PdfWriter.RUN_DIRECTION_LTR or PdfWriter.RUN_DIRECTION_RTL.
Getter for property image.
@return Value of property image.
Gets the cell event for this cell.
@return the cell event
Gets the arabic shaping options.
@return the arabic shaping options
Gets state of first line height based on max ascender
@return true if an ascender is to be used.
Getter for property useDescender.
@return Value of property useDescender.
Gets the ColumnText with the content of the cell.
@return a columntext object
Returns the list of composite elements of the column.
@return a List object.
@since 2.1.1
Sets the rotation of the cell. Possible values are
0, 90, 180 and 270.
@param rotation the rotation of the cell
Returns the height of the cell.
@return the height of the cell
@since 3.0.0
this is a possible style.
this is a possible style.
this is a possible style.
this is a possible style.
A row in a PdfPTable.
@author Paulo Soares
True if the table may not break after this row.
the bottom limit (bottom right y)
the right limit
@since 2.1.5
extra heights that needs to be added to a cell because of rowspans.
@since 2.1.6
Constructs a new PdfPRow with the cells in the array that was passed
as a parameter.
@param cells
Makes a copy of an existing row.
@param row
Sets the widths of the columns in the row.
@param widths
@return true if everything went right
Initializes the extra heights array.
@since 2.1.6
Sets an extra height for a cell.
@param cell the index of the cell that needs an extra height
@param height the extra height
@since 2.1.6
Calculates the heights of each cell in the row.
@return the maximum height of the row.
Writes the border and background of one cell in the row.
@param xPos The x-coordinate where the table starts on the canvas
@param yPos The y-coordinate where the table starts on the canvas
@param currentMaxHeight The height of the cell to be drawn.
@param cell
@param canvases
@since 2.1.6 extra parameter currentMaxHeight
@since 2.1.6 private is now protected
@since 2.1.6 private is now protected
@since 3.0.0 protected is now public static
* Writes a number of cells (not necessarily all cells).
*
* @param colStart The first column to be written.
* Remember that the column index starts with 0.
* @param colEnd The last column to be written.
* Remember that the column index starts with 0.
* If -1, all the columns to the end are written.
* @param xPos The x-coordinate where the table starts on the canvas
* @param yPos The y-coordinate where the table starts on the canvas
* @param reusable if set to false, the content in the cells is "consumed";
* if true, you can reuse the cells, the row, the parent table as many times you want.
* @since 5.1.0 added the reusable parameter
Checks if the dimensions of the columns were calculated.
@return true if the dimensions of the columns were calculated
Gets the maximum height of the row (i.e. of the 'highest' cell).
@return the maximum height of the row
Copies the content of a specific row in a table to this row.
Don't do this if the rows have a different number of cells.
@param table the table from which you want to copy a row
@param idx the index of the row that needs to be copied
@since 5.1.0
Splits a row to newHeight.
The returned row is the remainder. It will return null if the newHeight
was so small that only an empty row would result.
@param new_height the new height
@return the remainder row or null if the newHeight was so small that only
an empty row would result
Split rowspan of cells with rowspan on next page by inserting copies with the remaining rowspan
and reducing the previous rowspan appropriately, i.e. if a cell with rowspan 7 gets split after 3 rows
of that rowspan have been laid out, its column on the next page should start with an empty cell
having the same attributes and rowspan 7 - 3 = 4.
@since iText 5.4.3
Returns the array of cells in the row.
Please be extremely careful with this method.
Use the cells as read only objects.
@return an array of cells
@since 2.1.1
Checks if a cell in the row has a rowspan greater than 1.
@since 5.1.0
Implements the PostScript XObject.
Creates a new instance of PdfPSXObject
Constructs a PSXObject
@param wr
Gets the stream representing this object.
@param compressionLevel the compressionLevel
@return the stream representing this template
@since 2.1.3 (replacing the method without param compressionLevel)
@throws IOException
Gets a duplicate of this PdfPSXObject
. All
the members are copied by reference but the buffer stays different.
@return a copy of this PdfPSXObject
This is a table that can be put at an absolute position but can also
be added to the document as the class Table
.
In the last case when crossing pages the table always break at full rows; if a
row is bigger than the page it is dropped silently to avoid infinite loops.
A PdfPTableEvent can be associated to the table to do custom drawing
when the table is rendered.
@author Paulo Soares
The index of the original PdfcontentByte
.
The index of the duplicate PdfContentByte
where the background will be drawn.
The index of the duplicate PdfContentByte
where the border lines will be drawn.
The index of the duplicate PdfContentByte
where the text will be drawn.
The current column index.
@since 5.1.0 renamed from currentColIdx
Holds value of property headerRows.
Holds value of property widthPercentage.
Holds value of property horizontalAlignment.
Holds value of property skipFirstHeader.
Holds value of property skipLastFooter.
@since 2.1.6
Holds value of property lockedWidth.
Holds value of property splitRows.
The spacing before the table.
The spacing after the table.
Holds value of property extendLastRow.
Holds value of property headersInEvent.
Holds value of property splitLate.
Defines if the table should be kept
on one page if possible
Indicates if the PdfPTable is complete once added to the document.
@since iText 2.0.8
Keeps track of the completeness of the current row.
@since 2.1.6
Constructs a PdfPTable
with the relative column widths.
@param relativeWidths the relative column widths
Constructs a PdfPTable
with numColumns
columns.
@param numColumns the number of columns
Constructs a copy of a PdfPTable
.
@param table the PdfPTable
to be copied
Makes a shallow copy of a table (format without content).
@param table
@return a shallow copy of the table
Copies the format of the sourceTable without copying the content.
@param sourceTable
@since 2.1.6 private is now protected
Sets the relative widths of the table.
@param relativeWidths the relative widths of the table.
@throws DocumentException if the number of widths is different than the number
of columns
Sets the relative widths of the table.
@param relativeWidths the relative widths of the table.
@throws DocumentException if the number of widths is different than the number
of columns
@since 2.1.6 private is now protected
Sets the full width of the table from the absolute column width.
@param columnWidth the absolute width of each column
@throws DocumentException if the number of widths is different than the number
of columns
Sets the percentage width of the table from the absolute column width. Warning: Don't use this with setLockedWidth(true). These two settings don't mix.
@param columnWidth the absolute width of each column
@param pageSize the page size
@throws DocumentException
Gets the full width of the table.
@return the full width of the table
Calculates the heights of the table.
@return the total height of the table. Note that it will be 0 if you didn't
specify the width of the table with SetTotalWidth().
and made it public
Changes the number of columns. Any existing rows will be deleted.
@param the new number of columns
Gets the default PdfPCell
that will be used as
reference for all the addCell
methods except
addCell(PdfPCell)
.
@return default PdfPCell
Adds a cell element.
@param cell the cell element
When updating the row index, cells with rowspan should be taken into account.
This is what happens in this method.
@since 2.1.6
Added by timmo3. This will return the correct cell taking it's cellspan into account
@param row the row index
@param col the column index
@return PdfPCell at the given row and position or null otherwise
Checks if there are rows above belonging to a rowspan.
@param currRow the current row to check
@param currCol the current column to check
@return true if there's a cell above that belongs to a rowspan
@since 2.1.6
Adds a cell element.
@param text the text for the cell
Adds a nested table.
@param table the table to be added to the cell
Adds an Image as Cell.
@param image the Image
to add to the table.
This image will fit in the cell
Adds a cell element.
@param phrase the Phrase
to be added to the cell
Writes the selected rows and columns to the document.
This method does not clip the columns; this is only important
if there are columns with colspan at boundaries.
canvases
is obtained from beginWritingRows()
.
The table event is only fired for complete rows.
@param colStart the first column to be written, zero index
@param colEnd the last column to be written + 1. If it is -1 all the
columns to the end are written
@param rowStart the first row to be written, zero index
@param rowEnd the last row to be written + 1. If it is -1 all the
rows to the end are written
@param xPos the x write coordinate
@param yPos the y write coordinate
@param canvases an array of 4 PdfContentByte
obtained from
beginWritingRows()
@param reusable if set to false, the content in the cells is "consumed";
if true, you can reuse the cells, the row, the parent table as many times you want.
@return the y coordinate position of the bottom of the last row
@see #beginWritingRows(com.itextpdf.text.pdf.PdfContentByte)
@since 5.1.0 added the reusable parameter
Writes the selected rows to the document.
@param rowStart the first row to be written, zero index
@param rowEnd the last row to be written + 1. If it is -1 all the
rows to the end are written
@param xPos the x write coodinate
@param yPos the y write coodinate
@param canvas the PdfContentByte
where the rows will
be written to
@return the y coordinate position of the bottom of the last row
Writes the selected rows and columns to the document.
This method clips the columns; this is only important
if there are columns with colspan at boundaries.
The table event is only fired for complete rows.
@param colStart the first column to be written, zero index
@param colEnd the last column to be written + 1. If it is -1 all the
columns to the end are written
@param rowStart the first row to be written, zero index
@param rowEnd the last row to be written + 1. If it is -1 all the
rows to the end are written
@param xPos the x write coordinate
@param yPos the y write coordinate
@param canvas the PdfContentByte
where the rows will
be written to
@return the y coordinate position of the bottom of the last row
@param reusable if set to false, the content in the cells is "consumed";
if true, you can reuse the cells, the row, the parent table as many times you want.
@since 5.1.0 added the reusable parameter
Finishes writing the table.
@param canvases the array returned by beginWritingRows()
Gets the number of rows in this table.
@return the number of rows in this table
Gets the total height of the table.
@return the total height of the table
Gets the height of a particular row.
@param idx the row index (starts at 0)
@return the height of a particular row
Gets the height of a particular row.
@param idx the row index (starts at 0)
@param firsttime is this the first time the row heigh is calculated?
@return the height of a particular row
@since 5.0.0
Gets the maximum height of a cell in a particular row (will only be different
from getRowHeight is one of the cells in the row has a rowspan > 1).
@param rowIndex the row index
@param cellIndex the cell index
@return the height of a particular row including rowspan
@since 2.1.6
Checks if a cell in a row has a rowspan greater than 1.
@since 5.1.0
Makes sure the footers value is lower than the headers value.
@since 5.0.1
Gets the height of the rows that constitute the header as defined by
setHeaderRows()
.
@return the height of the rows that constitute the header and footer
Gets the height of the rows that constitute the header as defined by
setFooterRows()
.
@return the height of the rows that constitute the footer
@since 2.1.1
Deletes a row from the table.
@param rowNumber the row to be deleted
@return true
if the row was deleted
Deletes the last row in the table.
@return true
if the last row was deleted
Removes all of the rows except headers
Returns the number of columns.
@return the number of columns.
@since 2.1.1
Gets all the chunks in this element.
@return an List
Gets the type of the text element.
@return a type
@since iText 2.0.8
@see com.lowagie.text.Element#isContent()
@since iText 2.0.8
@see com.lowagie.text.Element#isNestable()
Processes the element by adding it (or the different parts) to an
ElementListener
.
@param listener an ElementListener
@return true
if the element was processed successfully
Gets a row with a given index.
@param idx
@return the row at position idx
Returns the index of the last completed row.
@return the index of a row
Defines where the table may be broken (if necessary).
@param breakPoints int[]
@throws System.IndexOutOfRangeException if a row index is passed that is out of bounds
Defines which rows should not allow a page break (if possible).
@param rows int[]
@throws System.IndexOutOfRangeException if a row index is passed that is out of bounds
Defines a range of rows that should not allow a page break (if possible).
@param start int
@param end int
@throws System.IndexOutOfRangeException if a row index is passed that is out of bounds
Defines a range of rows (from the parameter to the last row) that should not allow a page break (if possible).
The equivalent of calling {@link #keepRowsTogether(int,int) keepRowsTogether(start, rows.size()}.
@param start int
@throws System.IndexOutOfRangeException if a row index is passed that is out of bounds
Gets an arraylist with all the rows in the table.
@return an arraylist
Gets an arraylist with a selection of rows.
@param start the first row in the selection
@param end the first row that isn't part of the selection
@return a selection of rows
@since 2.1.6
Calculates the extra height needed in a row because of rowspans.
@param start the index of the start row (the one to adjust)
@param end the index of the end row on the page
@since 2.1.6
Sets the table event for this table.
@param event the table event for this table
Gets the absolute sizes of each column width.
@return he absolute sizes of each column width
Tells you if the last footer needs to be skipped
(for instance if the footer says "continued on the next page")
@return Value of property skipLastFooter.
@since 2.1.6
When set the last row on every page will be extended to fill
all the remaining space to the bottom boundary; except maybe the
row.
@param extendLastRows true to extend the last row on each page; false otherwise
@param extendFinalRow false if you don't want to extend the row of the complete table
@since iText 5.0.0
* Gets the value of the last row extension, taking into account
* if the row is reached or not.
*
* @return true if the last row will extend;
* false otherwise
* @since iText 5.0.0
If true the table will be kept on one page if it fits, by forcing a
new page if it doesn't fit on the current page. The default is to
split the table over multiple pages.
@param p_KeepTogether whether to try to keep the table on one page
Completes the current row with the default cell. An incomplete row will be dropped
but calling this method will make sure that it will be present in the table.
@since iText 2.0.8
@see com.lowagie.text.LargeElement#flushContent()
@since iText 2.0.8
@see com.lowagie.text.LargeElement#isComplete()
Gets row index where cell overlapping (rowIdx, colIdx) starts
@param rowIdx
@param colIdx
@return row index
@since iText 5.4.3
@since iText 5.4.3
Correct chosen last fitting row so that the content of all cells with open rowspans will fit on the page,
i.e. the cell content won't be split.
(Only to be used with splitLate == true)
@since iText 5.4.3
Determine which rows fit on the page, respecting isSplitLate().
Note: sets max heights of the inspected rows as a side effect,
just like PdfPTable.getRowHeight(int, boolean) does.
Respect row.getMaxHeights() if it has been previously set (which might be independent of the height of
individual cells).
The last row written on the page will be chosen by the caller who might choose not
the calculated one but an earlier one (due to mayNotBreak settings on the rows).
The height of the chosen last row has to be corrected if splitLate == true
by calling FittingRows.correctLastRowChosen() by the caller to avoid splitting the content of
cells with open rowspans.
@since iText 5.4.3
@author Aiken Sam (aikensam@ieee.org)
Reads a PDF document.
@author Paulo Soares
@author Kazuya Ujihara
The iText developers are not responsible if you decide to change the
value of this static parameter.
@since 5.0.2
Handler which will be used for decompression of pdf streams.
Holds value of property appendable.
Constructs a new PdfReader. This is the master constructor.
@param byteSource source of bytes for the reader
@param partialRead if true, the reader is opened in partial mode (PDF is parsed on demand), if false, the entire PDF is parsed into memory as the reader opens
@param ownerPassword the password or null if no password is required
@param certificate the certificate or null if no certificate is required
@param certificateKey the key or null if no certificate key is required
@param certificateKeyProvider the name of the key provider, or null if no key is required
@param closeSourceOnConstructorError if true, the byteSource will be closed if there is an error during construction of this reader
Constructs a new PdfReader. This is the master constructor.
@param byteSource source of bytes for the reader
@param properties the properties which will be used to create the reader
Reads and parses a PDF document.
@param filename the file name of the document
@throws IOException on error
Reads and parses a PDF document.
@param filename the file name of the document
@param properties the properties which will be used to create the reader
@throws IOException on error
Reads and parses a PDF document.
@param filename the file name of the document
@param ownerPassword the password to read the document
@throws IOException on error
Reads and parses a PDF document.
@param filename the file name of the document
@param ownerPassword the password to read the document
@throws IOException on error
Reads and parses a PDF document.
@param pdfIn the byte array with the document
@throws IOException on error
Reads and parses a PDF document.
@param pdfIn the byte array with the document
@param ownerPassword the password to read the document
@throws IOException on error
Reads and parses a PDF document.
@param filename the file name of the document
@param certificate the certificate to read the document
@param certificateKey the private key of the certificate
@param certificateKeyProvider the security provider for certificateKey
@throws IOException on error
Reads and parses a PDF document.
@param url the Uri of the document
@throws IOException on error
Reads and parses a PDF document.
@param url the Uri of the document
@param ownerPassword the password to read the document
@throws IOException on error
Reads and parses a PDF document.
@param is the InputStream
containing the document. The stream is read to the
end but is not closed
@param ownerPassword the password to read the document
@throws IOException on error
Reads and parses a PDF document.
@param properties the properties which will be used to create the reader
@param isp the InputStream
containing the document. The stream is read to the
end but is not closed
@throws IOException on error
Reads and parses a PDF document.
@param isp the InputStream
containing the document. The stream is read to the
end but is not closed
@throws IOException on error
Reads and parses a pdf document. Contrary to the other constructors only the xref is read
into memory. The reader is said to be working in "partial" mode as only parts of the pdf
are read as needed.
@param raf the document location
@param ownerPassword the password or null
for no password
@throws IOException on error
Reads and parses a pdf document.
@param raf the document location
@param ownerPassword the password or null
for no password
@param partial indicates if the reader needs to read the document only partially. See {@link PdfReader#PdfReader(RandomAccessFileOrArray, byte[])}
@throws IOException on error
Creates an independent duplicate.
@param reader the PdfReader
to duplicate
Utility method that checks the provided byte source to see if it has junk bytes at the beginning. If junk bytes
are found, construct a tokeniser that ignores the junk. Otherwise, construct a tokeniser for the byte source as it is
@param byteSource the source to check
@return a tokeniser that is guaranteed to start at the PDF header
@throws IOException if there is a problem reading the byte source
Gets a new file instance of the original PDF
document.
@return a new file instance of the original PDF document
Gets the number of pages in the document.
@return the number of pages in the document
Returns the document's catalog. This dictionary is not a copy,
any changes will be reflected in the catalog.
@return the document's catalog
Returns the document's acroform, if it has one.
@return the document's acroform
Gets the page rotation. This value can be 0, 90, 180 or 270.
@param index the page number. The first page is 1
@return the page rotation
Gets the page size, taking rotation into account. This
is a Rectangle
with the value of the /MediaBox and the /Rotate key.
@param index the page number. The first page is 1
@return a Rectangle
Gets the rotated page from a page dictionary.
@param page the page dictionary
@return the rotated page
Gets the page size without taking rotation into account. This
is the value of the /MediaBox key.
@param index the page number. The first page is 1
@return the page size
Gets the page from a page dictionary
@param page the page dictionary
@return the page
Gets the crop box without taking rotation into account. This
is the value of the /CropBox key. The crop box is the part
of the document to be displayed or printed. It usually is the same
as the media box but may be smaller. If the page doesn't have a crop
box the page size will be returned.
@param index the page number. The first page is 1
@return the crop box
Gets the box size. Allowed names are: "crop", "trim", "art", "bleed" and "media".
@param index the page number. The first page is 1
@param boxName the box name
@return the box rectangle or null
Returns the content of the document information dictionary as a Hashtable
of String
.
@return content of the document information dictionary
Normalizes a Rectangle
so that llx and lly are smaller than urx and ury.
@param box the original rectangle
@return a normalized Rectangle
Checks if the PDF is a tagged PDF.
Parses the entire PDF
@throws IOException
@param obj
@return a PdfObject
Reads a PdfObject
resolving an indirect reference
if needed.
@param obj the PdfObject
to read
@return the resolved PdfObject
Reads a PdfObject
resolving an indirect reference
if needed. If the reader was opened in partial mode the object will be released
to save memory.
@param obj the PdfObject
to read
@param parent
@return a PdfObject
@param obj
@param parent
@return a PdfObject
@param idx
@return a PdfObject
@param idx
@return aPdfObject
@param obj
@param obj
@return an indirect reference
@return the percentage of the cross reference table that has been read
Eliminates the reference to the object freeing the memory used by it and clearing
the xref entry.
@param obj the object. If it's an indirect reference it will be eliminated
@return the object or the already erased dereferenced object
Decodes a stream that has the FlateDecode filter.
@param in the input data
@return the decoded data
Decodes a stream that has the FlateDecode filter.
@param in the input data
@return the decoded data
@param in
@param dicPar
@return a byte array
A helper to FlateDecode.
@param in the input data
@param strict true
to read a correct stream. false
to try to read a corrupted stream
@return the decoded data
A helper to FlateDecode.
@param in the input data
@param strict true
to read a correct stream. false
to try to read a corrupted stream
@return the decoded data
Decodes a stream that has the ASCIIHexDecode filter.
* @param in the input data
* @return the decoded data
Decodes a stream that has the ASCIIHexDecode filter.
@param in the input data
@return the decoded data
Decodes a stream that has the ASCII85Decode filter.
@param in the input data
@return the decoded data
Decodes a stream that has the ASCII85Decode filter.
@param in the input data
@return the decoded data
Decodes a stream that has the LZWDecode filter.
* @param in the input data
* @return the decoded data
Decodes a stream that has the LZWDecode filter.
@param in the input data
@return the decoded data
Checks if the document had errors and was rebuilt.
@return true if rebuilt.
Gets the dictionary that represents a page.
@param pageNum the page number. 1 is the first
@return the page dictionary
@param pageNum
@return a Dictionary object
@param pageNum
Gets the page reference to this page.
@param pageNum the page number. 1 is the first
@return the page reference
Gets the contents of the page.
@param pageNum the page number. 1 is the first
@param file the location of the PDF document
@throws IOException on error
@return the content
Gets the content from the page dictionary.
@param page the page dictionary
@throws IOException on error
@return the content
@since 5.0.6
Retrieve the given page's resource dictionary
@param pageNum 1-based page number from which to retrieve the resource dictionary
@return The page's resources, or 'null' if the page has none.
@since 5.1
Retrieve the given page's resource dictionary
@param pageDict the given page
@return The page's resources, or 'null' if the page has none.
@since 5.1
Gets the contents of the page.
@param pageNum the page number. 1 is the first
@throws IOException on error
@return the content
Sets the contents of the page.
@param content the new page content
@param pageNum the page number. 1 is the first
@throws IOException on error
Sets the contents of the page.
@param content the new page content
@param pageNum the page number. 1 is the first
@since 2.1.3 (the method already existed without param compressionLevel)
Decode a byte[] applying the filters specified in the provided dictionary using default filter handlers.
@param b the bytes to decode
@param streamDictionary the dictionary that contains filter information
@return the decoded bytes
@throws IOException if there are any problems decoding the bytes
@since 5.0.4
Decode a byte[] applying the filters specified in the provided dictionary using the provided filter handlers.
@param b the bytes to decode
@param streamDictionary the dictionary that contains filter information
@param filterHandlers the map used to look up a handler for each type of filter
@return the decoded bytes
@throws IOException if there are any problems decoding the bytes
@since 5.0.4
Get the content from a stream applying the required filters.
@param stream the stream
@param file the location where the stream is
@throws IOException on error
@return the stream content
Get the content from a stream applying the required filters.
@param stream the stream
@throws IOException on error
@return the stream content
Get the content from a stream as it is without applying any filter.
@param stream the stream
@param file the location where the stream is
@throws IOException on error
@return the stream content
Get the content from a stream as it is without applying any filter.
@param stream the stream
@throws IOException on error
@return the stream content
Eliminates shared streams if they exist.
Sets the tampered state. A tampered PdfReader cannot be reused in PdfStamper.
@param tampered the tampered state
Gets the XML metadata.
@throws IOException on error
@return the XML metadata
Gets the byte address of the last xref table.
@return the byte address of the last xref table
Gets the number of xref objects.
@return the number of xref objects
Gets the byte address of the %%EOF marker.
@return the byte address of the %%EOF marker
Gets the PDF version. Only the last version char is returned. For example
version 1.4 is returned as '4'.
@return the PDF version
Returns true
if the PDF is encrypted.
@return true
if the PDF is encrypted
Gets the encryption permissions. It can be used directly in
PdfWriter.SetEncryption()
.
@return the encryption permissions
Returns true
if the PDF has a 128 bit key encryption.
@return true
if the PDF has a 128 bit key encryption
Gets the trailer dictionary
@return the trailer dictionary
Finds all the font subsets and changes the prefixes to some
random values.
@return the number of font subsets altered
Finds all the fonts not subset but embedded and marks them as subset.
@return the number of fonts altered
Gets all the named destinations as an Hashtable
. The key is the name
and the value is the destinations array.
@return gets all the named destinations
Gets all the named destinations as an HashMap
. The key is the name
and the value is the destinations array.
@param keepNames true if you want the keys to be real PdfNames instead of Strings
@return gets all the named destinations
@since 2.1.6
Gets the named destinations from the /Dests key in the catalog as an Hashtable
. The key is the name
and the value is the destinations array.
@return gets the named destinations
Gets the named destinations from the /Dests key in the catalog as an HashMap
. The key is the name
and the value is the destinations array.
@param keepNames true if you want the keys to be real PdfNames instead of Strings
@return gets the named destinations
@since 2.1.6
Gets the named destinations from the /Names key in the catalog as an Hashtable
. The key is the name
and the value is the destinations array.
@return gets the named destinations
Removes all the fields from the document.
Removes all the annotations and fields from the document.
Replaces remote named links with local destinations that have the same name.
@since 5.0
Converts a remote named destination GoToR with a local named destination
if there's a corresponding name.
@param obj an annotation that needs to be screened for links to external named destinations.
@param names a map with names of local named destinations
@since iText 5.0
Replaces all the local named links with the actual destinations.
Closes the reader, and any underlying stream or data source used to create the reader
Removes all the unreachable objects.
@return the number of indirect objects removed
Gets a read-only version of AcroFields
.
@return a read-only version of AcroFields
Gets the global document JavaScript.
@param file the document file
@throws IOException on error
@return the global document JavaScript
Gets the global document JavaScript.
@throws IOException on error
@return the global document JavaScript
Selects the pages to keep in the document. The pages are described as
ranges. The page ordering can be changed but
no page repetitions are allowed. Note that it may be very slow in partial mode.
@param ranges the comma separated ranges as described in {@link SequenceList}
Selects the pages to keep in the document. The pages are described as a
List
of Integer
. The page ordering can be changed but
no page repetitions are allowed. Note that it may be very slow in partial mode.
@param pagesToKeep the pages to keep in the document
Selects the pages to keep in the document. The pages are described as a
List
of Integer
. The page ordering can be changed but
no page repetitions are allowed. Note that it may be very slow in partial mode.
@param pagesToKeep the pages to keep in the document
@param removeUnused indicate if to remove unsed objects. @see removeUnusedObjects
Sets the viewer preferences as the sum of several constants.
@param preferences the viewer preferences
@see PdfViewerPreferences#setViewerPreferences
Adds a viewer preference
@param key a key for a viewer preference
@param value a value for the viewer preference
@see PdfViewerPreferences#addViewerPreference
Returns a bitset representing the PageMode and PageLayout viewer preferences.
Doesn't return any information about the ViewerPreferences dictionary.
@return an int that contains the Viewer Preferences.
Getter for property newXrefType.
@return Value of property newXrefType.
Getter for property fileLength.
@return Value of property fileLength.
Getter for property hybridXref.
@return Value of property hybridXref.
Keeps track of all pages nodes to avoid circular references.
Gets the dictionary that represents a page.
@param pageNum the page number. 1 is the first
@return the page dictionary
@param pageNum
@return a dictionary object
@param pageNum
@return an indirect reference
Gets the page reference to this page.
@param pageNum the page number. 1 is the first
@return the page reference
@param pageNum
Checks if this PDF has usage rights enabled.
@return true
if usage rights are present; false
otherwise
Removes any usage rights that this PDF may have. Only Adobe can grant usage rights
and any PDF modification with iText will invalidate them. Invalidated usage rights may
confuse Acrobat and it's advisabe to remove them altogether.
Gets the certification level for this document. The return values can be PdfSignatureAppearance.NOT_CERTIFIED
,
PdfSignatureAppearance.CERTIFIED_NO_CHANGES_ALLOWED
,
PdfSignatureAppearance.CERTIFIED_FORM_FILLING
and
PdfSignatureAppearance.CERTIFIED_FORM_FILLING_AND_ANNOTATIONS
.
No signature validation is made, use the methods availabe for that in AcroFields
.
@return gets the certification level for this document
Checks if the document was opened with the owner password so that the end application
can decide what level of access restrictions to apply. If the document is not encrypted
it will return true
.
@return true
if the document was opened with the owner password or if it's not encrypted,
false
if the document was opened with the user password
Computes user password if standard encryption handler is used with Standard40, Standard128 or AES128 encryption algorithm.
@return user password, or null if not a standard encryption handler was used,
if standard encryption handler was used with AES256 encryption algorithm,
or if ownerPasswordUsed wasn't use to open the document.
Instance of PdfReader in each output document.
@author Paulo Soares
Gets the content stream of a page as a PdfStream object.
@param pageNumber the page of which you want the stream
@param compressionLevel the compression level you want to apply to the stream
@return a PdfStream object
@since 2.1.3 (the method already existed without param compressionLevel)
lower left x
lower left y
upper right x
upper right y
Constructs a PdfRectangle
-object.
@param llx lower left x
@param lly lower left y
@param urx upper right x
@param ury upper right y
@since rugPdf0.10
Constructs a PdfRectangle
-object starting from the origin (0, 0).
@param urx upper right x
@param ury upper right y
Constructs a PdfRectangle
-object with a Rectangle
-object.
@param rectangle a Rectangle
Returns the high level version of this PdfRectangle
@return this PdfRectangle translated to class Rectangle
Overrides the add
-method in PdfArray
in order to prevent the adding of extra object to the array.
@param object PdfObject
to add (will not be added here)
@return false
Block changes to the underlying PdfArray
@param values stuff we'll ignore. Ha!
@return false. You can't add anything to a PdfRectangle
@since 2.1.5
Block changes to the underlying PdfArray
@param values stuff we'll ignore. Ha!
@return false. You can't add anything to a PdfRectangle
@since 2.1.5
Block changes to the underlying PdfArray
@param object Ignored.
@since 2.1.5
Returns the lower left x-coordinate.
@return the lower left x-coordinaat
Returns the upper right x-coordinate.
@return the upper right x-coordinate
Returns the upper right y-coordinate.
@return the upper right y-coordinate
Returns the lower left y-coordinate.
@return the lower left y-coordinate
Returns the lower left x-coordinate, considering a given margin.
@param margin a margin
@return the lower left x-coordinate
Returns the upper right x-coordinate, considering a given margin.
@param margin a margin
@return the upper right x-coordinate
Returns the upper right y-coordinate, considering a given margin.
@param margin a margin
@return the upper right y-coordinate
Returns the lower left y-coordinate, considering a given margin.
@param margin a margin
@return the lower left y-coordinate
Returns the width of the rectangle.
@return a width
Returns the height of the rectangle.
@return a height
Swaps the values of urx and ury and of lly and llx in order to rotate the rectangle.
@return a PdfRectangle
A Rendition dictionary (pdf spec 1.5)
Constructs a PDF ResourcesDictionary.
Implements the shading dictionary (or stream).
@author Paulo Soares
Holds value of property bBox.
Holds value of property antiAlias.
Creates new PdfShading
Implements the shading pattern dictionary.
@author Paulo Soares
Creates new PdfShadingPattern
Implements the signature dictionary.
@author Paulo Soares
Creates new PdfSignature
Sets the signature creator name in the
{@link PdfSignatureBuildProperties} dictionary.
@param name
Gets the {@link PdfSignatureBuildProperties} instance if it exists, if
not it adds a new one and returns this.
@return {@link PdfSignatureBuildProperties}
Class that takes care of the cryptographic options
and appearances that form a signature.
Constructs a PdfSignatureAppearance object.
@param writer the writer to which the signature will be written.
Approval signature
Author signature, no changes allowed
Author signature, form filling allowed
Author signature, form filling and annotations allowed
The certification level
Sets the document type to certified instead of simply signed.
@param certificationLevel the values can be: NOT_CERTIFIED
, CERTIFIED_NO_CHANGES_ALLOWED
,
CERTIFIED_FORM_FILLING
and CERTIFIED_FORM_FILLING_AND_ANNOTATIONS
The caption for the reason for signing.
The caption for the location of signing.
The reason for signing.
Holds value of property location.
Holds value of property signDate.
Gets and setsthe signing reason.
@return the signing reason
Sets the caption for signing reason.
@param reasonCaption the signing reason caption
Gets and sets the signing location.
@return the signing location
Sets the caption for the signing location.
@param locationCaption the signing location caption
Holds value of the application that creates the signature
Gets the signature creator.
@return the signature creator
Sets the name of the application used to create the signature.
@param signatureCreator the name of the signature creating application
The contact name of the signer.
Gets the signing contact.
@return the signing contact
Gets the signature date.
@return the signature date
The file right before the signature is added (can be null).
The bytes of the file right before the signature is added (if raf is null)
Array containing the byte positions of the bytes that need to be hashed.
@return the underlying source
@throws IOException
The signing certificate
Adds the appropriate developer extension.
The crypto dictionary
Gets the user made signature dictionary. This is the dictionary at the /V key.
@return the user made signature dictionary
Sets the certificate used to provide the text in the appearance.
This certificate doesn't take part in the actual signing process.
@param signCertificate the certificate
An interface to retrieve the signature dictionary for modification.
Allows modification of the signature dictionary.
@param sig the signature dictionary
Holds value of property signatureEvent.
Sets the signature event to allow modification of the signature dictionary.
@param signatureEvent the signature event
The name of the field
Gets the field name.
@return the field name
Gets a new signature field name that
doesn't clash with any existing name.
@return a new signature field name
The page where the signature will appear.
Gets the page number of the field.
@return the page number of the field
The coordinates of the rectangle for a visible signature,
or a zero-width, zero-height rectangle for an invisible signature.
Gets the rectangle representing the signature dimensions.
@return the rectangle representing the signature dimensions. It may be null
or have zero width or height for invisible signatures
rectangle that represent the position and dimension of the signature in the page.
Gets the rectangle that represent the position and dimension of the signature in the page.
@return the rectangle that represent the position and dimension of the signature in the page
Gets the visibility status of the signature.
@return the visibility status of the signature
Sets the signature to be visible. It creates a new visible signature field.
@param pageRect the position and dimension of the field in the page
@param page the page to place the field. The fist page is 1
@param fieldName the field name or null
to generate automatically a new field name
Sets the signature to be visible. An empty signature field with the same name must already exist.
@param fieldName the existing empty signature field name
Signature rendering modes
@since 5.0.1
The rendering mode is just the description.
The rendering mode is the name of the signer and the description.
The rendering mode is an image and the description.
The rendering mode is just an image.
The rendering mode chosen for visible signatures
Gets the rendering mode for this signature.
@return the rendering mode for this signature
@since 5.0.1
The image that needs to be used for a visible signature
Sets the Image object to render when Render is set to RenderingMode.GRAPHIC
or RenderingMode.GRAPHIC_AND_DESCRIPTION
.
@param signatureGraphic image rendered. If null
the mode is defaulted
to RenderingMode.DESCRIPTION
Appearance compliant with the recommendations introduced in Acrobat 6?
Acrobat 6.0 and higher recommends that only layer n0 and n2 be present.
Use this method with value false
if you want to ignore this recommendation.
@param acro6Layers if true
only the layers n0 and n2 will be present
@deprecated Adobe no longer supports Adobe Acrobat / Reader versions older than 9
Layers for a visible signature.
Indicates if we need to reuse the existing appearance as layer 0.
Indicates that the existing appearances needs to be reused as layer 0.
An appearance that can be used for layer 1 (if acro6Layers is false).
A background image for the text in layer 2.
Gets the background image for the layer 2.
@return the background image for the layer 2
the scaling to be applied to the background image.t
Sets the scaling to be applied to the background image. If it's zero the image
will fully fill the rectangle. If it's less than zero the image will fill the rectangle but
will keep the proportions. If it's greater than zero that scaling will be applied.
In any of the cases the image will always be centered. It's zero by default.
@param imageScale the scaling to be applied to the background image
The text that goes in Layer 2 of the signature appearance.
Sets the signature text identifying the signer.
@param text the signature text identifying the signer. If null
or not set
a standard description will be used
Font for the text in Layer 2.
Sets the n2 and n4 layer font. If the font size is zero, auto-fit will be used.
@param layer2Font the n2 and n4 font
Run direction for the text in layers 2 and 4.
Sets the run direction in the n2 and n4 layer.
@param runDirection the run direction
The text that goes in Layer 4 of the appearance.
Sets the text identifying the signature status. Will be ignored if acro6Layers is true.
@param text the text identifying the signature status. If null
or not set
the description "Signature Not Verified" will be used
Template containing all layers drawn on top of each other.
extra space at the top.
margin for the content inside the signature rectangle.
The PdfStamper that creates the signed PDF.
Gets the PdfStamper
associated with this instance.
@return the PdfStamper
associated with this instance
Sets the PdfStamper
@param stamper PdfStamper
The PdfStamperImp object corresponding with the stamper.
A byte buffer containing the bytes of the Stamper.
Getter for the byte buffer.
OutputStream for the bytes of the stamper.
Temporary file in case you don't want to sign in memory.
Gets the temporary file.
@return the temporary file or null
is the document is created in memory
Name and content of keys that can only be added in the close() method.
Length of the output.
Indicates if the stamper has already been pre-closed.
Signature field lock dictionary.
Signature field lock dictionary.
If a signature is created on an existing signature field, then its /Lock dictionary
takes the precedence (if it exists).
Checks if the document is in the process of closing.
@return true
if the document is in the process of closing,
false
otherwise
Adds keys to the signature dictionary that define
the certification level and the permissions.
This method is only used for Certifying signatures.
@param crypto the signature dictionary
Adds keys to the signature dictionary that define
the field permissions.
This method is only used for signatures that lock fields.
@param crypto the signature dictionary
PdfSmartCopy has the same functionality as PdfCopy,
but when resources (such as fonts, images,...) are
encountered, a reference to these resources is saved
in a cache, so that they can be reused.
This requires more memory, but reduces the file size
of the resulting PDF document.
the cache with the streams and references.
Creates a PdfSmartCopy instance.
Translate a PRIndirectReference to a PdfIndirectReference
In addition, translates the object numbers, and copies the
referenced object to the output file if it wasn't available
in the cache yet. If it's in the cache, the reference to
the already used stream is returned.
NB: PRIndirectReferences (and PRIndirectObjects) really need to know what
file they came from, because each file has its own namespace. The translation
we do from their namespace to ours is *at best* heuristic, and guaranteed to
fail under some circumstances.
A PdfSpotColor
defines a ColorSpace
@see PdfDictionary
Constructs a new PdfSpotColor
.
@param name a string value
@param tint a tint value between 0 and 1
@param altcs a altnative colorspace value
The writer
Gets the optional String
map to add or change values in
the info dictionary.
@return the map or null
An optional String
map to add or change values in
the info dictionary. Entries with null
values delete the key in the original info dictionary
@param moreInfo additional entries to the info dictionary
Replaces a page from this document with a page from other document. Only the content
is replaced not the fields and annotations. This method must be called before
getOverContent() or getUndercontent() are called for the same page.
@param r the PdfReader
from where the new page will be imported
@param pageImported the page number of the imported page
@param pageReplaced the page to replace in this document
Inserts a blank page. All the pages above and including pageNumber
will
be shifted up. If pageNumber
is bigger than the total number of pages
the new page will be the last one.
@param pageNumber the page number position where the new page will be inserted
@param mediabox the size of the new page
Gets the signing instance. The appearances and other parameters can the be set.
@return the signing instance
Gets the xml signing instance. The appearances and other parameters can the be set.
@return the signing instance
Gets a PdfContentByte
to write under the page of
the original document.
@param pageNum the page number where the extra content is written
@return a PdfContentByte
to write under the page of
the original document
Gets a PdfContentByte
to write over the page of
the original document.
@param pageNum the page number where the extra content is written
@return a PdfContentByte
to write over the page of
the original document
Checks if the content is automatically adjusted to compensate
the original page rotation.
@return the auto-rotation status
Flags the content to be automatically adjusted to compensate
the original page rotation. The default is true
.
@param rotateContents true
to set auto-rotation, false
otherwise
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param strength128Bits true
for 128 bit key length, false
for 40 bit key length
@throws DocumentException if anything was already written to the output
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param 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 cleartext
@throws DocumentException if the document is already open
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param strength true
for 128 bit key length, false
for 40 bit key length
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@throws DocumentException if anything was already written to the output
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param 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 cleartext
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@throws DocumentException if the document is already open
Sets the certificate encryption options for this document. An array of one or more public certificates
must be provided together with an array of the same size for the permissions for each certificate.
The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
@param certs the public certificates to be used for the encryption
@param permissions the user permissions for each of the certicates
@param encryptionType the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.
@throws DocumentException if the encryption was set too late
Gets a page from other PDF document. Note that calling this method more than
once with the same parameters will retrieve the same object.
@param reader the PDF document where the page is
@param pageNumber the page number. The first page is 1
@return the template representing the imported page
Gets the underlying PdfWriter.
@return the underlying PdfWriter
Gets the underlying PdfReader.
@return the underlying PdfReader
Gets the AcroFields
object that allows to get and set field values
and to merge FDF forms.
@return the AcroFields
object
Determines if the fields are flattened on close. The fields added with
{@link #addAnnotation(PdfAnnotation,int)} will never be flattened.
@param flat true
to flatten the fields, false
to keep the fields
Determines if the FreeText annotations are flattened on close.
@param flat true
to flatten the FreeText annotations, false
(the default) to keep the FreeText annotations as active content.
Flatten annotations with an appearance stream on close().
@param flat boolean to indicate whether iText should flatten annotations or not.
Adds an annotation of form field in a specific page. This page number
can be overridden with {@link PdfAnnotation#setPlaceInPage(int)}.
@param annot the annotation
@param page the page
Adds an empty signature.
@param name the name of the signature
@param page the page number
@param llx lower left x coordinate of the signature's position
@param lly lower left y coordinate of the signature's position
@param urx upper right x coordinate of the signature's position
@param ury upper right y coordinate of the signature's position
@return a signature form field
@since 2.1.4
Adds the comments present in an FDF file.
@param fdf the FDF file
@throws IOException on error
Sets the bookmarks. The list structure is defined in
{@link SimpleBookmark}.
@param outlines the bookmarks or null
to remove any
Sets the thumbnail image for a page.
@param image the image
@param page the page
@throws PdfException on error
@throws DocumentException on error
Adds a JavaScript action at the document level. When the document
opens all this JavaScript runs. The existing JavaScript will be replaced.
@param js the JavaScript code
Adds a JavaScript action at the document level. When the document
opens all this JavaScript runs. The existing JavaScript will be replaced.
@param name the name for the JavaScript snippet in the name tree
@param js the JavaScript code
Adds a file attachment at the document level. Existing attachments will be kept.
@param description the file description
@param fileStore an array with the file. If it's null
the file will be read from the disk
@param file the path to the file. It will only be used if
fileStore
is not null
@param fileDisplay the actual file name stored in the pdf
@throws IOException on error
Adds a file attachment at the document level. Existing attachments will be kept.
@param description the file description
@param fs the file specification
Adds or replaces the Collection Dictionary in the Catalog.
@param collection the new collection dictionary.
Sets the viewer preferences.
@param preferences the viewer preferences
@see PdfViewerPreferences#setViewerPreferences(int)
Adds a viewer preference
@param preferences the viewer preferences
@see PdfViewerPreferences#addViewerPreference
Sets the XMP metadata.
@param xmp
@see PdfWriter#setXmpMetadata(byte[])
Gets the 1.5 compression status.
@return true
if the 1.5 compression is on
Sets the document's compression to the new 1.5 mode with object streams and xref
streams. Be attentive!!! If you want set full compression , you should set immediately after creating PdfStamper,
before editing the document.It can be set once and it can't be unset.
Sets the open and close page additional action.
@param actionType the action type. It can be PdfWriter.PAGE_OPEN
or PdfWriter.PAGE_CLOSE
@param action the action to perform
@param page the page where the action will be applied. The first page is 1
@throws PdfException if the action type is invalid
Sets the display duration for the page (for presentations)
@param seconds the number of seconds to display the page. A negative value removes the entry
@param page the page where the duration will be applied. The first page is 1
Sets the transition for the page
@param transition the transition object. A null
removes the transition
@param page the page where the transition will be applied. The first page is 1
Gets the PdfLayer objects in an existing document as a Map
with the names/titles of the layers as keys.
@return a Map with all the PdfLayers in the document (and the name/title of the layer as key)
@since 2.1.2
Integer(page number) -> PageStamp
Holds value of property rotateContents.
Creates new PdfStamperImp.
@param reader the read PDF
@param os the output destination
@param pdfVersion the new pdf version or '\0' to keep the same version as the original
document
@param append
@throws DocumentException on error
@throws IOException
@param reader
@param openFile
@throws IOException
@param reader
@param fdf
@throws IOException
If true, annotations with an appearance stream will be flattened.
@since 5.5.3
@param flatAnnotations boolean
@see com.lowagie.text.pdf.PdfWriter#getPageReference(int)
@see com.lowagie.text.pdf.PdfWriter#addAnnotation(com.lowagie.text.pdf.PdfAnnotation)
Adds or replaces the Collection Dictionary in the Catalog.
@param collection the new collection dictionary.
Sets the viewer preferences.
@param preferences the viewer preferences
@see PdfWriter#setViewerPreferences(int)
Adds a viewer preference
@param preferences the viewer preferences
@see PdfViewerPreferences#addViewerPreference
Set the signature flags.
@param f the flags. This flags are ORed with current ones
Always throws an UnsupportedOperationException
.
@param actionType ignore
@param action ignore
@throws PdfException ignore
@see PdfStamper#setPageAction(PdfName, PdfAction, int)
Sets the open and close page additional action.
@param actionType the action type. It can be PdfWriter.PAGE_OPEN
or PdfWriter.PAGE_CLOSE
@param action the action to perform
@param page the page where the action will be applied. The first page is 1
@throws PdfException if the action type is invalid
Always throws an UnsupportedOperationException
.
@param seconds ignore
Always throws an UnsupportedOperationException
.
@param transition ignore
Sets the display duration for the page (for presentations)
@param seconds the number of seconds to display the page. A negative value removes the entry
@param page the page where the duration will be applied. The first page is 1
Sets the transition for the page
@param transition the transition object. A null
removes the transition
@param page the page where the transition will be applied. The first page is 1
Getter for property append.
@return Value of property append.
Additional-actions defining the actions to be taken in
response to various trigger events affecting the document
as a whole. The actions types allowed are: DOCUMENT_CLOSE
,
WILL_SAVE
, DID_SAVE
, WILL_PRINT
and DID_PRINT
.
@param actionType the action type
@param action the action to execute in response to the trigger
@throws PdfException on invalid action type
@see com.lowagie.text.pdf.PdfWriter#setOpenAction(com.lowagie.text.pdf.PdfAction)
@see com.lowagie.text.pdf.PdfWriter#setOpenAction(java.lang.String)
@see com.lowagie.text.pdf.PdfWriter#setThumbnail(com.lowagie.text.Image)
Reads the OCProperties dictionary from the catalog of the existing document
and fills the documentOCG, documentOCGorder and OCGRadioGroup variables in PdfWriter.
Note that the original OCProperties of the existing document can contain more information.
@since 2.1.2
Recursive method to reconstruct the documentOCGorder variable in the writer.
@param parent a parent PdfLayer (can be null)
@param arr an array possibly containing children for the parent PdfLayer
@param ocgmap a Hashtable with indirect reference Strings as keys and PdfLayer objects as values.
@since 2.1.2
Gets the PdfLayer objects in an existing document as a Map
with the names/titles of the layers as keys.
@return a Map with all the PdfLayers in the document (and the name/title of the layer as key)
@since 2.1.2
A possible compression level.
@since 2.1.3
A possible compression level.
@since 2.1.3
A possible compression level.
@since 2.1.3
A possible compression level.
@since 2.1.3
is the stream compressed?
The level of compression.
@since 2.1.3
Constructs a PdfStream
-object.
@param bytes content of the new PdfObject
as an array of byte
.
Creates an efficient stream. No temporary array is ever created. The InputStream
is totally consumed but is not closed. The general usage is:
InputStream in = ...;
PdfStream stream = new PdfStream(in, writer);
stream.FlateCompress();
writer.AddToBody(stream);
stream.WriteLength();
in.Close();
@param inputStream the data to write to this stream
@param writer the PdfWriter
for this stream
Constructs a PdfStream
-object.
Writes the stream length to the PdfWriter
.
This method must be called and can only be called if the contructor {@link #PdfStream(InputStream,PdfWriter)}
is used to create the stream.
@throws IOException on error
@see #PdfStream(InputStream,PdfWriter)
Compresses the stream.
Compresses the stream.
@param compressionLevel the compression level (0 = best speed, 9 = best compression, -1 is default)
@since 2.1.3
Writes the data content to an Stream
.
@param os the destination to write to
@throws IOException on error
@see com.lowagie.text.pdf.PdfObject#toString()
The value of this object.
The encoding.
Constructs an empty PdfString
-object.
Constructs a PdfString
-object.
@param value the content of the string
Constructs a PdfString
-object.
@param value the content of the string
@param encoding an encoding
Constructs a PdfString
-object.
@param bytes an array of byte
Returns the PDF representation of this PdfString
.
@return an array of byte
s
Returns the string
value of the PdfString
-object.
@return a string
Gets the encoding of this string.
@return a string
This is a node in a document logical structure. It may contain a mark point or it may contain
other nodes.
@author Paulo Soares
Holds value of property kids.
Holds value of property reference.
Creates a new instance of PdfStructureElement.
@param parent the parent of this node
@param structureType the type of structure. It may be a standard type or a user type mapped by the role map
Creates a new instance of PdfStructureElement.
@param root the structure tree root
@param structureType the type of structure. It may be a standard type or a user type mapped by the role map
Gets the parent of this node.
@return the parent of this node
Gets the reference this object will be written to.
@return the reference this object will be written to
Gets the first entarance of attribute.
@returns PdfObject
@since 5.3.4
Sets the attribute value.
@since 5.3.4
The structure tree root corresponds to the highest hierarchy level in a tagged PDF.
@author Paulo Soares
Holds value of property writer.
Creates a new instance of PdfStructureTreeRoot
Maps the user tags to the standard tags. The mapping will allow a standard application to make some sense of the tagged
document whatever the user tags may be.
@param used the user tag
@param standard the standard tag
Gets the writer.
@return the writer
Gets the reference this object will be written to.
@return the reference this object will be written to
Gets the first entarance of attribute.
@returns PdfObject
@since 5.3.4
Sets the attribute value.
@since 5.3.4
Implements the form XObject.
The indirect reference to this template
The resources used by this template
The bounding box of this template
A dictionary with additional information
@since 5.1.0
Creates a PdfTemplate
.
Creates new PdfTemplate
@param wr the PdfWriter
Gets the bounding width of this template.
@return width the bounding width
Gets the bounding heigth of this template.
@return heigth the bounding height
Gets the layer this template belongs to.
@return the layer this template belongs to or null
for no layer defined
Gets the indirect reference to this template.
@return the indirect reference to this template
Constructs the resources used by this template.
@return the resources used by this template
Gets the stream representing this template.
@param compressionLevel the compressionLevel
@return the stream representing this template
@since 2.1.3 (replacing the method without param compressionLevel)
Gets a duplicate of this PdfTemplate
. All
the members are copied by reference but the buffer stays different.
@return a copy of this PdfTemplate
Sets/gets a dictionary with extra entries, for instance /Measure.
@param additional
a PdfDictionary with additional information.
@since 5.1.0
Adds a PdfNumber
to the PdfArray
.
@param number displacement of the string
Out Vertical Split
Out Horizontal Split
In Vertical Split
IN Horizontal Split
Vertical Blinds
Vertical Blinds
Inward Box
Outward Box
Left-Right Wipe
Right-Left Wipe
Bottom-Top Wipe
Top-Bottom Wipe
Dissolve
Left-Right Glitter
Top-Bottom Glitter
Diagonal Glitter
duration of the transition effect
type of the transition effect
Constructs a Transition
.
Constructs a Transition
.
@param type type of the transition effect
Constructs a Transition
.
@param type type of the transition effect
@param duration duration of the transition effect
The transparency group dictionary.
@author Paulo Soares
Constructs a transparencyGroup.
Determining the initial backdrop against which its stack is composited.
@param isolated
Determining whether the objects within the stack are composited with one another or only with the group's backdrop.
@param knockout
An array specifying a visibility expression, used to compute visibility
of content based on a set of optional content groups.
@since 5.0.2
A boolean operator.
A boolean operator.
A boolean operator.
Creates a visibility expression.
@param type should be AND, OR, or NOT
@see com.itextpdf.text.pdf.PdfArray#add(int, com.itextpdf.text.pdf.PdfObject)
@see com.itextpdf.text.pdf.PdfArray#add(com.itextpdf.text.pdf.PdfObject)
@see com.itextpdf.text.pdf.PdfArray#addFirst(com.itextpdf.text.pdf.PdfObject)
@see com.itextpdf.text.pdf.PdfArray#add(float[])
@see com.itextpdf.text.pdf.PdfArray#add(int[])
A 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.
The highest generation number possible.
@since iText 2.1.6
PdfCrossReference
is an entry in the PDF Cross-Reference table.
Byte offset in the PDF file.
generation of the object.
Constructs a cross-reference element for a PdfIndirectObject.
@param refnum
@param offset byte offset of the object
@param generation generationnumber of the object
Constructs a cross-reference element for a PdfIndirectObject.
@param refnum
@param offset byte offset of the object
Returns the PDF representation of this PdfObject
.
@param os
@throws IOException
Writes PDF syntax to the Stream
@param midSize
@param os
@throws IOException
@see java.lang.Comparable#compareTo(java.lang.Object)
@see java.lang.Object#equals(java.lang.Object)
array containing the cross-reference table of the normal objects.
the current byteposition in the body.
Constructs a new PdfBody
.
@param writer
Gets a PdfIndirectReference for an object that will be created in the future.
@return a PdfIndirectReference
Returns the offset of the Cross-Reference table.
@return an offset
Returns the total number of objects contained in the CrossReferenceTable of this Body
.
@return a number of objects
Returns the CrossReferenceTable of the Body
.
@param os
@param root
@param info
@param encryption
@param fileID
@param prevxref
@throws IOException
Constructs a PDF-Trailer.
@param size the number of entries in the PdfCrossReferenceTable
@param offset offset of the PdfCrossReferenceTable
@param root an indirect reference to the root of the PDF document
@param info an indirect reference to the info object of the PDF document
@param encryption
@param fileID
@param prevxref
Returns the PDF representation of this PdfObject
.
@param writer
@param os
@throws IOException
Constructs a PdfWriter
.
Use this method to get an instance of the PdfWriter
.
@param document The Document
that has to be written
@param os The Stream
the writer has to write to.
@return a new PdfWriter
@throws DocumentException on error
Use this method to get an instance of the PdfWriter
.
@return a new PdfWriter
@param document The Document
that has to be written
@param os The Stream
the writer has to write to.
@param listener A DocListener
to pass to the PdfDocument.
@throws DocumentException on error
the pdfdocument object.
Gets the PdfDocument
associated with this writer.
@return the PdfDocument
Use this method to get the info dictionary if you want to
change it directly (add keys and values to the info dictionary).
@return the info dictionary
Use this method to get the current vertical page position.
@param 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.
@return The current vertical page position.
Sets the initial leading for the PDF document.
This has to be done before the document is opened.
@param leading the initial leading
@since 2.1.6
@throws DocumentException if you try setting the leading after the document was opened.
The direct content in this document.
The direct content under in this document.
Use this method to get the direct content for this document.
There is only one direct content, multiple calls to this method
will allways retrieve the same object.
@return the direct content
Use this method to get the direct content under for this document.
There is only one direct content, multiple calls to this method
will allways retrieve the same object.
@return the direct content
Resets all the direct contents to empty.
This happens when a new page is started.
body of the PDF document
Adds the local destinations to the body of the document.
@param dest the Hashtable
containing the destinations
@throws IOException on error
Adds an object to the PDF body.
@param object
@return a PdfIndirectObject
@throws IOException
Adds an object to the PDF body.
@param object
@param inObjStm
@return a PdfIndirectObject
@throws IOException
Adds an object to the PDF body.
@param object
@param ref
@return a PdfIndirectObject
@throws IOException
Adds an object to the PDF body.
@param object
@param ref
@param inObjStm
@return a PdfIndirectObject
@throws IOException
Adds an object to the PDF body.
@param object
@param refNumber
@return a PdfIndirectObject
@throws IOException
Adds an object to the PDF body.
@param object
@param refNumber
@param inObjStm
@return a PdfIndirectObject
@throws IOException
Use this method for caching objects.
@param iobj @see PdfIndirectObject
Gets a PdfIndirectReference
for an object that
will be created in the future.
@return the PdfIndirectReference
Returns the outputStreamCounter.
@return the outputStreamCounter
Holds value of property extraCatalog.
Sets extra keys to the catalog.
@return the catalog to change
The root of the page tree.
The PdfIndirectReference to the pages.
The current page number.
The value of the Tabs entry in the page dictionary.
@since 2.1.5
Additional page dictionary entries.
@since 5.1.0
Adds an additional entry for the page dictionary.
@since 5.1.0
Gets the additional pageDictEntries.
@since 5.1.0
Resets the additional pageDictEntries.
@since 5.1.0
Use this method to make sure the page tree has a lineair structure
(every leave is attached directly to the root).
Use this method to allow page reordering with method reorderPages.
Use this method to reorder the pages in the document.
A null
argument value only returns the number of pages to process.
It is advisable to issue a Document.NewPage()
before using this method.
@return the total number of pages
@param order an array with the new page sequence. It must have the
same size as the number of pages.
@throws DocumentException if all the pages are not present in the array
Use this method to get a reference to a page existing or not.
If the page does not exist yet the reference will be created
in advance. If on closing the document, a page number greater
than the total number of pages was requested, an exception
is thrown.
@param page the page number. The first page is 1
@return the reference to the page
Gets the pagenumber of this document.
This number can be different from the real pagenumber,
if you have (re)set the page number previously.
@return a page number
Sets the Viewport for the next page.
@param viewport an array consisting of Viewport dictionaries.
@since 5.1.0
Sets the value for the Tabs entry in the page tree.
@param tabs Can be PdfName.R, PdfName.C or PdfName.S.
Since the Adobe Extensions Level 3, it can also be PdfName.A
or PdfName.W
@since 2.1.5
The PdfPageEvent
for this document.
Gets the PdfPageEvent
for this document or null
if none is set.
@return the PdfPageEvent
for this document or null
if none is set
A number refering to the previous Cross-Reference Table.
The original file ID (if present).
Use this method to get the root outline
and construct bookmarks.
@return the root outline
Sets the bookmarks. The list structure is defined in
{@link SimpleBookmark}.
@param outlines the bookmarks or null
to remove any
possible PDF version (header)
possible PDF version (header)
possible PDF version (header)
possible PDF version (header)
possible PDF version (header)
possible PDF version (header)
possible PDF version (catalog)
possible PDF version (catalog)
possible PDF version (catalog)
possible PDF version (catalog)
possible PDF version (catalog)
possible PDF version (catalog)
Stores the version information for the header and the catalog.
@see com.lowagie.text.pdf.interfaces.PdfVersion#setPdfVersion(char)
@see com.lowagie.text.pdf.interfaces.PdfVersion#setAtLeastPdfVersion(char)
@see com.lowagie.text.pdf.interfaces.PdfVersion#setPdfVersion(com.lowagie.text.pdf.PdfName)
@see com.lowagie.text.pdf.interfaces.PdfVersion#addDeveloperExtension(com.lowagie.text.pdf.PdfDeveloperExtension)
@since 2.1.6
Returns the version information.
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
A viewer preference
Sets the viewer preferences as the sum of several constants.
@param preferences the viewer preferences
@see PdfViewerPreferences#setViewerPreferences
Adds a viewer preference
@param preferences the viewer preferences
@see PdfViewerPreferences#addViewerPreference
Use this method to add page labels
@param pageLabels the page labels
Adds named destinations in bulk.
Valid keys and values of the map can be found in the map
that is created by SimpleNamedDestination.
@param map a map with strings as keys for the names,
and structured strings as values for the destinations
@param page_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).
@since iText 5.0
Adds one named destination.
@param name the name for the destination
@param page the page number where you want to jump to
@param dest an explicit destination
@since iText 5.0
Use this method to add a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
@param js The JavaScript action
Adds a JavaScript action at the document level. When the document
opens all this JavaScript runs.
@param code the JavaScript code
@param unicode select JavaScript unicode. Note that the internal
Acrobat JavaScript engine does not support unicode,
so this may or may not work for you
Adds a JavaScript action at the document level. When the document
opens all this JavaScript runs.
@param code the JavaScript code
Use this method to add a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
@param name The name of the JS Action in the name tree
@param js The JavaScript action
Use this method to add a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
@param name The name of the JS Action in the name tree
@param code the JavaScript code
@param unicode select JavaScript unicode. Note that the internal
Acrobat JavaScript engine does not support unicode,
so this may or may not work for you
Use this method to adds a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
@param name The name of the JS Action in the name tree
@param code the JavaScript code
Adds a file attachment at the document level.
@param description the file description
@param fileStore an array with the file. If it's null
the file will be read from the disk
@param file the path to the file. It will only be used if
fileStore
is not null
@param fileDisplay the actual file name stored in the pdf
@throws IOException on error
Adds a file attachment at the document level.
@param description the file description
@param fs the file specification
Adds a file attachment at the document level.
@param fs the file specification
action value
action value
action value
action value
action value
When the document opens it will jump to the destination with
this name.
@param name the name of the destination to jump to
When the document opens this action
will be
invoked.
@param action the action to be invoked
Additional-actions defining the actions to be taken in
response to various trigger events affecting the document
as a whole. The actions types allowed are: DOCUMENT_CLOSE
,
WILL_SAVE
, DID_SAVE
, WILL_PRINT
and DID_PRINT
.
@param actionType the action type
@param action the action to execute in response to the trigger
@throws PdfException on invalid action type
Sets the Collection dictionary.
@param collection a dictionary of type PdfCollection
signature value
signature value
Gets the AcroForm object.
@return the PdfAcroForm
Adds a PdfAnnotation
or a PdfFormField
to the document. Only the top parent of a PdfFormField
needs to be added.
@param annot the PdfAnnotation
or the PdfFormField
to add
Adds the PdfAnnotation
to the calculation order
array.
@param annot the PdfAnnotation
to be added
Set the signature flags.
@param f the flags. This flags are ORed with current ones
XMP Metadata for the document.
Sets XMP Metadata.
@param xmpMetadata The xmpMetadata to set.
Use this method to set the XMP Metadata for each page.
@param xmpMetadata The xmpMetadata to set.
Use this method to creates XMP Metadata based
on the metadata in the PdfDocument.
@since 5.4.4 just creates XmpWriter instance which will be serialized in close.
PDF/X level
PDF/X level
PDF/X level
Stores the PDF ISO conformance.
Sets the PDFX conformance level. Allowed values are PDFX1A2001 and PDFX32002. It
must be called before opening the document.
@param pdfxConformance the conformance level
Checks if any PDF ISO conformance is necessary.
@return true
if the PDF has to be in conformance with any of the PDF ISO specifications
@see com.lowagie.text.pdf.interfaces.PdfXConformance#isPdfX()
Sets the values of the output intent dictionary. Null values are allowed to
suppress any key.
@param outputConditionIdentifier a value
@param outputCondition a value
@param registryName a value
@param info a value
@param destOutputProfile a value
@throws IOException on error
Sets the values of the output intent dictionary. Null values are allowed to
suppress any key.
Prefer the ICC_Profile
-based version of this method.
@param outputConditionIdentifier a value
@param outputCondition a value, "PDFA/A" to force GTS_PDFA1, otherwise cued by pdfxConformance.
@param registryName a value
@param info a value
@param destOutputProfile a value
@since 1.x
@throws IOException
Copies the output intent dictionary from other document to this one.
@param reader the other document
@param checkExistence true
to just check for the existence of a valid output intent
dictionary, false
to insert the dictionary if it exists
@throws IOException on error
@return true
if the output intent dictionary exists, false
otherwise
Type of encryption
Type of encryption
Type of encryption
Type of encryption
Mask to separate the encryption type from the encryption mode.
Add this to the mode to keep the metadata in clear text
Add this to the mode to keep encrypt only the embedded files.
@since 2.1.3
The operation permitted when the document is opened with the user password
@since 2.0.7
The operation permitted when the document is opened with the user password
@since 2.0.7
The operation permitted when the document is opened with the user password
@since 2.0.7
The operation permitted when the document is opened with the user password
@since 2.0.7
The operation permitted when the document is opened with the user password
@since 2.0.7
The operation permitted when the document is opened with the user password
@since 2.0.7
The operation permitted when the document is opened with the user password
@since 2.0.7
The operation permitted when the document is opened with the user password
@since 2.0.7
@deprecated As of iText 2.0.7, use {@link #ALLOW_PRINTING} instead. Scheduled for removal at or after 2.2.0
@deprecated As of iText 2.0.7, use {@link #ALLOW_MODIFY_CONTENTS} instead. Scheduled for removal at or after 2.2.0
@deprecated As of iText 2.0.7, use {@link #ALLOW_COPY} instead. Scheduled for removal at or after 2.2.0
@deprecated As of iText 2.0.7, use {@link #ALLOW_MODIFY_ANNOTATIONS} instead. Scheduled for removal at or after 2.2.0
@deprecated As of iText 2.0.7, use {@link #ALLOW_FILL_IN} instead. Scheduled for removal at or after 2.2.0
@deprecated As of iText 2.0.7, use {@link #ALLOW_SCREENREADERS} instead. Scheduled for removal at or after 2.2.0
@deprecated As of iText 2.0.7, use {@link #ALLOW_ASSEMBLY} instead. Scheduled for removal at or after 2.2.0
@deprecated As of iText 2.0.7, use {@link #ALLOW_DEGRADED_PRINTING} instead. Scheduled for removal at or after 2.2.0
@deprecated As of iText 2.0.7, use {@link #STANDARD_ENCRYPTION_40} instead. Scheduled for removal at or after 2.2.0
@deprecated As of iText 2.0.7, use {@link #STANDARD_ENCRYPTION_128} instead. Scheduled for removal at or after 2.2.0
Contains the business logic for cryptography.
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param 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 cleartext
@throws DocumentException if the document is already open
Sets the certificate encryption options for this document. An array of one or more public certificates
must be provided together with an array of the same size for the permissions for each certificate.
The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
@param certs the public certificates to be used for the encryption
@param permissions the user permissions for each of the certicates
@param encryptionType the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.
@throws DocumentException if the document is already open
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@param strength128Bits true
for 128 bit key length, false
for 40 bit key length
@throws DocumentException if the document is already open
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param strength true
for 128 bit key length, false
for 40 bit key length
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@throws DocumentException if the document is already open
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
@param 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 cleartext
@param userPassword the user password. Can be null or empty
@param ownerPassword the owner password. Can be null or empty
@param permissions the user permissions
@throws DocumentException if the document is already open
Holds value of property fullCompression.
Gets the 1.5 compression status.
@return true
if the 1.5 compression is on
Sets the document's compression to the new 1.5 mode with object streams and xref
streams. It can be set at any time but once set it can't be unset.
The compression level of the content streams.
@since 2.1.3
Sets the compression level to be used for streams written by this writer.
@param compressionLevel a value between 0 (best speed) and 9 (best compression)
@since 2.1.3
The fonts of this document
The font number counter for the fonts in the document.
Adds a BaseFont
to the document but not to the page resources.
It is used for templates.
@param bf the BaseFont
to add
@return an Object[]
where position 0 is a PdfName
and position 1 is an PdfIndirectReference
The form XObjects in this document. The key is the xref and the value
is Object[]{PdfName, template}.
The name counter for the form XObjects name.
Adds a template to the document but not to the page resources.
@param template the template to add
@param forcedName the template name, rather than a generated one. Can be null
@return the PdfName
for this template
Releases the memory used by a template by writing it to the output. The template
can still be added to any content but changes to the template itself won't have
any effect.
@param tp the template to release
@throws IOException on error
Gets a page from other PDF document. The page can be used as
any other PdfTemplate. Note that calling this method more than
once with the same parameters will retrieve the same object.
@param reader the PDF document where the page is
@param pageNumber the page number. The first page is 1
@return the template representing the imported page
Returns the PdfReaderInstance associated with the specified reader.
Multiple calls with the same reader object will return the same
PdfReaderInstance.
@param reader the PDF reader that you want an instance for
@return the instance for the provided reader
@since 5.0.3
Writes the reader to the document and frees the memory used by it.
The main use is when concatenating multiple documents to keep the
memory usage restricted to the current appending document.
@param reader the PdfReader
to free
@throws IOException on error
Gets the current document size. This size only includes
the data already writen to the output stream, it does not
include templates or fonts. It is usefull if used with
freeReader()
when concatenating many documents
and an idea of the current size is needed.
@return the approximate size without fonts or templates
The colors of this document
The color number counter for the colors in the document.
Adds a SpotColor
to the document but not to the page resources.
@param spc the SpotColor
to add
@return an Object[]
where position 0 is a PdfName
and position 1 is an PdfIndirectReference
The patterns of this document
The patten number counter for the colors in the document.
Mark this document for tagging. It must be called before open.
Check if the document is marked for tagging.
@return true
if the document is marked for tagging
Fix structure of tagged document: remove unused objects, remove unused items from class map,
fix xref table due to removed objects.
Flushes merged AcroFields to document (if any).
Gets the structure tree root. If the document is not marked for tagging it will return null
.
@return the structure tree root
Gets the Optional Content Properties Dictionary. Each call fills the dictionary with the current layer
state. It's advisable to only call this method right before close and do any modifications
at that time.
@return the Optional Content Properties Dictionary
Sets a collection of optional content groups whose states are intended to follow
a "radio button" paradigm. That is, the state of at most one optional
content group in the array should be ON at a time: if one group is turned
ON, all others must be turned OFF.
@param group the radio group
Use this method to lock an optional content group.
The state of a locked group cannot be changed through the user interface
of a viewer application. Producers can use this entry to prevent the visibility
of content that depends on these groups from being changed by users.
@param layer the layer that needs to be added to the array of locked OCGs
@since 2.1.2
Gives the size of the media box.
@return a Rectangle
Sets the crop box. The crop box should not be rotated even if the
page is rotated. This change only takes effect in the next
page.
@param crop the crop box
Sets the page box sizes. Allowed names are: "crop", "trim", "art" and "bleed".
@param boxName the box size
@param size the size
Gives the size of a trim, art, crop or bleed box, or null if not defined.
@param boxName crop, trim, art or bleed
Returns the intersection between the crop, trim art or bleed box and the parameter intersectingRectangle.
This method returns null when
- there is no intersection
- any of the above boxes are not defined
- the parameter intersectingRectangle is null
@param boxName crop, trim, art, bleed
@param intersectingRectangle the rectangle that intersects the rectangle associated to the boxName
@return the intersection of the two rectangles
Use this method to make sure a page is added,
even if it's empty. If you use SetPageEmpty(false),
invoking NewPage() after a blank page will add a newPage.
SetPageEmpty(true) won't have any effect.
@param pageEmpty the state
action value
action value
Sets the open and close page additional action.
@param actionType the action type. It can be PdfWriter.PAGE_OPEN
or PdfWriter.PAGE_CLOSE
@param action the action to perform
@throws PdfException if the action type is invalid
Sets the display duration for the page (for presentations)
@param seconds the number of seconds to display the page
Sets the transition for the page
@param transition the Transition object
Sets the the thumbnail image for the current page.
@param image the image
@throws PdfException on error
@throws DocumentException or error
A group attributes dictionary specifying the attributes
of the page�s page group for use in the transparent
imaging model
The default space-char ratio.
Disable the inter-character spacing.
The ratio between the extra word spacing and the extra character spacing.
Extra word spacing will grow ratio
times more than extra character spacing.
Sets the ratio between the extra word spacing and the extra character spacing
when the text is fully justified.
Extra word spacing will grow spaceCharRatio
times more than extra character spacing.
If the ratio is PdfWriter.NO_SPACE_CHAR_RATIO
then the extra character spacing
will be zero.
@param spaceCharRatio the ratio between the extra word spacing and the extra character spacing
Use the default run direction.
Do not use bidirectional reordering.
Use bidirectional reordering with left-to-right
preferential run direction.
Use bidirectional reordering with right-to-left
preferential run direction.
Sets the run direction. This is only used as a placeholder
as it does not affect anything.
@param runDirection the run direction
A UserUnit is a value that defines the default user space unit.
The minimum UserUnit is 1 (1 unit = 1/72 inch).
The maximum UserUnit is 75,000.
Remark that this userunit only works starting with PDF1.6!
Gets the default colorspaces.
@return the default colorspaces
Sets the image sequence to follow the text in strict order.
@param strictImageSequence new value of property strictImageSequence
Clears text wrapping around images (if applicable).
Method suggested by Pelikan Stephan
@throws DocumentException
Dictionary, containing all the images of the PDF document
This is the list with all the images in the document.
Adds an image to the document but not to the page resources. It is used with
templates and Document.Add(Image)
.
@param image the Image
to add
@return the name of the image added
@throws PdfException on error
@throws DocumentException on error
Adds an image to the document but not to the page resources. It is used with
templates and Document.Add(Image)
.
@param image the Image
to add
@param fixedRef the reference to used. It may be null
,
a PdfIndirectReference
or a PRIndirectReference
.
@return the name of the image added
@throws PdfException on error
@throws DocumentException on error
Writes a PdfImage
to the outputstream.
@param pdfImage the image to be added
@return a PdfIndirectReference
to the encapsulated image
@throws PdfException when a document isn't open yet, or has been closed
return the PdfIndirectReference
to the image with a given name.
@param name the name of the image
@return a PdfIndirectReference
A Hashtable with Stream objects containing JBIG2 Globals
@since 2.1.5
Gets an indirect reference to a JBIG2 Globals stream.
Adds the stream if it hasn't already been added to the writer.
@param content a byte array that may already been added to the writer inside a stream object.
@since 2.1.5
A flag indicating the presence of structure elements that contain user properties attributes.
Sets the flag indicating the presence of structure elements that contain user properties attributes.
@param userProperties the user properties flag
Holds value of property RGBTranparency.
Sets the transparency blending colorspace to RGB. The default blending colorspace is
CMYK and will result in faded colors in the screen and in printing. Calling this method
will return the RGB colors to what is expected. The RGB blending will be applied to all subsequent pages
until other value is set.
Note that this is a generic solution that may not work in all cases.
@param rgbTransparencyBlending true
to set the transparency blending colorspace to RGB, false
to use the default blending colorspace
A wrapper around PdfAnnotation constructor.
It is recommended to use this wrapper instead of direct constructor as this is a convenient way to override PdfAnnotation construction when needed.
@param rect
@param subtype
@return
A wrapper around PdfAnnotation constructor.
It is recommended to use this wrapper instead of direct constructor as this is a convenient way to override PdfAnnotation construction when needed.
@param llx
@param lly
@param urx
@param ury
@param title
@param content
@param subtype
@return
A wrapper around PdfAnnotation constructor.
It is recommended to use this wrapper instead of direct constructor as this is a convenient way to override PdfAnnotation construction when needed.
@param llx
@param lly
@param urx
@param ury
@param action
@param subtype
@return
Gets the list of the standard structure element names (roles).
@return
@author psoares
Creates a new instance of PdfXConformanceException.
Creates a new instance of PdfXConformanceException.
@param s
Converts a PFM file into an AFM file.
Creates a new instance of Pfm2afm
Converts a PFM file into an AFM file.
@param inp the PFM file
@param outp the AFM file
@throws IOException on error
Translate table from 1004 to psstd. 1004 is an extension of the
Windows translate table used in PM.
Character class. This is a minor attempt to overcome the problem that
in the pfm file, all unused characters are given the width of space.
Note that this array isn't used in iText.
Windows character names. Give a name to the used locations
for when the all flag is specified.
This class captures an AcroForm on input. Basically, it extends Dictionary
by indexing the fields of an AcroForm
@author Mark Thompson
This class holds the information for a single field
Returns the name of the widget annotation (the /NM entry).
@return a String or null (if there's no /NM key)
Constructor
@param reader reader of the input file
Number of fields found
@return size
Given the title (/T) of a reference, return the associated reference
@param name a string containing the path
@return a reference to the field, or null
Read, and comprehend the acroform
@param root the docment root
After reading, we index all of the fields. Recursive.
@param fieldlist An array of fields
@param fieldDict the last field dictionary we encountered (recursively)
@param parentPath the pathname of the field, up to this point or null
merge field attributes from two dictionaries
@param parent one dictionary
@param child the other dictionary
@return a merged dictionary
stack a level of dictionary. Merge in a dictionary from this level
Constructs a PdfIndirectReference
.
@param reader a PdfReader
@param number the object number.
@param generation the generation number.
Constructs a PdfIndirectReference
.
@param reader a PdfReader
@param number the object number.
Creates a new PDF stream object that will replace a stream
in a existing PDF file.
@param reader the reader that holds the existing PDF
@param conts the new content
@param compressionLevel the compression level for the content
@since 2.1.3 (replacing the existing constructor without param compressionLevel)
Sets the data associated with the stream, either compressed or
uncompressed. Note that the data will never be compressed if
Document.compress is set to false.
@param data raw data, decrypted and uncompressed.
@param compress true if you want the stream to be compresssed.
@since iText 2.1.1
Sets the data associated with the stream, either compressed or
uncompressed. Note that the data will never be compressed if
Document.compress is set to false.
@param data raw data, decrypted and uncompressed.
@param compress true if you want the stream to be compresssed.
@param compressionLevel a value between -1 and 9 (ignored if compress == false)
@since iText 2.1.3
Sets the data associated with the stream, as-is. This method will not
remove or change any existing filter: the data has to match an existing
filter or an appropriate filter has to be set.
@param data data, possibly encrypted and/or compressed
@since 5.5.0
Sets the data associated with the stream
@param data raw data, decrypted and uncompressed.
@author Paulo Soares
Creates a PRTokeniser for the specified {@link RandomAccessSource}.
The beginning of the file is read to determine the location of the header, and the data source is adjusted
as necessary to account for any junk that occurs in the byte source before the header
@param file the source
Is a certain character a whitespace? Currently checks on the following: '0', '9', '10', '12', '13', '32'.
The same as calling {@link #isWhitespace(int, boolean) isWhiteSpace(ch, true)}.
@param ch int
@return boolean
@since 5.5.1
Checks whether a character is a whitespace. Currently checks on the following: '0', '9', '10', '12', '13', '32'.
@param ch int
@param isWhitespace boolean
@return boolean
@since 5.5.1
Gets current reference number. If parsing was failed with NumberFormatException -1 will be return.
Reads data into the provided byte[]. Checks on leading whitespace.
See {@link #isWhitespace(int) isWhiteSpace(int)} or {@link #isWhitespace(int, boolean) isWhiteSpace(int, boolean)}
for a list of whitespace characters.
The same as calling {@link #readLineSegment(byte[], boolean) readLineSegment(input, true)}.
@param input byte[]
@return boolean
@throws IOException
@since 5.5.1
Reads data into the provided byte[]. Checks on leading whitespace.
See {@link #isWhitespace(int) isWhiteSpace(int)} or {@link #isWhitespace(int, boolean) isWhiteSpace(int, boolean)}
for a list of whitespace characters.
@param input byte[]
@param isNullWhitespace boolean to indicate whether '0' is whitespace or not.
If in doubt, use true or overloaded method {@link #readLineSegment(byte[]) readLineSegment(input)}
@return boolean
@throws IOException
@since 5.5.1
A layout option
A layout option
A layout option
A layout option
A layout option
A layout option
A layout option
An icon scaling option
An icon scaling option
An icon scaling option
An icon scaling option
Holds value of property layout.
Holds value of property image.
Holds value of property template.
Holds value of property scaleIcon.
Holds value of property proportionalIcon.
Holds value of property iconVerticalAdjustment.
Holds value of property iconHorizontalAdjustment.
Holds value of property iconFitToBounds.
Creates a new instance of PushbuttonField
@param writer the document PdfWriter
@param box the field location and dimensions
@param fieldName the field name. If null
only the widget keys
will be included in the field allowing it to be used as a kid field.
Sets the icon and label layout. Possible values are LAYOUT_LABEL_ONLY
,
LAYOUT_ICON_ONLY
, LAYOUT_ICON_TOP_LABEL_BOTTOM
,
LAYOUT_LABEL_TOP_ICON_BOTTOM
, LAYOUT_ICON_LEFT_LABEL_RIGHT
,
LAYOUT_LABEL_LEFT_ICON_RIGHT
and LAYOUT_LABEL_OVER_ICON
.
The default is LAYOUT_LABEL_ONLY
.
@param layout New value of property layout.
Sets the icon as an image.
@param image the image
Sets the icon as a template.
@param template the template
Sets the way the icon will be scaled. Possible values are
SCALE_ICON_ALWAYS
, SCALE_ICON_NEVER
,
SCALE_ICON_IS_TOO_BIG
and SCALE_ICON_IS_TOO_SMALL
.
The default is SCALE_ICON_ALWAYS
.
@param scaleIcon the way the icon will be scaled
Sets the way the icon is scaled. If true
the icon is scaled proportionally,
if false
the scaling is done anamorphicaly.
@param proportionalIcon the way the icon is scaled
A number between 0 and 1 indicating the fraction of leftover space to allocate at the bottom of the icon.
A value of 0 positions the icon at the bottom of the annotation rectangle.
A value of 0.5 centers it within the rectangle. The default is 0.5.
@param iconVerticalAdjustment a number between 0 and 1 indicating the fraction of leftover space to allocate at the bottom of the icon
A number between 0 and 1 indicating the fraction of leftover space to allocate at the left of the icon.
A value of 0 positions the icon at the left of the annotation rectangle.
A value of 0.5 centers it within the rectangle. The default is 0.5.
@param iconHorizontalAdjustment a number between 0 and 1 indicating the fraction of leftover space to allocate at the left of the icon
Gets the button appearance.
@throws IOException on error
@throws DocumentException on error
@return the button appearance
Gets the pushbutton field.
@throws IOException on error
@throws DocumentException on error
@return the pushbutton field
If true
the icon will be scaled to fit fully within the bounds of the annotation,
if false
the border width will be taken into account. The default
is false
.
@param iconFitToBounds if true
the icon will be scaled to fit fully within the bounds of the annotation,
if false
the border width will be taken into account
Holds value of property iconReference.
Sets the reference to an existing icon.
@param iconReference the reference to an existing icon
A simple, fast array of bits, represented compactly by an array of ints internally.
@author Sean Owen
@param i bit to get
@return true iff bit i is set
Sets bit i.
@param i bit to set
Flips bit i.
@param i bit to set
Sets a block of 32 bits, starting at bit i.
@param i first bit to set
@param newBits the new value of the next 32 bits. Note again that the least-significant bit
corresponds to bit i, the next-least-significant to i+1, and so on.
Clears all bits (sets to false).
Efficient method to check if a range of bits is set, or not set.
@param start start of range, inclusive.
@param end end of range, exclusive
@param value if true, checks that bits in range are set, otherwise checks that they are not set
@return true iff all bits are set or not set in range, according to value argument
@throws IllegalArgumentException if end is less than or equal to start
@return underlying array of ints. The first element holds the first 32 bits, and the least
significant bit is bit 0.
Reverses all bits in the array.
Represents a 2D matrix of bits. In function arguments below, and throughout the common
module, x is the column position, and y is the row position. The ordering is always x, y.
The origin is at the top-left.
Internally the bits are represented in a 1-D array of 32-bit ints. However, each row begins
with a new int. This is done intentionally so that we can copy out a row into a BitArray very
efficiently.
The ordering of bits is row-major. Within each int, the least significant bits are used first,
meaning they represent lower x values. This is compatible with BitArray's implementation.
@author Sean Owen
@author dswitkin@google.com (Daniel Switkin)
Gets the requested bit, where true means black.
@param x The horizontal component (i.e. which column)
@param y The vertical component (i.e. which row)
@return value of given bit in matrix
Sets the given bit to true.
@param x The horizontal component (i.e. which column)
@param y The vertical component (i.e. which row)
Flips the given bit.
@param x The horizontal component (i.e. which column)
@param y The vertical component (i.e. which row)
Clears all bits (sets to false).
Sets a square region of the bit matrix to true.
@param left The horizontal position to begin at (inclusive)
@param top The vertical position to begin at (inclusive)
@param width The width of the region
@param height The height of the region
A fast method to retrieve one row of data from the matrix as a BitArray.
@param y The row to retrieve
@param row An optional caller-allocated BitArray, will be allocated if null or too small
@return The resulting BitArray - this reference should always be used even when passing
your own row
@return The width of the matrix
@return The height of the matrix
This method is for compatibility with older code. It's only logical to call if the matrix
is square, so I'm throwing if that's not the case.
@return row/column dimension of this matrix
JAVAPORT: This should be combined with BitArray in the future, although that class is not yet
dynamically resizeable. This implementation is reasonable but there is a lot of function calling
in loops I'd like to get rid of.
@author satorux@google.com (Satoru Takabayashi) - creator
@author dswitkin@google.com (Daniel Switkin) - ported from C++
This class implements an array of unsigned bytes.
@author dswitkin@google.com (Daniel Switkin)
Access an unsigned byte at location index.
@param index The index in the array to access.
@return The unsigned value of the byte as an int.
Encapsulates a Character Set ECI, according to "Extended Channel Interpretations" 5.3.1.1
of ISO 18004.
@author Sean Owen
@param name character set ECI encoding name
@return {@link CharacterSetECI} representing ECI for character encoding, or null if it is legal
but unsupported
These are a set of hints that you may pass to Writers to specify their behavior.
@author dswitkin@google.com (Daniel Switkin)
Specifies what degree of error correction to use, for example in QR Codes (type Integer).
Specifies what character encoding to use where applicable (type String)
@author satorux@google.com (Satoru Takabayashi) - creator
@author dswitkin@google.com (Daniel Switkin) - ported from C++
Encode "bytes" with the error correction level "ecLevel". The encoding mode will be chosen
internally by ChooseMode(). On success, store the result in "qrCode".
We recommend you to use QRCode.EC_LEVEL_L (the lowest level) for
"getECLevel" since our primary use is to show QR code on desktop screens. We don't need very
strong error correction for this purpose.
Note that there is no way to encode bytes in MODE_KANJI. We might want to add EncodeWithMode()
with which clients can specify the encoding mode. For now, we don't need the functionality.
@return the code point of the table used in alphanumeric mode or
-1 if there is no corresponding code in the table.
Choose the best mode by examining the content. Note that 'encoding' is used as a hint;
if it is Shift_JIS, and the input is only double-byte Kanji, then we return {@link Mode#KANJI}.
Initialize "qrCode" according to "numInputBytes", "ecLevel", and "mode". On success,
modify "qrCode".
Terminate bits as described in 8.4.8 and 8.4.9 of JISX0510:2004 (p.24).
Get number of data bytes and number of error correction bytes for block id "blockID". Store
the result in "numDataBytesInBlock", and "numECBytesInBlock". See table 12 in 8.5.1 of
JISX0510:2004 (p.30)
Interleave "bits" with corresponding error correction bytes. On success, store the result in
"result". The interleave rule is complicated. See 8.6 of JISX0510:2004 (p.37) for details.
Append mode info. On success, store the result in "bits".
Append length info. On success, store the result in "bits".
Append "bytes" in "mode" mode (encoding) into "bits". On success, store the result in "bits".
See ISO 18004:2006, 6.5.1. This enum encapsulates the four error correction levels
defined by the QR code standard.
@author Sean Owen
L = ~7% correction
M = ~15% correction
Q = ~25% correction
H = ~30% correction
@param bits int containing the two bits encoding a QR Code's error correction level
@return {@link ErrorCorrectionLevel} representing the encoded error correction level
Encapsulates a QR Code's format information, including the data mask used and
error correction level.
@author Sean Owen
@see ErrorCorrectionLevel
See ISO 18004:2006, Annex C, Table C.1
Offset i holds the number of 1 bits in the binary representation of i
@param maskedFormatInfo1 format info indicator, with mask still applied
@param maskedFormatInfo2 second copy of same info; both are checked at the same time
to establish best match
@return information about the format it specifies, or null
if doesn't seem to match any known pattern
This class contains utility methods for performing mathematical operations over
the Galois Field GF(256). Operations use a given primitive polynomial in calculations.
Throughout this package, elements of GF(256) are represented as an int
for convenience and speed (but at the cost of memory).
Only the bottom 8 bits are really used.
@author Sean Owen
Create a representation of GF(256) using the given primitive polynomial.
@param primitive irreducible polynomial whose coefficients are represented by
the bits of an int, where the least-significant bit represents the constant
coefficient
@return the monomial representing coefficient * x^degree
Implements both addition and subtraction -- they are the same in GF(256).
@return sum/difference of a and b
@return 2 to the power of a in GF(256)
@return base 2 log of a in GF(256)
@return multiplicative inverse of a
@param a
@param b
@return product of a and b in GF(256)
Represents a polynomial whose coefficients are elements of GF(256).
Instances of this class are immutable.
Much credit is due to William Rucklidge since portions of this code are an indirect
port of his C++ Reed-Solomon implementation.
@author Sean Owen
@param field the {@link GF256} instance representing the field to use
to perform computations
@param coefficients coefficients as ints representing elements of GF(256), arranged
from most significant (highest-power term) coefficient to least significant
@throws IllegalArgumentException if argument is null or empty,
or if leading coefficient is 0 and this is not a
constant polynomial (that is, it is not the monomial "0")
@return degree of this polynomial
@return true iff this polynomial is the monomial "0"
@return coefficient of x^degree term in this polynomial
@return evaluation of this polynomial at a given point
@author satorux@google.com (Satoru Takabayashi) - creator
@author dswitkin@google.com (Daniel Switkin) - ported from C++
@author satorux@google.com (Satoru Takabayashi) - creator
@author dswitkin@google.com (Daniel Switkin) - ported from C++
See ISO 18004:2006, 6.4.1, Tables 2 and 3. This enum encapsulates the various modes in which
data can be encoded to bits in the QR code standard.
@author Sean Owen
@param bits four bits encoding a QR Code data mode
@return {@link Mode} encoded by these bits
@throws IllegalArgumentException if bits do not correspond to a known mode
@param version version in question
@return number of bits used, in this QR Code symbol {@link Version}, to encode the
count of characters that will follow encoded in this {@link Mode}
@author satorux@google.com (Satoru Takabayashi) - creator
@author dswitkin@google.com (Daniel Switkin) - ported from C++
This object renders a QR Code as a ByteMatrix 2D array of greyscale values.
@author dswitkin@google.com (Daniel Switkin)
Implements Reed-Solomon enbcoding, as the name implies.
@author Sean Owen
@author William Rucklidge
Thrown when an exception occurs during Reed-Solomon decoding, such as when
there are too many errors to correct.
@author Sean Owen
See ISO 18004:2006 Annex D
@author Sean Owen
See ISO 18004:2006 Annex D.
Element i represents the raw version bits that specify version i + 7
Deduces version information purely from QR Code dimensions.
@param dimension dimension in modules
@return {@link Version} for a QR Code of that dimension
@throws FormatException if dimension is not 1 mod 4
See ISO 18004:2006 Annex E
Encapsulates a set of error-correction blocks in one symbol version. Most versions will
use blocks of differing sizes within one version, so, this encapsulates the parameters for
each set of blocks. It also holds the number of error-correction codewords per block since it
will be the same across all blocks within one version.
Encapsualtes the parameters for one error-correction block in one symbol version.
This includes the number of data codewords, and the number of times a block with these
parameters is used consecutively in the QR code version's format.
See ISO 18004:2006 6.5.1 Table 9
A base class which covers the range of exceptions which may occur when encoding a barcode using
the Writer framework.
@author dswitkin@google.com (Daniel Switkin)
A field with the symbol check
A field with the symbol circle
A field with the symbol cross
A field with the symbol diamond
A field with the symbol square
A field with the symbol star
Holds value of property checkType.
Holds value of property onValue.
Holds value of property checked.
Creates a new instance of RadioCheckField
@param writer the document PdfWriter
@param box the field location and dimensions
@param fieldName the field name. It must not be null
@param onValue the value when the field is checked
Sets the checked symbol. It can be
TYPE_CHECK
,
TYPE_CIRCLE
,
TYPE_CROSS
,
TYPE_DIAMOND
,
TYPE_SQUARE
and
TYPE_STAR
.
@param checkType the checked symbol
Sets the value when the field is checked.
@param onValue the value when the field is checked
Sets the state of the field to checked or unchecked.
@param checked the state of the field, true
for checked
and false
for unchecked
Gets the field appearance.
@param isRadio true
for a radio field and false
for a check field
@param on true
for the checked state, false
otherwise
@throws IOException on error
@throws DocumentException on error
@return the appearance
Gets the special field appearance for the radio circle.
@param on true
for the checked state, false
otherwise
@return the appearance
Gets a radio group. It's composed of the field specific keys, without the widget
ones. This field is to be used as a field aggregator with {@link PdfFormField#addKid(PdfFormField) AddKid()}.
@param noToggleToOff if true
, exactly one radio button must be selected at all
times; clicking the currently selected button has no effect.
If false
, clicking
the selected button deselects it, leaving no button selected.
@param radiosInUnison if true
, a group of radio buttons within a radio button field that
use the same value for the on state will turn on and off in unison; that is if
one is checked, they are all checked. If false
, the buttons are mutually exclusive
(the same behavior as HTML radio buttons)
@return the radio group
Gets the radio field. It's only composed of the widget keys and must be used
with {@link #getRadioGroup(bool,bool)}.
@return the radio field
@throws IOException on error
@throws DocumentException on error
Gets the check field.
@return the check field
@throws IOException on error
@throws DocumentException on error
Gets a radio or check field.
@param isRadio true
to get a radio field, false
to get
a check field
@throws IOException on error
@throws DocumentException on error
@return the field
Intended to be layered on top of a low level RandomAccessSource object. Provides
functionality useful during parsing:
- tracks current position in the file
- allows single byte pushback
- allows reading of multi-byte data structures (int, long, String) for both Big and Little Endian representations
- allows creation of independent 'views' of the underlying data source
@author Paulo Soares, Kevin Day
The source that backs this object
The physical location in the underlying byte source.
the pushed back byte, if any
Whether there is a pushed back byte
@deprecated use {@link RandomAccessFileOrArray#RandomAccessFileOrArray(RandomAccessSource)} instead
@param filename
@throws IOException
Creates an independent view of the specified source. Closing the new object will not close the source.
Closing the source will have adverse effect on the behavior of the new view.
@deprecated use {@link RandomAccessFileOrArray#createView()} instead
@param source the source for the new independent view
Creates an independent view of this object (with it's own file pointer and pushback queue). Closing the new object will not close this object.
Closing this object will have adverse effect on the view.
@return the new view
Creates a RandomAccessFileOrArray that wraps the specified byte source. The byte source will be closed when
this RandomAccessFileOrArray is closed.
@param byteSource the byte source to wrap
Constructs a new RandomAccessFileOrArrayObject
@param filename the file to open (can be a file system file or one of the following url strings: file://, http://, https://, jar:, wsjar:, vfszip:
@param forceRead if true, the entire file will be read into memory
@param plainRandomAccess if true, a regular RandomAccessFile is used to access the file contents. If false, a memory mapped file will be used, unless the file cannot be mapped into memory, in which case regular RandomAccessFile will be used
@throws IOException if there is a failure opening or reading the file
@deprecated use {@link RandomAccessSourceFactory#createBestSource(String)} and {@link RandomAccessFileOrArray#RandomAccessFileOrArray(RandomAccessSource)} instead
@param url
@throws IOException
@deprecated use {@link RandomAccessSourceFactory#createSource(URL)} and {@link RandomAccessFileOrArray#RandomAccessFileOrArray(RandomAccessSource)} instead
@param is
@throws IOException
@deprecated use {@link RandomAccessSourceFactory#createSource(InputStream)} and {@link RandomAccessFileOrArray#RandomAccessFileOrArray(RandomAccessSource)} instead
@param arrayIn
@throws IOException
@deprecated use {@link RandomAccessSourceFactory#createSource(byte[])} and {@link RandomAccessFileOrArray#RandomAccessFileOrArray(RandomAccessSource)} instead
Pushes a byte back. The next get() will return this byte instead of the value from the underlying data source
@param b the byte to push
Reads a single byte
@return the byte, or -1 if EOF is reached
@throws IOException
This class allows you to sign with either an RSACryptoServiceProvider/DSACryptoServiceProvider from a X509Certificate2,
or from manually created RSACryptoServiceProvider/DSACryptoServiceProvider.
Depending on the certificate's CSP, sometimes you will not be able to sign with SHA-256/SHA-512 hash algorithm with
RSACryptoServiceProvider taken directly from the certificate.
This class allows you to use a workaround in this case and sign with certificate's private key and SHA-256/SHA-512 anyway.
An example of a workaround for CSP that does not support SHA-256/SHA-512:
if (certificate.PrivateKey is RSACryptoServiceProvider)
{
RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)certificate.PrivateKey;
// Modified by J. Arturo
// Workaround for SHA-256 and SHA-512
if (rsa.CspKeyContainerInfo.ProviderName == "Microsoft Strong Cryptographic Provider" ||
rsa.CspKeyContainerInfo.ProviderName == "Microsoft Enhanced Cryptographic Provider v1.0" ||
rsa.CspKeyContainerInfo.ProviderName == "Microsoft Base Cryptographic Provider v1.0")
{
string providerName = "Microsoft Enhanced RSA and AES Cryptographic Provider";
int providerType = 24;
Type CspKeyContainerInfo_Type = typeof(CspKeyContainerInfo);
FieldInfo CspKeyContainerInfo_m_parameters = CspKeyContainerInfo_Type.GetField("m_parameters", BindingFlags.NonPublic | BindingFlags.Instance);
CspParameters parameters = (CspParameters)CspKeyContainerInfo_m_parameters.GetValue(rsa.CspKeyContainerInfo);
var cspparams = new CspParameters(providerType, providerName, rsa.CspKeyContainerInfo.KeyContainerName);
cspparams.Flags = parameters.Flags;
using (var rsaKey = new RSACryptoServiceProvider(cspparams))
{
// use rsaKey now
}
}
else
{
// Use rsa directly
}
}
The hash algorithm.
The encryption algorithm (obtained from the private key)
Returns the encryption algorithm used for signing.
@return the encryption algorithm ("RSA" or "DSA")
@see com.itextpdf.text.pdf.security.ExternalSignature#getEncryptionAlgorithm()
Interface to sign a document. The signing is fully done externally, including the container composition.
@author Paulo Soares
Produces the container with the signature.
@param data the data to sign
@return a container with the signature and other objects, like CRL and OCSP. The container will generally be a PKCS7 one.
@throws GeneralSecurityException
Modifies the signature dictionary to suit the container. At least the keys PdfName.FILTER and
PdfName.SUBFILTER will have to be set.
@param signDic the signature dictionary
Helps to locate xml stream
Constructor for XPath2 expression
Get XPath2 expression
Get XmlNamespaceManager to resolve namespace conflicts
Class that signs your XML.
Signs the xml using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).
@param sap the XmlSignatureAppearance
@param externalSignature the interface providing the actual signing
@param keyInfo KeyInfo for verification
@throws GeneralSecurityException
@throws IOException
@throws DocumentException
Signs the xml with XAdES BES using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).
@param sap the XmlSignatureAppearance
@param externalSignature the interface providing the actual signing
@param chain the certificate chain
@param includeSignaturePolicy if true SignaturePolicyIdentifier will be included (XAdES-EPES)
@throws GeneralSecurityException
@throws IOException
@throws DocumentException
Signs the xml with XAdES BES using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).
@param sap the XmlSignatureAppearance
@param externalSignature the interface providing the actual signing
@param chain the certificate chain
@throws GeneralSecurityException
@throws IOException
@throws DocumentException
Signs the xml with XAdES BES using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).
@param sap the XmlSignatureAppearance
@param externalSignature the interface providing the actual signing
@param chain the certificate chain
@throws GeneralSecurityException
@throws IOException
@throws DocumentException
Signs the xml using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).
@param sap the XmlSignatureAppearance
@param externalSignature the interface providing the actual signing
@param chain the certificate chain
@throws GeneralSecurityException
@throws IOException
@throws DocumentException
Signs the xml using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).
@param sap the XmlSignatureAppearance
@param externalSignature the interface providing the actual signing
@param publicKey PublicKey for verification
@throws GeneralSecurityException
@throws IOException
@throws DocumentException
A dictionary that stores the name of the application that signs the PDF.
Creates new PdfSignatureAppDictionary
Sets the signature created property in the Prop_Build dictionary's App
dictionary
@param name
Dictionary that stores signature build properties.
@author Kwinten Pisman
Creates new PdfSignatureBuildProperties
Sets the signatureCreator property in the underlying
{@link PdfSignatureAppDictionary} dictionary.
@param name
Gets the {@link PdfSignatureAppDictionary} from this dictionary. If it
does not exist, it adds a new {@link PdfSignatureAppDictionary} and
returns this instance.
@return {@link PdfSignatureAppDictionary}
Class that encapsulates the signature policy information
@author J. Arturo
Sample:
SignaturePolicyInfo spi = new SignaturePolicyInfo("2.16.724.1.3.1.1.2.1.9",
"G7roucf600+f03r/o0bAOQ6WAs0=", "SHA-1", "https://sede.060.gob.es/politica_de_firma_anexo_1.pdf");
Class containing static methods that allow you to get information from
an X509 Certificate: the issuer and the subject.
a class that holds an X509 name
country code - StringType(SIZE(2))
organization - StringType(SIZE(1..64))
organizational unit name - StringType(SIZE(1..64))
Title
common name - StringType(SIZE(1..64))
device serial number name - StringType(SIZE(1..64))
locality name - StringType(SIZE(1..64))
state, or province name - StringType(SIZE(1..64))
Naming attribute of type X520name
Naming attribute of type X520name
Naming attribute of type X520name
Naming attribute of type X520name
Naming attribute of type X520name
email address in Verisign certificates
object identifier
LDAP User id.
A Hashtable with default symbols
A Hashtable with values
Constructs an X509 name
@param seq an Asn1 Sequence
Constructs an X509 name
@param dirName a directory name
gets a field array from the values Hashmap
@param name
@return an ArrayList
getter for values
@return a Hashtable with the fields of the X509 name
@see java.lang.Object#toString()
class for breaking up an X500 Name into it's component tokens, ala
java.util.StringTokenizer. We need this class as some of the
lightweight Java environment don't support classes like
StringTokenizer.
Get the issuer fields from an X509 Certificate
@param cert an X509Certificate
@return an X509Name
Get the "issuer" from the TBSCertificate bytes that are passed in
@param enc a TBSCertificate in a byte array
@return a DERObject
Get the subject fields from an X509 Certificate
@param cert an X509Certificate
@return an X509Name
Get the "subject" from the TBSCertificate bytes that are passed in
@param enc A TBSCertificate in a byte array
@return a DERObject
This class contains a series of static methods that
allow you to retrieve information from a Certificate.
Gets the URL of the Certificate Revocation List for a Certificate
@param certificate the Certificate
@return the String where you can check if the certificate was revoked
@throws CertificateParsingException
@throws IOException
Retrieves the OCSP URL from the given certificate.
@param certificate the certificate
@return the URL or null
@throws IOException
Gets the URL of the TSA if it's available on the certificate
@param certificate a certificate
@return a TSA URL
@throws IOException
@param certificate the certificate from which we need the ExtensionValue
@param oid the Object Identifier value for the extension.
@return the extension value as an ASN1Primitive object
@throws IOException
Gets a String from an ASN1Primitive
@param names the ASN1Primitive
@return a human-readable String
@throws IOException
This class consists of some methods that allow you to verify certificates.
Verifies a single certificate.
@param cert the certificate to verify
@param crls the certificate revocation list or null
@param calendar the date or null
for the current date
@return a String
with the error description or null
if no error
Verifies a certificate chain against a KeyStore.
@param certs the certificate chain
@param keystore the KeyStore
@param crls the certificate revocation list or null
@param calendar the date or null
for the current date
@return null
if the certificate chain could be validated or a
Object[]{cert,error}
where cert
is the
failed certificate and error
is the error message
Verifies a certificate chain against a KeyStore.
@param certs the certificate chain
@param keystore the KeyStore
@param calendar the date or null
for the current date
@return null
if the certificate chain could be validated or a
Object[]{cert,error}
where cert
is the
failed certificate and error
is the error message
Verifies an OCSP response against a KeyStore.
@param ocsp the OCSP response
@param keystore the KeyStore
@param provider the provider or null
to use the BouncyCastle provider
@return true
is a certificate was found
Verifies a time stamp against a KeyStore.
@param ts the time stamp
@param keystore the KeyStore
@param provider the provider or null
to use the BouncyCastle provider
@return true
is a certificate was found
The previous CertificateVerifier in the chain of verifiers.
Indicates if going online to verify a certificate is allowed.
Creates the CertificateVerifier in a chain of verifiers.
@param verifier the previous verifier in the chain
Decide whether or not online checking is allowed.
@param onlineCheckingAllowed
Checks the validity of the certificate, and calls the next
verifier in the chain, if any.
@param signCert the certificate that needs to be checked
@param issuerCert its issuer
@param signDate the date the certificate needs to be valid
@return a list of VerificationOK
objects.
The list will be empty if the certificate couldn't be verified.
@throws GeneralSecurityException
@throws IOException
An implementation of the CrlClient that handles offline
Certificate Revocation Lists.
@author Paulo Soares
The CRL as a byte array.
Creates an instance of a CrlClient in case you
have a local cache of the Certificate Revocation List.
@param crlEncoded the CRL bytes
Returns the CRL bytes (the parameters are ignored).
@see com.itextpdf.text.pdf.security.CrlClient#getEncoded(java.security.cert.X509Certificate, java.lang.String)
An implementation of the CrlClient that fetches the CRL bytes
from an URL.
@author Paulo Soares
The Logger instance.
The URLs of the CRLs.
Creates a CrlClientOnline instance that will try to find
a single CRL by walking through the certificate chain.
Creates a CrlClientOnline instance using one or more URLs.
Creates a CrlClientOnline instance using a certificate chain.
Adds an URL to the list of CRL URLs
@param url an URL in the form of a String
Fetches the CRL bytes from an URL.
If no url is passed as parameter, the url will be obtained from the certificate.
If you want to load a CRL from a local file, subclass this method and pass an
URL with the path to the local file to this method. An other option is to use
the CrlClientOffline class.
@see com.itextpdf.text.pdf.security.CrlClient#getEncoded(java.security.cert.X509Certificate, java.lang.String)
The Logger instance
The list of CRLs to check for revocation date.
Creates a CRLVerifier instance.
@param verifier the next verifier in the chain
@param crls a list of CRLs
Verifies if a a valid CRL is found for the certificate.
If this method returns false, it doesn't mean the certificate isn't valid.
It means we couldn't verify it against any CRL that was available.
@param signCert the certificate that needs to be checked
@param issuerCert its issuer
@return a list of VerificationOK
objects.
The list will be empty if the certificate couldn't be verified.
@see com.itextpdf.text.pdf.security.RootStoreVerifier#verify(java.security.cert.X509Certificate, java.security.cert.X509Certificate, java.util.Date)
Verifies a certificate against a single CRL.
@param crl the Certificate Revocation List
@param signCert a certificate that needs to be verified
@param issuerCert its issuer
@param signDate the sign date
@return true if the verification succeeded
@throws GeneralSecurityException
Fetches a CRL for a specific certificate online (without further checking).
@param signCert the certificate
@param issuerCert its issuer
@return an X509CRL object
Checks if a CRL verifies against the issuer certificate or a trusted anchor.
@param crl the CRL
@param crlIssuer the trusted anchor
@return true if the CRL can be trusted
Class that contains a map with the different message digest algorithms.
Algorithm available for signatures since PDF 1.3
Algorithm available for signatures since PDF 1.6
Algorithm available for signatures since PDF 1.7
Algorithm available for signatures since PDF 1.7
Algorithm available for signatures since PDF 1.7
Maps the digest IDs with the human-readable name of the digest algorithm.
Maps the name of a digest algorithm with its ID.
Creates a MessageDigest object that can be used to create a hash.
@param hashAlgorithm the algorithm you want to use to create a hash
@param provider the provider you want to use to create the hash
@return a MessageDigest object
@throws NoSuchAlgorithmException
@throws NoSuchProviderException
@throws GeneralSecurityException
Creates a hash using a specific digest algorithm and a provider.
@param data the message of which you want to create a hash
@param hashAlgorithm the algorithm used to create the hash
@param provider the provider used to create the hash
@return the hash
@throws GeneralSecurityException
@throws IOException
Gets the digest name for a certain id
@param oid an id (for instance "1.2.840.113549.2.5")
@return a digest name (for instance "MD5")
Returns the id of a digest algorithms that is allowed in PDF,
or null if it isn't allowed.
@param name the name of the digest algorithm
@return an oid
Class that contains a map with the different encryption algorithms.
Maps IDs of encryption algorithms with its human-readable name.
Gets the algorithm name for a certain id.
@param oid an id (for instance "1.2.840.113549.1.1.1")
@return an algorithm name (for instance "RSA")
@since 2.1.6
Interface that needs to be implemented if you want to embed
Certificate Revocation Lists into your PDF.
@author Paulo Soares
Gets a collection of byte array each representing a crl.
@param checkCert the certificate from which a CRL URL can be obtained
@param url a CRL url if you don't want to obtain it from the certificate
@return a collection of byte array each representing a crl. It may return null or an empty collection
Interface that needs to be implemented to do the actual signing.
For instance: you'll have to implement this interface if you want
to sign a PDF using a smart card.
@author Paulo Soares
Returns the hash algorithm.
@return the hash algorithm (e.g. "SHA-1", "SHA-256,...")
Returns the encryption algorithm used for signing.
@return the encryption algorithm ("RSA" or "DSA")
Signs it using the encryption algorithm in combination with
the digest algorithm.
@param message the message you want to be hashed and signed
@return a signed message digest
@throws GeneralSecurityException
Interface for the OCSP Client.
@since 2.1.6
* Gets an encoded byte array with OCSP validation. The method should not throw an exception.
* @param checkCert to certificate to check
* @param rootCert the parent certificate
* @param url the url to get the verification. It it's null it will be taken
* from the check cert or from other implementation specific source
* @return a byte array with the validation or null if the validation could not be obtained
Get the time stamp token size estimate.
Implementation must return value large enough to accomodate the entire token
returned by getTimeStampToken() _prior_ to actual getTimeStampToken() call.
@return an estimate of the token size
Gets the MessageDigest to digest the data imprint
@return the digest algorithm name
Get RFC 3161 timeStampToken.
Method may return null indicating that timestamp should be skipped.
@param imprint byte[] - data imprint to be time-stamped
@return byte[] - encoded, TSA signed data of the timeStampToken
@throws Exception - TSA request failed
PAdES-LTV Timestamp
@author Pulo Soares
Signs a document with a PAdES-LTV Timestamp. The document is closed at the end.
@param sap the signature appearance
@param tsa the timestamp generator
@param signatureName the signature name or null to have a name generated
automatically
@throws Exception
Add verification according to PAdES-LTV (part 4)
@author psoares
What type of verification to include
Include only OCSP
Include only CRL
Include both OCSP and CRL
Include CRL only if OCSP can't be read
Options for how many certificates to include
Include verification just for the signing certificate
Include verification for the whole chain of certificates
Certificate inclusion in the DSS and VRI dictionaries in the CERT and CERTS
keys
Include certificates in the DSS and VRI dictionaries
Do not include certificates in the DSS and VRI dictionaries
The verification constructor. This class should only be created with
PdfStamper.getLtvVerification() otherwise the information will not be
added to the Pdf.
@param stp the PdfStamper to apply the validation to
Add verification for a particular signature
@param signatureName the signature to validate (it may be a timestamp)
@param ocsp the interface to get the OCSP
@param crl the interface to get the CRL
@param certOption
@param level the validation options to include
@param certInclude
@return true if a validation was generated, false otherwise
@throws Exception
Returns the issuing certificate for a child certificate.
@param cert the certificate for which we search the parent
@param certs an array with certificates that contains the parent
@return the partent certificate
Alternative addVerification.
I assume that inputs are deduplicated.
@throws IOException
@throws GeneralSecurityException
Merges the validation with any validation already in the document or creates
a new one.
@throws IOException
The Logger instance
Do we need to check all certificate, or only the signing certificate?
Verify root.
A reader object for the revision that is being verified.
The fields in the revision that is being verified.
The date the revision was signed, or null
for the highest revision.
The signature that covers the revision.
The PdfPKCS7 object for the signature.
Indicates if we're working with the latest revision.
The document security store for the revision that is being verified
Creates a VerificationData object for a PdfReader
@param reader a reader for the document we want to verify.
@throws GeneralSecurityException
Sets an extra verifier.
@param verifier the verifier to set
Sets the certificate option.
@param option Either CertificateOption.SIGNING_CERTIFICATE (default) or CertificateOption.WHOLE_CHAIN
Set the verifyRootCertificate to false if you can't verify the root certificate.
Checks if the signature covers the whole document
and throws an exception if the document was altered
@return a PdfPKCS7 object
@throws GeneralSecurityException
Verifies all the document-level timestamps and all the signatures in the document.
@throws IOException
@throws GeneralSecurityException
Verifies a document level timestamp.
@throws GeneralSecurityException
@throws IOException
Checks the certificates in a certificate chain:
are they valid on a specific date, and
do they chain up correctly?
@param chain
@throws GeneralSecurityException
Verifies certificates against a list of CRLs and OCSP responses.
@param signingCert
@param issuerCert
@return a list of VerificationOK
objects.
The list will be empty if the certificate couldn't be verified.
@throws GeneralSecurityException
@throws IOException
@see com.itextpdf.text.pdf.security.RootStoreVerifier#verify(java.security.cert.X509Certificate, java.security.cert.X509Certificate)
Switches to the previous revision.
@throws IOException
@throws GeneralSecurityException
Gets a list of X509CRL objects from a Document Security Store.
@return a list of CRLs
@throws GeneralSecurityException
@throws IOException
Gets OCSP responses from the Document Security Store.
@return a list of BasicOCSPResp objects
@throws IOException
@throws GeneralSecurityException
Class that signs your PDF.
@author Paulo Soares
The Logger instance.
Signs the document using the detached mode, CMS or CAdES equivalent.
@param sap the PdfSignatureAppearance
@param externalSignature the interface providing the actual signing
@param chain the certificate chain
@param crlList the CRL list
@param ocspClient the OCSP client
@param tsaClient the Timestamp client
@param provider the provider or null
@param estimatedSize the reserved size for the signature. It will be estimated if 0
@param cades true to sign CAdES equivalent PAdES-BES, false to sign CMS
@throws DocumentException
@throws IOException
@throws GeneralSecurityException
@throws NoSuchAlgorithmException
@throws Exception
Signs the document using the detached mode, CMS or CAdES equivalent.
@param sap the PdfSignatureAppearance
@param externalSignature the interface providing the actual signing
@param chain the certificate chain
@param crlList the CRL list
@param ocspClient the OCSP client
@param tsaClient the Timestamp client
@param provider the provider or null
@param estimatedSize the reserved size for the signature. It will be estimated if 0
@param cades true to sign CAdES equivalent PAdES-BES, false to sign CMS
@param signaturePolicy the signature policy (for EPES signatures)
@throws DocumentException
@throws IOException
@throws GeneralSecurityException
@throws NoSuchAlgorithmException
@throws Exception
Signs the document using the detached mode, CMS or CAdES equivalent.
@param sap the PdfSignatureAppearance
@param externalSignature the interface providing the actual signing
@param chain the certificate chain
@param crlList the CRL list
@param ocspClient the OCSP client
@param tsaClient the Timestamp client
@param provider the provider or null
@param estimatedSize the reserved size for the signature. It will be estimated if 0
@param cades true to sign CAdES equivalent PAdES-BES, false to sign CMS
@param signaturePolicy the signature policy (for EPES signatures)
@throws DocumentException
@throws IOException
@throws GeneralSecurityException
@throws NoSuchAlgorithmException
@throws Exception
Processes a CRL list.
@param cert a Certificate if one of the CrlList implementations needs to retrieve the CRL URL from it.
@param crlList a list of CrlClient implementations
@return a collection of CRL bytes that can be embedded in a PDF.
Sign the document using an external container, usually a PKCS7. The signature is fully composed
externally, iText will just put the container inside the document.
@param sap the PdfSignatureAppearance
@param externalSignatureContainer the interface providing the actual signing
@param estimatedSize the reserved size for the signature
@throws GeneralSecurityException
@throws IOException
@throws DocumentException
Signs a PDF where space was already reserved.
@param reader the original PDF
@param fieldName the field to sign. It must be the last field
@param outs the output PDF
@param externalSignatureContainer the signature container doing the actual signing. Only the
method ExternalSignatureContainer.sign is used
@throws DocumentException
@throws IOException
@throws GeneralSecurityException
OcspClient implementation using BouncyCastle.
@author Paulo Soares
Create default implemention of {@code OcspClient}.
Note, if you use this constructor, OCSP response will not be verified.
Create {@code OcspClient}
@param verifier will be used for response verification. {@see OCSPVerifier}.
Gets OCSP response. If {@see OCSPVerifier} was set, the response will be checked.
Gets an encoded byte array with OCSP validation. The method should not throw an exception.
@param checkCert to certificate to check
@param rootCert the parent certificate
@param url to get the verification. It it's null it will be taken
from the check cert or from other implementation specific source
@return a byte array with the validation or null if the validation could not be obtained
Generates an OCSP request using BouncyCastle.
@param issuerCert certificate of the issues
@param serialNumber serial number
@return an OCSP request
@throws OCSPException
@throws IOException
The Logger instance
The list of OCSP responses.
Creates an OCSPVerifier instance.
@param verifier the next verifier in the chain
@param ocsps a list of OCSP responses
Verifies if a a valid OCSP response is found for the certificate.
If this method returns false, it doesn't mean the certificate isn't valid.
It means we couldn't verify it against any OCSP response that was available.
@param signCert the certificate that needs to be checked
@param issuerCert its issuer
@return a list of VerificationOK
objects.
The list will be empty if the certificate couldn't be verified.
@see com.itextpdf.text.pdf.security.RootStoreVerifier#verify(java.security.cert.X509Certificate, java.security.cert.X509Certificate, java.util.Date)
Verifies a certificate against a single OCSP response
@param ocspResp the OCSP response
@param signCert the certificate that needs to be checked
@param issuerCert the certificate of CA
@param signDate sign date
@return {@code true}, in case successful check, otherwise false.
@throws GeneralSecurityException
@throws IOException
Verifies if an OCSP response is genuine
If it doesn't verify against the issuer certificate and response's certificates, it may verify
using a trusted anchor or cert.
@param ocspResp the OCSP response
@param issuerCert the issuer certificate
@throws GeneralSecurityException
@throws IOException
Verifies if the response is valid.
If it doesn't verify against the issuer certificate and response's certificates, it may verify
using a trusted anchor or cert.
NOTE. Use {@code isValidResponse()} instead.
@param ocspResp the response object
@param issuerCert the issuer certificate
@return true if the response can be trusted
Checks if an OCSP response is genuine
@param ocspResp the OCSP response
@param responderCert the responder certificate
@return true if the OCSP response verifies against the responder certificate
Gets an OCSP response online and returns it if the status is GOOD
(without further checking).
@param signCert the signing certificate
@param issuerCert the issuer certificate
@return an OCSP response
This class does all the processing related to signing
and verifying a PKCS#7 signature.
Assembles all the elements needed to create a signature, except for the data.
@param privKey the private key
@param certChain the certificate chain
@param interfaceDigest the interface digest
@param hashAlgorithm the hash algorithm
@param provider the provider or null
for the default provider
@param hasRSAdata true
if the sub-filter is adbe.pkcs7.sha1
@throws InvalidKeyException on error
@throws NoSuchProviderException on error
@throws NoSuchAlgorithmException on error
Use this constructor if you want to verify a signature using the sub-filter adbe.x509.rsa_sha1.
@param contentsKey the /Contents key
@param certsKey the /Cert key
Use this constructor if you want to verify a signature.
@param contentsKey the /Contents key
@param filterSubtype the filtersubtype
@param provider the provider or null
for the default provider
Holds value of property signName.
Holds value of property reason.
Holds value of property location.
Holds value of property signDate.
Getter/setter for property sigName.
@return Value of property sigName.
Getter for property reason.
@return Value of property reason.
Getter for property location.
@return Value of property location.
Getter for property signDate.
@return Value of property signDate.
Version of the PKCS#7 object
Version of the PKCS#7 "SignerInfo" object.
Get the version of the PKCS#7 object.
@return the version of the PKCS#7 object.
Get the version of the PKCS#7 "SignerInfo" object.
@return the version of the PKCS#7 "SignerInfo" object.
The ID of the digest algorithm, e.g. "2.16.840.1.101.3.4.2.1".
The object that will create the digest
The digest algorithms
The digest attributes
Getter for the ID of the digest algorithm, e.g. "2.16.840.1.101.3.4.2.1"
Returns the name of the digest algorithm, e.g. "SHA256".
@return the digest algorithm name, e.g. "SHA256"
The encryption algorithm.
Getter for the digest encryption algorithm
Get the algorithm used to calculate the message digest, e.g. "SHA1withRSA".
@return the algorithm used to calculate the message digest
The signed digest if created outside this class
External RSA data
Sets the digest/signature to an external calculated value.
@param digest the digest. This is the actual signature
@param RSAdata the extra data that goes into the data tag in PKCS#7
@param digestEncryptionAlgorithm the encryption algorithm. It may must be null
if the digest
is also null
. If the digest
is not null
then it may be "RSA" or "DSA"
Class from the Java SDK that provides the functionality of a digital signature algorithm.
The signed digest as calculated by this class (or extracted from an existing PDF)
The RSA data
Update the digest with the specified bytes.
This method is used both for signing and verifying
@param buf the data buffer
@param off the offset in the data buffer
@param len the data length
@throws SignatureException on error
Gets the bytes for the PKCS#1 object.
@return a byte array
Gets the bytes for the PKCS7SignedData object.
@return the bytes for the PKCS7SignedData object
Gets the bytes for the PKCS7SignedData object. Optionally the authenticatedAttributes
in the signerInfo can also be set. If either of the parameters is null
, none will be used.
@param secondDigest the digest in the authenticatedAttributes
@return the bytes for the PKCS7SignedData object
Gets the bytes for the PKCS7SignedData object. Optionally the authenticatedAttributes
in the signerInfo can also be set, OR a time-stamp-authority client
may be provided.
@param secondDigest the digest in the authenticatedAttributes
@param tsaClient TSAClient - null or an optional time stamp authority client
@return byte[] the bytes for the PKCS7SignedData object
@since 2.1.6
Added by Aiken Sam, 2006-11-15, modifed by Martin Brunecky 07/12/2007
to start with the timeStampToken (signedData 1.2.840.113549.1.7.2).
Token is the TSA response without response status, which is usually
handled by the (vendor supplied) TSA request/response interface).
@param timeStampToken byte[] - time stamp token, DER encoded signedData
@return ASN1EncodableVector
@throws IOException
This method provides that encoding and the parameters must be
exactly the same as in {@link #getEncodedPKCS7(byte[],Calendar)}.
@param secondDigest the content digest
@return the byte array representation of the authenticatedAttributes ready to be signed
Signature attributes
Signature attributes (maybe not necessary, but we use it as fallback)
encrypted digest
Indicates if a signature has already been verified
The result of the verification
Verify the digest.
@throws SignatureException on error
@return true
if the signature checks out, false
otherwise
Checks if the timestamp refers to this document.
@throws java.security.NoSuchAlgorithmException on error
@return true if it checks false otherwise
@since 2.1.6
All the X.509 certificates in no particular order.
All the X.509 certificates used for the main signature.
The X.509 certificate that is used to sign the digest.
Get all the X.509 certificates associated with this PKCS#7 object in no particular order.
Other certificates, from OCSP for example, will also be included.
@return the X.509 certificates associated with this PKCS#7 object
Get the X.509 sign certificate chain associated with this PKCS#7 object.
Only the certificates used for the main signature will be returned, with
the signing certificate first.
@return the X.509 certificates associated with this PKCS#7 object
@since 2.1.6
Get the X.509 certificate actually used to sign the digest.
@return the X.509 certificate actually used to sign the digest
Helper method that creates the collection of certificates
used for the main signature based on the complete list
of certificates and the sign certificate.
Get the X.509 certificate revocation lists associated with this PKCS#7 object
@return the X.509 certificate revocation lists associated with this PKCS#7 object
Helper method that tries to construct the CRLs.
BouncyCastle BasicOCSPResp
Gets the OCSP basic response if there is one.
@return the OCSP basic response or null
@since 2.1.6
Checks if OCSP revocation refers to the document signing certificate.
@return true if it checks, false otherwise
@since 2.1.6
Helper method that creates the BasicOCSPResp object.
@param seq
@throws IOException
True if there's a PAdES LTV time stamp.
BouncyCastle TimeStampToken.
Check if it's a PAdES-LTV time stamp.
@return true if it's a PAdES-LTV time stamp, false otherwise
Gets the timestamp token if there is one.
@return the timestamp token or null
@since 2.1.6
Gets the timestamp date
@return a date
@since 2.1.6
Returns the filter subtype.
Returns the encryption algorithm
@return the name of an encryption algorithm
Implementation of the ExternalSignature interface that can be used
when you have a PrivateKey object.
@author Paulo Soares
The private key object.
The hash algorithm.
The encryption algorithm (obtained from the private key)
Creates an ExternalSignature instance
@param pk a PrivateKey object
@param hashAlgorithm the hash algorithm (e.g. "SHA-1", "SHA-256",...)
@param provider the security provider (e.g. "BC")
Creates a message digest using the hash algorithm
and signs it using the encryption algorithm.
@param message the message you want to be hashed and signed
@return a signed message digest
@see com.itextpdf.text.pdf.security.ExternalSignature#sign(byte[])
Returns the hash algorithm.
@return the hash algorithm (e.g. "SHA-1", "SHA-256,...")
@see com.itextpdf.text.pdf.security.ExternalSignature#getHashAlgorithm()
Returns the encryption algorithm used for signing.
@return the encryption algorithm ("RSA" or "DSA")
@see com.itextpdf.text.pdf.security.ExternalSignature#getEncryptionAlgorithm()
The Logger instance
A key store against which certificates can be verified.
Creates a RootStoreVerifier in a chain of verifiers.
@param verifier
the next verifier in the chain
Sets the Key Store against which a certificate can be checked.
@param keyStore
a root store
Verifies a single certificate against a key store (if present).
@param signCert
the certificate to verify
@param issuerCert
the issuer certificate
@param signDate
the date the certificate needs to be valid
@return a list of VerificationOK
objects.
The list will be empty if the certificate couldn't be verified.
A list of IDs that are used by the security classes
Class that contains a field lock action and
an array of the fields that are involved.
Can be /All, /Exclude or /Include
An array of PdfString values with fieldnames
Creates a FieldLock instance
Getter for the field lock action.
Getter for the fields involved in the lock action.
toString method
Is the signature a cerification signature (true) or an approval signature (false)?
Is form filling allowed by this signature?
Is adding annotations allowed by this signature?
Does this signature lock specific fields?
Creates an object that can inform you about the type of signature
in a signature dictionary as well as some of the permissions
defined by the signature.
Getter to find out if the signature is a certification signature.
@return true if the signature is a certification signature, false for an approval signature.
Getter to find out if filling out fields is allowed after signing.
@return true if filling out fields is allowed
Getter to find out if adding annotations is allowed after signing.
@return true if adding annotations is allowed
Getter for the field lock actions, and fields that are impacted by the action
@return an Array with field names
Time Stamp Authority Client interface implementation using Bouncy Castle
org.bouncycastle.tsp package.
Created by Aiken Sam, 2006-11-15, refactored by Martin Brunecky, 07/15/2007
for ease of subclassing.
@since 2.1.6
The Logger instance.
URL of the Time Stamp Authority
TSA Username
TSA password
An interface that allows you to inspect the timestamp info.
The default value for the hash algorithm
Estimate of the received time stamp token
The default value for the hash algorithm
Hash algorithm
TSA request policy
Creates an instance of a TSAClient that will use BouncyCastle.
@param url String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
Creates an instance of a TSAClient that will use BouncyCastle.
@param url String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
@param username String - user(account) name
@param password String - password
Constructor.
Note the token size estimate is updated by each call, as the token
size is not likely to change (as long as we call the same TSA using
the same imprint length).
@param url String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
@param username String - user(account) name
@param password String - password
@param tokSzEstimate int - estimated size of received time stamp token (DER encoded)
@param tsaInfo the tsaInfo to set
Get the token size estimate.
Returned value reflects the result of the last succesfull call, padded
@return an estimate of the token size
Gets the MessageDigest to digest the data imprint
@return the digest algorithm name
Get RFC 3161 timeStampToken.
Method may return null indicating that timestamp should be skipped.
@param imprint data imprint to be time-stamped
@return encoded, TSA signed data of the timeStampToken
Get timestamp token - communications layer
@return - byte[] - TSA response, raw bytes (RFC 3161 encoded)
Interface you can implement and pass to TSAClientBouncyCastle in case
you want to do something with the information returned
When a timestamp is created using TSAClientBouncyCastle,
this method is triggered passing an object that contains
info about the timestamp and the time stamping authority.
@param info a TimeStampTokenInfo object
An exception that is thrown when something is wrong with a certificate.
Creates a VerificationException
The certificate that was verified successfully.
The CertificateVerifier that was used for verifying.
The reason why the certificate verified successfully.
Creates a VerificationOK object
@param certificate the certificate that was successfully verified
@param verifierClass the class that was used for verification
@param message the reason why the certificate could be verified
A single String explaining which certificate was verified, how and why.
@see java.lang.Object#toString()
Creates a signature using a X509Certificate2. It supports smartcards without
exportable private keys.
The certificate with the private key
The hash algorithm.
The encryption algorithm (obtained from the private key)
Creates a signature using a X509Certificate2. It supports smartcards without
exportable private keys.
The certificate with the private key
The hash algorithm for the signature. As the Windows CAPI is used
to do the signature the only hash guaranteed to exist is SHA-1
Returns the hash algorithm.
@return the hash algorithm (e.g. "SHA-1", "SHA-256,...")
@see com.itextpdf.text.pdf.security.ExternalSignature#getHashAlgorithm()
Returns the encryption algorithm used for signing.
@return the encryption algorithm ("RSA" or "DSA")
@see com.itextpdf.text.pdf.security.ExternalSignature#getEncryptionAlgorithm()
Generates a list of numbers from a string.
@param ranges the comma separated ranges
@param maxNumber the maximum number in the range
@return a list with the numbers as Integer
Implements a shading pattern as a Color
.
@author Paulo Soares
Creates a new instance of SimpleBookmark
Gets number of indirect. If type of directed indirect is PAGES, it refers PAGE object through KIDS.
(Contributed by Kazuya Ujihara)
@param indirect
2004-06-13
Gets a List
with the bookmarks. It returns null
if
the document doesn't have any bookmarks.
@param reader the document
@return a List
with the bookmarks or null
if the
document doesn't have any
Gets a List
with the bookmarks that are children of outline
. It returns null
if
the document doesn't have any bookmarks.
@param reader the document
@param outline the outline dictionary to get bookmarks from
@param includeRoot indicates if to include outline
parameter itself into returned list of bookmarks
@return a List
with the bookmarks or null
if the
document doesn't have any
Removes the bookmark entries for a number of page ranges. The page ranges
consists of a number of pairs with the start/end page range. The page numbers
are inclusive.
@param list the bookmarks
@param pageRange the page ranges, always in pairs.
For the pages in range add the pageShift
to the page number.
The page ranges
consists of a number of pairs with the start/end page range. The page numbers
are inclusive.
@param list the bookmarks
@param pageShift the number to add to the pages in range
@param pageRange the page ranges, always in pairs. It can be null
to include all the pages
Exports the bookmarks to XML. Only of use if the generation is to be include in
some other XML document.
@param list the bookmarks
@param out the export destination. The writer is not closed
@param indent the indentation level. Pretty printing significant only. Use -1
for no indents.
@param onlyASCII codes above 127 will always be escaped with &#nn; if true
,
whatever the encoding
@throws IOException on error
Exports the bookmarks to XML.
@param list the bookmarks
@param wrt the export destination. The writer is not closed
@param encoding the encoding according to IANA conventions
@param onlyASCII codes above 127 will always be escaped with &#nn; if true
,
whatever the encoding
@throws IOException on error
Import the bookmarks from XML.
@param in the XML source. The stream is not closed
@throws IOException on error
@return the bookmarks
Import the bookmarks from XML.
@param in the XML source. The reader is not closed
@throws IOException on error
@return the bookmarks
@author Paulo Soares
Exports the bookmarks to XML.
@param names the names
@param wrt the export destination. The writer is not closed
@param encoding the encoding according to IANA conventions
@param onlyASCII codes above 127 will always be escaped with &#nn; if true
,
whatever the encoding
@throws IOException on error
Import the names from XML.
@param inp the XML source. The stream is not closed
@throws IOException on error
@return the names
Import the names from XML.
@param inp the XML source. The reader is not closed
@throws IOException on error
@return the names
@author psoares
Creates a new instance of StampContent
Gets a duplicate of this PdfContentByte
. All
the members are copied by reference but the buffer stays different.
@return a copy of this PdfContentByte
Escapes a byte
array according to the PDF conventions.
@param b the byte
array to escape
@return an escaped byte
array
Escapes a byte
array according to the PDF conventions.
@param b the byte
array to escape
Converts an array of unsigned 16bit numbers to an array of bytes.
The input values are presented as chars for convenience.
@param chars the array of 16bit numbers that should be converted
@return the resulting byte array, twice as large as the input
Supports text, combo and list fields generating the correct appearances.
All the option in the Acrobat GUI are supported in an easy to use API.
@author Paulo Soares
Holds value of property defaultText.
Holds value of property choices.
Holds value of property choiceExports.
Holds value of property choiceSelection.
Represents the /TI value
Creates a new TextField
.
@param writer the document PdfWriter
@param box the field location and dimensions
@param fieldName the field name. If null
only the widget keys
will be included in the field allowing it to be used as a kid field.
Obfuscates a password String
.
Every character is replaced by an asterisk (*).
@param text
@return String
@since 2.1.5
Get the PdfAppearance
of a text or combo field
@throws IOException on error
@throws DocumentException on error
@return A PdfAppearance
Get the PdfAppearance
of a list field
@throws IOException on error
@throws DocumentException on error
@return A PdfAppearance
Gets a new text field.
@throws IOException on error
@throws DocumentException on error
@return a new text field
Gets a new combo field.
@throws IOException on error
@throws DocumentException on error
@return a new combo field
Gets a new list field.
@throws IOException on error
@throws DocumentException on error
@return a new list field
Sets the default text. It is only meaningful for text fields.
@param defaultText the default text
Sets the choices to be presented to the user in list/combo
fields.
@param choices the choices to be presented to the user
Sets the export values in list/combo fields. If this array
is null
then the choice values will also be used
as the export values.
@param choiceExports the export values in list/combo fields
Sets the zero based index of the selected item.
@param choiceSelection the zero based index of the selected item
Sets the top visible choice for lists;
@since 5.5.3
@param visibleTopChoice index of the first visible item (zero-based array)
Returns the index of the top visible choice of a list. Default is -1.
@return the index of the top visible choice
Sets extra margins in text fields to better mimic the Acrobat layout.
@param extraMarginLeft the extra marging left
@param extraMarginTop the extra margin top
Holds value of property substitutionFonts.
Sets a list of substitution fonts. The list is composed of BaseFont
and can also be null
. The fonts in this list will be used if the original
font doesn't contain the needed glyphs.
@param substitutionFonts the list
Holds value of property extensionFont.
Sets the extensionFont. This font will be searched before the
substitution fonts. It may be null
.
@param extensionFont New value of property extensionFont.
Reads a Truetype font
@author Paulo Soares
The code pages possible for a True Type font.
Contains the location of the several tables. The key is the name of
the table and the value is an int[2]
where position 0
is the offset from the start of the file and position 1 is the length
of the table.
The file in use.
The file name.
The offset from the start of the file to the table directory.
It is 0 for TTF and may vary for TTC depending on the chosen font.
The index for the TTC font. It is an empty string
for a
TTF file.
The style modifier
The content of table 'head'.
The content of table 'hhea'.
The content of table 'OS/2'.
The width of the glyphs. This is essentially the content of table
'hmtx' normalized to 1000 units.
The map containing the code information for the table 'cmap', encoding 1.0.
The key is the code and the value is an int[2]
where position 0
is the glyph number and position 1 is the glyph width normalized to 1000
units.
By James for unicode Ext.B
The map containing the kerning information. It represents the content of
table 'kern'. The key is an Integer
where the top 16 bits
are the glyph number for the first character and the lower 16 bits are the
glyph number for the second character. The value is the amount of kerning in
normalized 1000 units as an Integer
. This value is usually negative.
The font name.
This name is usually extracted from the table 'name' with
the 'Name ID' 6.
The font subfamily
This subFamily name is usually extracted from the table 'name' with
the 'Name ID' 2 or 'Name ID' 17.
The full name of the font 'Name ID' 1 or 'Name ID' 16
All the names auf the Names-Table
The family name of the font
true
if all the glyphs have the same width.
The components of table 'head'.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
The components of table 'hhea'.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
The components of table 'OS/2'.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
This constructor is present to allow extending the class.
Creates a new TrueType font.
@param ttFile the location of the font on file. The file must end in '.ttf' or
'.ttc' but can have modifiers after the name
@param enc the encoding to be applied to this font
@param emb true if the font is to be embedded in the PDF
@param ttfAfm the font as a byte
array
@throws DocumentException the font is invalid
@throws IOException the font file could not be read
Gets the name from a composed TTC file name.
If I have for input "myfont.ttc,2" the return will
be "myfont.ttc".
@param name the full name
@return the simple file name
Reads the tables 'head', 'hhea', 'OS/2', 'post' and 'maxp' filling several variables.
@throws DocumentException the font is invalid
@throws IOException the font file could not be read
Gets the Postscript font name.
@throws DocumentException the font is invalid
@throws IOException the font file could not be read
@return the Postscript font name
Extracts the names of the font in all the languages available.
@param id the name id to retrieve
@throws DocumentException on error
@throws IOException on error
Extracts all the names of the names-Table
@param id the name id to retrieve
@throws DocumentException on error
@throws IOException on error
Reads the font data.
@param ttfAfm the font as a byte
array, possibly null
@throws DocumentException the font is invalid
@throws IOException the font file could not be read
Reads a string
from the font file as bytes using the Cp1252
encoding.
@param length the length of bytes to read
@return the string
read
@throws IOException the font file could not be read
Reads a Unicode string
from the font file. Each character is
represented by two bytes.
@param length the length of bytes to read. The string
will have length
/2
characters
@return the string
read
@throws IOException the font file could not be read
Reads the glyphs widths. The widths are extracted from the table 'hmtx'.
The glyphs are normalized to 1000 units.
@throws DocumentException the font is invalid
@throws IOException the font file could not be read
Gets a glyph width.
@param glyph the glyph to get the width of
@return the width of the glyph in normalized 1000 units
Reads the several maps from the table 'cmap'. The maps of interest are 1.0 for symbolic
fonts and 3.1 for all others. A symbolic font is defined as having the map 3.0.
@throws DocumentException the font is invalid
@throws IOException the font file could not be read
The information in the maps of the table 'cmap' is coded in several formats.
Format 0 is the Apple standard character to glyph index mapping table.
@return a Hashtable
representing this map
@throws IOException the font file could not be read
The information in the maps of the table 'cmap' is coded in several formats.
Format 4 is the Microsoft standard character to glyph index mapping table.
@return a Hashtable
representing this map
@throws IOException the font file could not be read
The information in the maps of the table 'cmap' is coded in several formats.
Format 6 is a trimmed table mapping. It is similar to format 0 but can have
less than 256 entries.
@return a Hashtable
representing this map
@throws IOException the font file could not be read
Reads the kerning information from the 'kern' table.
@throws IOException the font file could not be read
Gets the kerning between two Unicode chars.
@param char1 the first char
@param char2 the second char
@return the kerning to be applied
Gets the width from the font according to the unicode char c
.
If the name
is null it's a symbolic font.
@param c the unicode char
@param name the glyph name
@return the width of the char
Generates the font descriptor for this font.
@return the PdfDictionary containing the font descriptor or null
@param subsetPrefix the subset prefix
@param fontStream the indirect reference to a PdfStream containing the font or null
@throws DocumentException if there is an error
Generates the font dictionary for this font.
@return the PdfDictionary containing the font dictionary
@param subsetPrefix the subset prefx
@param firstChar the first valid character
@param lastChar the last valid character
@param shortTag a 256 bytes long byte
array where each unused byte is represented by 0
@param fontDescriptor the indirect reference to a PdfDictionary containing the font descriptor or null
@throws DocumentException if there is an error
Outputs to the writer the font dictionaries and streams.
@param writer the writer for this document
@param ref the font indirect reference
@param params several parameters that depend on the font type
@throws IOException on error
@throws DocumentException error in generating the object
If this font file is using the Compact Font File Format, then this method
will return the raw bytes needed for the font stream. If this method is
ever made public: make sure to add a test if (cff == true).
@return a byte array
@since 2.1.3
Returns a PdfStream object with the full font program.
@return a PdfStream with the font program
@since 2.1.3
Gets the font parameter identified by key
. Valid values
for key
are ASCENT
, CAPHEIGHT
, DESCENT
and ITALICANGLE
.
@param key the parameter to be extracted
@param fontSize the font size in points
@return the parameter in points
Gets the glyph index and metrics for a character.
@param c the character
@return an int
array with {glyph index, width}
Gets the postscript font name.
@return the postscript font name
Gets the code pages supported by the font.
@return the code pages supported by the font
Checks if the font has any kerning pairs.
@return true
if the font has any kerning pairs
Sets the kerning between two Unicode chars.
@param char1 the first char
@param char2 the second char
@param kern the kerning to apply in normalized 1000 units
@return true
if the kerning was applied, false
otherwise
Checks whether this font may be used with winansi encoding.
@return true
if the font can be correctly used with winansi encodings
Subsets a True Type font by removing the unneeded glyphs from
the font.
@author Paulo Soares
Contains the location of the several tables. The key is the name of
the table and the value is an int[3]
where position 0
is the checksum, position 1 is the offset from the start of the file
and position 2 is the length of the table.
The file in use.
The file name.
Creates a new TrueTypeFontSubSet
@param directoryOffset The offset from the start of the file to the table directory
@param fileName the file name of the font
@param glyphsUsed the glyphs used
@param includeCmap true
if the table cmap is to be included in the generated font
Does the actual work of subsetting the font.
@throws IOException on error
@throws DocumentException on error
@return the subset font
Reads a string
from the font file as bytes using the Cp1252
encoding.
@param length the length of bytes to read
@return the string
read
@throws IOException the font file could not be read
Represents a True Type font with Unicode encoding. All the character
in the font can be used directly by using the encoding Identity-H or
Identity-V. This is the only way to represent some character sets such
as Thai.
@author Paulo Soares
Creates a new TrueType font addressed by Unicode characters. The font
will always be embedded.
@param ttFile the location of the font on file. The file must end in '.ttf'.
The modifiers after the name are ignored.
@param enc the encoding to be applied to this font
@param emb true if the font is to be embedded in the PDF
@param ttfAfm the font as a byte
array
@throws DocumentException the font is invalid
@throws IOException the font file could not be read
Gets the width of a char
in normalized 1000 units.
@param char1 the unicode char
to get the width of
@return the width in normalized 1000 units
Gets the width of a string
in normalized 1000 units.
@param text the string
to get the witdth of
@return the width in normalized 1000 units
Creates a ToUnicode CMap to allow copy and paste from Acrobat.
@param metrics metrics[0] contains the glyph index and metrics[2]
contains the Unicode code
@throws DocumentException on error
@return the stream representing this CMap or null
Gets an hex string in the format "<HHHH>".
@param n the number
@return the hex string
Generates the CIDFontTyte2 dictionary.
@param fontDescriptor the indirect reference to the font descriptor
@param subsetPrefix the subset prefix
@param metrics the horizontal width metrics
@return a stream
Generates the font dictionary.
@param descendant the descendant dictionary
@param subsetPrefix the subset prefix
@param toUnicode the ToUnicode stream
@return the stream
The method used to sort the metrics array.
@param o1 the first element
@param o2 the second element
@return the comparisation
Outputs to the writer the font dictionaries and streams.
@param writer the writer for this document
@param ref the font indirect reference
@param parms several parameters that depend on the font type
@throws IOException on error
@throws DocumentException error in generating the object
Returns a PdfStream object with the full font program.
@return a PdfStream with the font program
@since 2.1.3
A forbidden operation. Will throw a null pointer exception.
@param text the text
@return always null
Gets the glyph index and metrics for a character.
@param c the character
@return an int
array with {glyph index, width}
Checks if a character exists in this font.
@param c the character to check
@return true
if the character has a glyph,
false
otherwise
Sets the character advance.
@param c the character
@param advance the character advance normalized to 1000 units
@return true
if the advance was set,
false
otherwise
Reads a Type1 font
@author Paulo Soares
The PFB file if the input was made with a byte
array.
The Postscript font name.
The full name of the font.
The family name of the font.
The weight of the font: normal, bold, etc.
The italic angle of the font, usually 0.0 or negative.
true
if all the characters have the same
width.
The character set of the font.
The llx of the FontBox.
The lly of the FontBox.
The lurx of the FontBox.
The ury of the FontBox.
The underline position.
The underline thickness.
The font's encoding name. This encoding is 'StandardEncoding' or
'AdobeStandardEncoding' for a font that can be totally encoded
according to the characters names. For all other names the
font is treated as symbolic.
A variable.
A variable.
A variable.
A variable.
A variable.
A variable.
Represents the section CharMetrics in the AFM file. Each
value of this array contains a Object[4]
with an
Integer, Integer, String and int[]. This is the code, width, name and char bbox.
The key is the name of the char and also an Integer with the char number.
Represents the section KernPairs in the AFM file. The key is
the name of the first character and the value is a Object[]
with 2 elements for each kern pair. Position 0 is the name of
the second character and position 1 is the kerning distance. This is
repeated for all the pairs.
The file in use.
true
if this font is one of the 14 built in fonts.
Types of records in a PFB file. ASCII is 1 and BINARY is 2.
They have to appear in the PFB file in this sequence.
Creates a new Type1 font.
@param ttfAfm the AFM file if the input is made with a byte
array
@param pfb the PFB file if the input is made with a byte
array
@param afmFile the name of one of the 14 built-in fonts or the location of an AFM file. The file must end in '.afm'
@param enc the encoding to be applied to this font
@param emb true if the font is to be embedded in the PDF
@throws DocumentException the AFM file is invalid
@throws IOException the AFM file could not be read
Gets the width from the font according to the name
or,
if the name
is null, meaning it is a symbolic font,
the char c
.
@param c the char if the font is symbolic
@param name the glyph name
@return the width of the char
Gets the kerning between two Unicode characters. The characters
are converted to names and this names are used to find the kerning
pairs in the Hashtable
KernPairs
.
@param char1 the first char
@param char2 the second char
@return the kerning to be applied
Reads the font metrics
@param rf the AFM file
@throws DocumentException the AFM file is invalid
@throws IOException the AFM file could not be read
If the embedded flag is false
or if the font is
one of the 14 built in types, it returns null
,
otherwise the font is read and output in a PdfStream object.
@return the PdfStream containing the font or null
@throws DocumentException if there is an error reading the font
Generates the font descriptor for this font or null
if it is
one of the 14 built in fonts.
@param fontStream the indirect reference to a PdfStream containing the font or null
@return the PdfDictionary containing the font descriptor or null
Generates the font dictionary for this font.
@return the PdfDictionary containing the font dictionary
@param firstChar the first valid character
@param lastChar the last valid character
@param shortTag a 256 bytes long byte
array where each unused byte is represented by 0
@param fontDescriptor the indirect reference to a PdfDictionary containing the font descriptor or null
Outputs to the writer the font dictionaries and streams.
@param writer the writer for this document
@param ref the font indirect reference
@param parms several parameters that depend on the font type
@throws IOException on error
@throws DocumentException error in generating the object
Gets the font parameter identified by key
. Valid values
for key
are ASCENT
, CAPHEIGHT
, DESCENT
,
ITALICANGLE
, BBOXLLX
, BBOXLLY
, BBOXURX
and BBOXURY
.
@param key the parameter to be extracted
@param fontSize the font size in points
@return the parameter in points
Sets the font parameter identified by key
. Valid values
for key
are ASCENT
, CAPHEIGHT
, DESCENT
,
ITALICANGLE
, BBOXLLX
, BBOXLLY
, BBOXURX
and BBOXURY
.
@param key the parameter to be updated
@param value the parameter value
Gets the postscript font name.
@return the postscript font name
Checks if the font has any kerning pairs.
@return true
if the font has any kerning pairs
Sets the kerning between two Unicode chars.
@param char1 the first char
@param char2 the second char
@param kern the kerning to apply in normalized 1000 units
@return true
if the kerning was applied, false
otherwise
A class to support Type3 fonts.
Creates a Type3 font.
@param writer the writer
@param chars an array of chars corresponding to the glyphs used (not used, prisent for compability only)
@param colorized if true
the font may specify color, if false
no color commands are allowed
and only images as masks can be used
Defines a glyph. If the character was already defined it will return the same content
@param c the character to match this glyph.
@param wx the advance this character will have
@param llx the X lower left corner of the glyph bounding box. If the colorize
option is
true
the value is ignored
@param lly the Y lower left corner of the glyph bounding box. If the colorize
option is
true
the value is ignored
@param urx the X upper right corner of the glyph bounding box. If the colorize
option is
true
the value is ignored
@param ury the Y upper right corner of the glyph bounding box. If the colorize
option is
true
the value is ignored
@return a content where the glyph can be defined
Always returns null, because you can't get the FontStream of a Type3 font.
@return null
@since 2.1.3
The content where Type3 glyphs are written to.
Writes text vertically. Note that the naming is done according
to horizontal text although it referrs to vertical text.
A line with the alignment Element.LEFT_ALIGN will actually
be top aligned.
Signals that there are no more text available.
Signals that there is no more column.
The chunks that form the text.
The PdfContent
where the text will be written to.
The column Element. Default is left Element.
Marks the chunks to be eliminated when the line is written.
The chunk created by the splitting.
The chunk created by the splitting.
The leading
The X coordinate.
The Y coordinate.
The maximum number of vertical lines.
The height of the text.
Creates new VerticalText
@param text the place where the text will be written to. Can
be a template.
Adds a Phrase
to the current text array.
@param phrase the text
Adds a Chunk
to the current text array.
@param chunk the text
Sets the layout.
@param startX the top right X line position
@param startY the top right Y line position
@param height the height of the lines
@param maxLines the maximum number of lines
@param leading the separation between the lines
Gets the separation between the vertical lines.
@return the vertical line separation
Creates a line from the chunk array.
@param width the width of the line
@return the line or null if no more chunks
Normalizes the list of chunks when the line is accepted.
Outputs the lines to the document. It is equivalent to go(false)
.
@return returns the result of the operation. It can be NO_MORE_TEXT
and/or NO_MORE_COLUMN
@throws DocumentException on error
Outputs the lines to the document. The output can be simulated.
@param simulate true
to simulate the writting to the document
@return returns the result of the operation. It can be NO_MORE_TEXT
and/or NO_MORE_COLUMN
@throws DocumentException on error
Sets the new text origin.
@param startX the X coordinate
@param startY the Y coordinate
Gets the X coordinate where the next line will be writen. This value will change
after each call to go()
.
@return the X coordinate
Gets the Y coordinate where the next line will be writen.
@return the Y coordinate
Gets the maximum number of available lines. This value will change
after each call to go()
.
@return Value of property maxLines.
Gets the height of the line
@return the height
Gets the Element.
@return the alignment
Processes XFA forms.
@author Paulo Soares
An empty constructor to build on.
Return the XFA Object, could be an array, could be a Stream.
Returns null f no XFA Object is present.
@param reader a PdfReader instance
@return the XFA object
@since 2.1.3
A constructor from a PdfReader
. It basically does everything
from finding the XFA stream to the XML parsing.
@param reader the reader
@throws java.io.IOException on error
@throws javax.xml.parsers.ParserConfigurationException on error
@throws org.xml.sax.SAXException on error
Extracts the nodes from the domDocument.
@since 2.1.5
Some XFA forms don't have a datasets node.
If this is the case, we have to add one.
Sets the XFA key from a byte array. The old XFA is erased.
@param form the data
@param reader the reader
@param writer the writer
@throws java.io.IOException on error
Sets the XFA key from the instance data. The old XFA is erased.
@param writer the writer
@throws java.io.IOException on error
Serializes a XML document to a byte array.
@param n the XML document
@throws java.io.IOException on error
@return the serialized XML document
Returns true
if it is a XFA form.
@return true
if it is a XFA form
Gets the top level DOM document.
@return the top level DOM document
Finds the complete field name contained in the "classic" forms from a partial
name.
@param name the complete or partial name
@param af the fields
@return the complete name or null
if not found
Finds the complete SOM name contained in the datasets section from a
possibly partial name.
@param name the complete or partial name
@return the complete name or null
if not found
Finds the Node
contained in the datasets section from a
possibly partial name.
@param name the complete or partial name
@return the Node
or null
if not found
Gets all the text contained in the child nodes of this node.
@param n the Node
@return the text found or "" if no text was found
Sets the text of this node. All the child's node are deleted and a new
child text node is created.
@param n the Node
to add the text to
@param text the text to add
Sets the PdfReader
to be used by this instance.
@param reader the PdfReader
to be used by this instance
Checks if this XFA form was changed.
@return true
if this XFA form was changed
A structure to store each part of a SOM name and link it to the next part
beginning from the lower hierarchie.
Gets the full name by traversing the hiearchie using only the
index 0.
@return the full name
Search the current node for a similar name. A similar name starts
with the same name but has a differnt index. For example, "detail[3]"
is similar to "detail[9]". The main use is to discard names that
correspond to out of bounds records.
@param name the name to search
@return true
if a similitude was found
Another stack implementation. The main use is to facilitate
the porting to other languages.
Looks at the object at the top of this stack without removing it from the stack.
@return the object at the top of this stack
Removes the object at the top of this stack and returns that object as the value of this function.
@return the object at the top of this stack
Pushes an item onto the top of this stack.
@param item the item to be pushed onto this stack
@return the item
argument
Tests if this stack is empty.
@return true
if and only if this stack contains no items; false
otherwise
A class for some basic SOM processing.
The order the names appear in the XML, depth first.
The mapping of full names to nodes.
The data to do a search from the bottom hierarchie.
A stack to be used when parsing.
A temporary store for the repetition count.
Escapes a SOM string fragment replacing "." with "\.".
@param s the unescaped string
@return the escaped string
Unescapes a SOM string fragment replacing "\." with ".".
@param s the escaped string
@return the unescaped string
Outputs the stack as the sequence of elements separated
by '.'.
@return the stack as the sequence of elements separated by '.'
Gets the name with the #subform
removed.
@param s the long name
@return the short name
Adds a SOM name to the search node chain.
@param unstack the SOM name
Adds a SOM name to the search node chain.
@param inverseSearch the start point
@param stack the stack with the separeted SOM parts
@param unstack the full name
Searchs the SOM hiearchie from the bottom.
@param parts the SOM parts
@return the full name or null
if not found
Splits a SOM name in the individual parts.
@param name the full SOM name
@return the split name
Gets the order the names appear in the XML, depth first.
@return the order the names appear in the XML, depth first
Gets the mapping of full names to nodes.
@return the mapping of full names to nodes
Gets the data to do a search from the bottom hierarchie.
@return the data to do a search from the bottom hierarchie
Processes the datasets section in the XFA form.
Creates a new instance from the datasets node. This expects
not the datasets but the data node that comes below.
@param n the datasets node
Inserts a new Node
that will match the short name.
@param n the datasets top Node
@param shortName the short name
@return the new Node
of the inserted name
A class to process "classic" fields.
Creates a new instance from a Collection with the full names.
@param items the Collection
Gets the mapping from short names to long names. A long
name may contain the #subform name part.
@return the mapping from short names to long names
Processes the template section in the XFA form.
Creates a new instance from the datasets node.
@param n the template node
Gets the field type as described in the template
section of the XFA.
@param s the exact template name
@return the field type or null
if not found
true
if it's a dynamic form; false
if it's a static form.
@return true
if it's a dynamic form; false
if it's a static form
Gets the class that contains the template processing section of the XFA.
@return the class that contains the template processing section of the XFA
Gets the class that contains the datasets processing section of the XFA.
@return the class that contains the datasets processing section of the XFA
Gets the class that contains the "classic" fields processing.
@return the class that contains the "classic" fields processing
Gets the Node
that corresponds to the datasets part.
@return the Node
that corresponds to the datasets part
Replaces the data under datasets/data.
@since iText 5.0.0
Helps to locate xml stream inside PDF document with Xfa form.
Gets Document to sign
Save document as single XML stream in AcroForm.
@param document signed document
@throws IOException
@throws DocumentException
Constructor for xpath expression for signing XfaForm
Possible xdp packages to sign
Empty constructor, no transform.
Construct for Xpath expression. Depends from selected xdp package.
@param xdpPackage
Get XPath expression
Reads a XFDF.
@author Leonard Rosenthol (leonardr@pdfsages.com)
Storage for field values if there's more than one value for a field.
@since 2.1.4
Reads an XFDF form.
@param filename the file name of the form
@throws IOException on error
Reads an XFDF form.
@param xfdfIn the byte array with the form
@throws IOException on error
Reads an XFDF form.
@param is an InputStream to read the form
@throws IOException on error
@since 5.0.1
Gets all the fields. The map is keyed by the fully qualified
field name and the value is a merged PdfDictionary
with the field content.
@return all the fields
Gets the field value.
@param name the fully qualified field name
@return the field's value
Gets the field value or null
if the field does not
exist or has no value defined.
@param name the fully qualified field name
@return the field value or null
Gets the field values for a list or null
if the field does not
exist or has no value defined.
@param name the fully qualified field name
@return the field values or null
@since 2.1.4
Gets the PDF file specification contained in the FDF.
@return the PDF file specification contained in the FDF
Called when a start tag is found.
@param tag the tag name
@param h the tag's attributes
Called when an end tag is found.
@param tag the tag name
Called when the document starts to be parsed.
Called after the document is parsed.
Called when a text element is found.
@param str the text element, probably a fragment.
Constructs XmlSignatureAppearance object.
@param writer the writer to which the signature will be written.
Holds value of property xades:SigningTime.
Holds value of property xades:Description.
Holds value of property xades:MimeType.
Sets the certificate used to provide the text in the appearance.
This certificate doesn't take part in the actual signing process.
@param signCertificate the certificate
Gets the signature date.
@return the signature date
Sets the signature date.
@param signDate the signature date
Helps to locate xml stream
@return XmlLocator, cannot be null.
Constructor for xpath expression in case signing only part of XML document.
@return XpathConstructor, can be null
Close PdfStamper
@throws IOException
@throws DocumentException
A Hashtable that uses ints as the keys.
The hash table data.
The total number of entries in the hash table.
Rehashes the table when count exceeds this threshold.
The load factor for the hashtable.
Constructs a new, empty hashtable with the specified initial
Constructs a new, empty hashtable with the specified initial
Constructs a new, empty hashtable. A default capacity and load factor
Returns the number of elements contained in the hashtable.
Returns true if the hashtable contains no elements.
Returns true if the specified object is an element of the hashtable.
Returns true if the collection contains an element for the key.
Gets the object associated with the specified key in the
Rehashes the content of the table into a bigger table.
Removes the element corresponding to the key. Does nothing if the
Clears the hash table so that it has no more elements in it.
Encapsulates filter behavior for PDF streams. Classes generally interace with this
using the static GetDefaultFilterHandlers() method, then obtain the desired {@link IFilterHandler}
via a lookup.
@since 5.0.4
The main interface for creating a new {@link IFilterHandler}
The default {@link IFilterHandler}s used by iText
@return the default {@link IFilterHandler}s used by iText
Creates a {@link MemoryLimitsAwareOutputStream} which will be used for decompression of the passed pdf stream.
@param streamDictionary the pdf stream which is going to be decompressed.
@return the {@link ByteArrayOutputStream} which will be used for decompression of the passed pdf stream
Handles FLATEDECODE filter
Handles ASCIIHEXDECODE filter
Handles ASCIIHEXDECODE filter
Handles LZWDECODE filter
Handles CCITTFAXDECODE filter
A filter that doesn't modify the stream at all
Handles RUNLENGTHDECODE filter
A PdfArray object consisting of nothing but PdfNumber objects
@since 5.1.0
Creates a PdfArray consisting of PdfNumber objects.
@param numbers float values
Creates a PdfArray consisting of PdfNumber objects.
@param numbers a List containing PdfNumber objects
Signals that a table will continue in the next page.
@since 5.0.6
This method is called to indicate that table is being split. It's called
before the tableLayout
method and before the table is drawn.
@param table the PdfPTable
in use
Wrapper class for PdfCopy and PdfSmartCopy.
Allows you to concatenate existing PDF documents with much less code.
The Document object for PdfCopy.
The actual PdfWriter
Creates an instance of the concatenation class.
@param os the Stream for the PDF document
Creates an instance of the concatenation class.
@param os the Stream for the PDF document
@param smart do we want PdfCopy to detect redundant content?
Adds the pages from an existing PDF document.
@param reader the reader for the existing PDF document
@return the number of pages that were added
@throws DocumentException
@throws IOException
Gets the PdfCopy instance so that you can add bookmarks or change preferences before you close PdfConcatenate.
Opens the document (if it isn't open already).
Opening the document is done implicitly.
We've finished writing the concatenated document.
The spacing before the table.
The spacing after the table.
Defines if the div should be kept on one page if possible
IMPROTANT NOTE: be careful with this method because it would return correct result
only in case if {@link PdfDiv#layout(PdfContentByte, boolean, boolean, float, float, float, float)}
was already called.
@return the actual height the div would require to layout it's content
IMPROTANT NOTE: be careful with this method because it would return correct result
only in case if {@link PdfDiv#layout(PdfContentByte, boolean, boolean, float, float, float, float)}
was already called.
@return the actual width the div would require to layout it's content
Image will be scaled to fit in the div occupied area.
Gets all the chunks in this element.
@return an ArrayList
Gets the type of the text element.
@return a type
@see com.itextpdf.text.Element#isContent()
@since iText 2.0.8
@see com.itextpdf.text.Element#isNestable()
@since iText 2.0.8
Processes the element by adding it (or the different parts) to an
ElementListener
.
@param listener an ElementListener
@return true
if the element was processed successfully
Serial version UID
Creates a new instance of PdfIsoConformanceException.
Creates a new instance of PdfIsoConformanceException.
@param s
A signature field lock dictionary.
Enumerates the different actions of a signature lock.
Indicates the set of fields that should be locked:
all the fields in the document,
all the fields specified in the /Fields array
all the fields except those specified in the /Fields array
Enumerates the different levels of permissions.
Creates a signature lock valid for all fields in the document.
Creates a signature lock for all fields in the document,
setting specific permissions.
Creates a signature lock for specific fields in the document.
Creates a signature lock for specific fields in the document.
Add kid to structureTreeRoot from structTreeRoot
An Anchor can be a reference or a destination of a reference.
An Anchor is a special kind of .
It is constructed in the same way.
This is the name of the Anchor.
This is the reference of the Anchor.
Constructs an Anchor without specifying a leading.
Has nine overloads.
Constructs an Anchor with a certain leading.
the leading
Constructs an Anchor with a certain Chunk.
a Chunk
Constructs an Anchor with a certain string.
a string
Constructs an Anchor with a certain string
and a certain Font.
a string
a Font
Constructs an Anchor with a certain Chunk
and a certain leading.
the leading
a Chunk
Constructs an Anchor with a certain leading
and a certain string.
the leading
a string
Constructs an Anchor with a certain leading,
a certain string and a certain Font.
the leading
a string
a Font
Constructs an Anchor
with a certain Phrase
.
@param phrase a Phrase
Processes the element by adding it (or the different parts) to an
an IElementListener
true if the element was processed successfully
Gets all the chunks in this element.
an ArrayList
Applies the properties of the Anchor to a Chunk.
@param chunk the Chunk (part of the Anchor)
@param notGotoOK if true, this chunk will determine the local destination
@param localDestination true if the chunk is a local goto and the reference a local destination
@return the value of notGotoOK or false, if a previous Chunk was used to determine the local destination
Gets the type of the text element.
a type
Name of this Anchor.
reference of this Anchor.
reference of this Anchor.
an Uri
An Annotation is a little note that can be added to a page
on a document.
This is a possible annotation type.
This is a possible annotation type.
This is a possible annotation type.
This is a possible annotation type.
This is a possible annotation type.
This is a possible annotation type.
This is a possible annotation type.
This is a possible annotation type.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is a possible attribute.
This is the type of annotation.
This is the title of the Annotation.
This is the lower left x-value
This is the lower left y-value
This is the upper right x-value
This is the upper right y-value
Constructs an Annotation with a certain title and some text.
the lower left x-value
the lower left y-value
the upper right x-value
the upper right y-value
Constructs an Annotation with a certain title and some text.
the title of the annotation
the content of the annotation
Constructs an Annotation with a certain title and some text.
the title of the annotation
the content of the annotation
the lower left x-value
the lower left y-value
the upper right x-value
the upper right y-value
Constructs an Annotation.
the lower left x-value
the lower left y-value
the upper right x-value
the upper right y-value
the external reference
Constructs an Annotation.
the lower left x-value
the lower left y-value
the upper right x-value
the upper right y-value
the external reference
Constructs an Annotation.
the lower left x-value
the lower left y-value
the upper right x-value
the upper right y-value
an external PDF file
the destination in this file
Creates a Screen anotation to embed media clips
the lower left x-value
the lower left y-value
the upper right x-value
the upper right y-value
path to the media clip file
mime type of the media
if true play on display of the page
Constructs an Annotation.
the lower left x-value
the lower left y-value
the upper right x-value
the upper right y-value
an external PDF file
a page number in this file
Constructs an Annotation.
the lower left x-value
the lower left y-value
the upper right x-value
the upper right y-value
a named destination in this file
Has nine overloads.
Constructs an Annotation.
the lower left x-value
the lower left y-value
the upper right x-value
the upper right y-value
an external application
parameters to pass to this application
the operation to pass to this application
the default directory to run this application in
Gets the type of the text element
Processes the element by adding it (or the different parts) to an
IElementListener.
an IElementListener
true if the element was process successfully
Gets all the chunks in this element.
an ArrayList
Sets the dimensions of this annotation.
the lower left x-value
the lower left y-value
the upper right x-value
the upper right y-value
Returns the lower left x-value.
a value
Returns the lower left y-value.
a value
Returns the uppper right x-value.
a value
Returns the uppper right y-value.
a value
Returns the lower left x-value.
the default value
a value
Returns the lower left y-value.
the default value
a value
Returns the upper right x-value.
the default value
a value
Returns the upper right y-value.
the default value
a value
Returns the type of this Annotation.
a type
Returns the title of this Annotation.
a name
Gets the content of this Annotation.
a reference
Gets the content of this Annotation.
a reference
@see com.lowagie.text.Element#isContent()
@since iText 2.0.8
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
Signals an attempt to create an Element that hasn't got the right form.
Base class for Color, serves as wrapper class for
to allow extension.
Construct a new BaseColor.
@param red the value for the red gamma
@param green the value for the green gamma
@param blue the value for the blue gamma
@param alpha the value for the alpha gamma
@param red
@param green
@param blue
Construct a BaseColor with float values.
@param red
@param green
@param blue
@param alpha
Construct a BaseColor with float values.
@param red
@param green
@param blue
Construct a BaseColor by setting the combined value.
@param argb
Construct a BaseColor by System.Drawing.Color.
@param color
@return the combined color value
@return the value for red
@return the value for green
@return the value for blue
@return the value for the alpha channel
Make this BaseColor brighter. Factor used is 0.7.
@return the new BaseColor
Make this color darker. Factor used is 0.7
@return the new BaseColor
A Chapter is a special Section.
A chapter number has to be created using a Paragraph as title
and an int as chapter number. The chapter number is shown be
default. If you don't want to see the chapter number, you have to set the
numberdepth to 0.
Paragraph title2 = new Paragraph("This is Chapter 2", FontFactory.GetFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new BaseColor(0, 0, 255)));
Chapter chapter2 = new Chapter(title2, 2);
chapter2.SetNumberDepth(0);
Paragraph someText = new Paragraph("This is some text");
chapter2.Add(someText);
Paragraph title21 = new Paragraph("This is Section 1 in Chapter 2", FontFactory.GetFont(FontFactory.HELVETICA, 16, Font.BOLD, new BaseColor(255, 0, 0)));
Section section1 = chapter2.AddSection(title21);
Paragraph someSectionText = new Paragraph("This is some silly paragraph in a chapter and/or section. It contains some text to test the functionality of Chapters and Section.");
section1.Add(someSectionText);
Constructs a new Chapter
.
@param number the Chapter number
Constructs a new Chapter.
the Chapter title (as a Paragraph)
the Chapter number
Has three overloads.
Constructs a new Chapter.
the Chapter title (as a string)
the Chapter number
Has three overloads.
Gets the type of the text element.
a type
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
Chapter with auto numbering.
@author Michael Niedermair
Is the chapter number already set?
@since 2.1.4
Create a new object.
@param para the Chapter title (as a Paragraph
)
Create a new objet.
@param title the Chapter title (as a String
)
Create a new section for this chapter and ad it.
@param title the Section title (as a String
)
@return Returns the new section.
Create a new section for this chapter and add it.
@param title the Section title (as a Paragraph
)
@return Returns the new section.
Changes the Chapter number.
@param number the new chapter number
@since 2.1.4
This is the smallest significant part of text that can be added to a document.
Most elements can be divided in one or more Chunks.
A chunk is a string with a certain Font.
all other layoutparameters should be defined in the object to which
this chunk of text is added.
Chunk chunk = new Chunk("Hello world", FontFactory.GetFont(FontFactory.COURIER, 20, Font.ITALIC, new BaseColor(255, 0, 0)));
document.Add(chunk);
The character stand in for an image or a separator.
This is a Chunk containing a newline.
This is a Chunk containing a newpage.
This is the content of this chunk of text.
This is the Font of this chunk of text.
Contains some of the attributes for this Chunk.
Empty constructor.
Has six overloads.
A Chunk
copy constructor.
@param ck the Chunk
to be copied
Constructs a chunk of text with a certain content and a certain Font.
the content
the font
Constructs a chunk of text with a certain content, without specifying a Font.
the content
Constructs a chunk of text with a char and a certain Font
.
@param c the content
@param font the font
Constructs a chunk of text with a char, without specifying a Font
.
@param c the content
Constructs a chunk containing an Image.
the image
the image offset in the x direction
the image offset in the y direction
Key for drawInterface of the Separator.
@since 2.1.2
Creates a separator Chunk.
Note that separator chunks can't be used in combination with tab chunks!
@param separator the drawInterface to use to draw the separator.
@since 2.1.2
Creates a separator Chunk.
Note that separator chunks can't be used in combination with tab chunks!
@param separator the drawInterface to use to draw the separator.
@param vertical true if this is a vertical separator
@since 2.1.2
Key for drawInterface of the tab.
@since 2.1.2
Key for tab stops of the tab.
@since 5.4.1
Creates a tab Chunk.
Note that separator chunks can't be used in combination with tab chunks!
@param separator the drawInterface to use to draw the tab.
@param tabPosition an X coordinate that will be used as start position for the next Chunk.
@since 2.1.2
Creates a tab Chunk.
Note that separator chunks can't be used in combination with tab chunks!
@param separator the drawInterface to use to draw the tab.
@param tabPosition an X coordinate that will be used as start position for the next Chunk.
@param newline if true, a newline will be added if the tabPosition has already been reached.
@since 2.1.2
Creates a tab Chunk.
@param tabInterval an interval that will be used if tab stops are omitted.
@param isWhitespace if true, the current tab is treated as white space.
@since 5.4.1
Constructs a chunk containing an Image.
the image
the image offset in the x direction
the image offset in the y direction
true if the leading has to be adapted to the image
Processes the element by adding it (or the different parts) to an
IElementListener.
an IElementListener
true if the element was processed successfully
Gets the type of the text element.
a type
Gets all the chunks in this element.
an ArrayList
appends some text to this Chunk.
a string
a StringBuilder
Get/set the font of this Chunk.
a Font
Returns the content of this Chunk.
a string
Checks is this Chunk is empty.
false if the Chunk contains other characters than space.
Gets the width of the Chunk in points.
@return a width in points
Checks the attributes of this Chunk.
false if there aren't any.
Checks the accessible attributes of this Chunk
.
@return false if there aren't any.
Sets/Gets the attributes for this Chunk.
It may be null.
a Hashtable
Sets an arbitrary attribute.
the key for the attribute
the value of the attribute
this Chunk
Key for text horizontal scaling.
Sets the text horizontal scaling. A value of 1 is normal and a value of 0.5f
shrinks the text to half it's width.
@param scale the horizontal scaling factor
@return this Chunk
Gets the horizontal scaling.
@return a percentage in float
Key for underline.
Sets an horizontal line that can be an underline or a strikethrough.
Actually, the line can be anywhere vertically and has always the
Chunk
width. Multiple call to this method will
produce multiple lines.
@param thickness the absolute thickness of the line
@param yPosition the absolute y position relative to the baseline
@return this Chunk
Sets an horizontal line that can be an underline or a strikethrough.
Actually, the line can be anywhere vertically and has always the
Chunk
width. Multiple call to this method will
produce multiple lines.
@param color the color of the line or null
to follow
the text color
@param thickness the absolute thickness of the line
@param thicknessMul the thickness multiplication factor with the font size
@param yPosition the absolute y position relative to the baseline
@param yPositionMul the position multiplication factor with the font size
@param cap the end line cap. Allowed values are
PdfContentByte.LINE_CAP_BUTT, PdfContentByte.LINE_CAP_ROUND and
PdfContentByte.LINE_CAP_PROJECTING_SQUARE
@return this Chunk
Key for sub/basescript.
Sets the text displacement relative to the baseline. Positive values rise the text,
negative values lower the text.
It can be used to implement sub/basescript.
the displacement in points
this Chunk
Key for text skewing.
Skews the text to simulate italic and other effects.
Try alpha=0
and beta=12
.
@param alpha the first angle in degrees
@param beta the second angle in degrees
@return this Chunk
Key for background.
Sets the color of the background Chunk.
the color of the background
this Chunk
Sets the color and the size of the background Chunk
.
@param color the color of the background
@param extraLeft increase the size of the rectangle in the left
@param extraBottom increase the size of the rectangle in the bottom
@param extraRight increase the size of the rectangle in the right
@param extraTop increase the size of the rectangle in the top
@return this Chunk
Key for text rendering mode.
Sets the text rendering mode. It can outline text, simulate bold and make
text invisible.
@param mode the text rendering mode. It can be PdfContentByte.TEXT_RENDER_MODE_FILL
,
PdfContentByte.TEXT_RENDER_MODE_STROKE
, PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE
and PdfContentByte.TEXT_RENDER_MODE_INVISIBLE
.
@param strokeWidth the stroke line width for the modes PdfContentByte.TEXT_RENDER_MODE_STROKE
and
PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE
.
@param strokeColor the stroke color or null
to follow the text color
@return this Chunk
Key for split character.
Sets the split characters.
the SplitCharacter interface
this Chunk
Key for hyphenation.
sets the hyphenation engine to this Chunk.
the hyphenation engine
this Chunk
Key for remote goto.
Sets a goto for a remote destination for this Chunk.
the file name of the destination document
the name of the destination to go to
this Chunk
Sets a goto for a remote destination for this Chunk.
the file name of the destination document
the page of the destination to go to. First page is 1
this Chunk
Key for local goto.
Sets a local goto for this Chunk.
There must be a local destination matching the name.
the name of the destination to go to
this Chunk
Key for local destination.
Sets a local destination for this Chunk.
the name for this destination
this Chunk
Key for generic tag.
Sets the generic tag Chunk.
The text for this tag can be retrieved with PdfPageEvent.
the text for the tag
this Chunk
Key for line-height (alternative for leading in Phrase).
Sets a line height tag.
@return this Chunk
Key for image.
Returns the image.
an Image
Key for Action.
Sets an action for this Chunk.
the action
this Chunk
Sets an anchor for this Chunk.
the Uri to link to
this Chunk
Sets an anchor for this Chunk.
the url to link to
this Chunk
Key for newpage.
Sets a new page tag.
this Chunk
Key for annotation.
Sets a generic annotation to this Chunk.
the annotation
this Chunk
@see com.lowagie.text.Element#isContent()
@since iText 2.0.8
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
Returns the hyphenation (if present).
@param hyphenation a HyphenationEvent instance
@since 2.1.2
Key for color.
Key for encoding.
Key for character spacing.
Sets the character spacing.
@param charSpace the character spacing value
@return this Chunk
Gets the character spacing.
@return a value in float
Key for word spacing.
Sets the word spacing.
@param wordSpace the word spacing value
@return this Chunk
Gets the word spacing.
@return a value in float
Sets the textual expansion of the abbreviation or acronym.
It is highly recommend to set textuual expansion when generating PDF/UA documents.
@param value
A generic Document class.
All kinds of Text-elements can be added to a HTMLDocument.
The Document signals all the listeners when an element
has been added.
Once a document is created you can add some meta information.
You can also set the headers/footers.
You have to open the document before you can write content.
You can only write content (no more meta-formation!) once a document is opened.
When you change the header/footer on a certain page, this will be effective starting on the next page.
Ater closing the document, every listener (as well as its OutputStream) is closed too.
// creation of the document with a certain size and certain margins
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
try {
// creation of the different writers
HtmlWriter.GetInstance(document, System.out);
PdfWriter.GetInstance(document, new FileOutputStream("text.pdf"));
// we add some meta information to the document
document.AddAuthor("Bruno Lowagie");
document.AddSubject("This is the result of a Test.");
// we define a header and a footer
HeaderFooter header = new HeaderFooter(new Phrase("This is a header."), false);
HeaderFooter footer = new HeaderFooter(new Phrase("This is page "), new Phrase("."));
footer.SetAlignment(Element.ALIGN_CENTER);
document.SetHeader(header);
document.SetFooter(footer);
// we open the document for writing
document.Open();
document.Add(new Paragraph("Hello world"));
}
catch (DocumentException de) {
Console.Error.WriteLine(de.Message);
}
document.Close();
Allows the pdf documents to be produced without compression for debugging purposes.
Scales the WMF font size. The default value is 0.86.
The IDocListener.
Is the document open or not?
Has the document already been closed?
The size of the page.
margin in x direction starting from the left
margin in x direction starting from the right
margin in y direction starting from the top
margin in y direction starting from the bottom
mirroring of the top/bottom margins
@since 2.1.6
Content of JavaScript onLoad function
Content of JavaScript onUnLoad function
Style class in HTML body tag
Current pagenumber
This is a chapter number in case ChapterAutoNumber is used.
Constructs a new Document-object.
Has three overloads.
Constructs a new Document-object.
the pageSize
Constructs a new Document-object.
the pageSize
the margin on the left
the margin on the right
the margin on the top
the margin on the bottom
Adds a IDocListener to the Document.
the new IDocListener
Removes a IDocListener from the Document.
the IDocListener that has to be removed.
Adds an Element to the Document.
the Element to add
true if the element was added, false if not
Opens the document.
Once the document is opened, you can't write any Header- or Meta-information
anymore. You have to open the document before you can begin to add content
to the body of the document.
Opens the document.
Version for languages that are not case-dependant.
Once the document is opened, you can't write any Header- or Meta-information
anymore. You have to open the document before you can begin to add content
to the body of the document.
Sets the pagesize.
the new pagesize
a bool
Sets the margins.
the margin on the left
the margin on the right
the margin on the top
the margin on the bottom
Signals that an new page has to be started.
true if the page was added, false if not.
Sets the page number to 0.
Sets the page number.
an int
Returns the current page number.
an int
Closes the document.
Once all the content has been written in the body, you have to close
the body. After that nothing can be written to the body anymore.
Closes the document.
Version for languages that are not case-dependant.
Once all the content has been written in the body, you have to close
the body. After that nothing can be written to the body anymore.
Adds a user defined header to the document.
the name of the header
the content of the header
true if successful, false otherwise
Adds the title to a Document.
the title
true if successful, false otherwise
Adds the subject to a Document.
the subject
true if successful, false otherwise
Adds the keywords to a Document.
keywords to add
true if successful, false otherwise
Adds the author to a Document.
the name of the author
true if successful, false otherwise
Adds the creator to a Document.
the name of the creator
true if successful, false otherwise
Adds the producer to a Document.
true if successful, false otherwise
Adds a language to th document. Required for PDF/UA compatible documents.
@param language
@return true
if successfull, false
otherwise
Adds the current date and time to a Document.
true if successful, false otherwise
Returns the left margin.
the left margin
Return the right margin.
the right margin
Returns the top margin.
the top margin
Returns the bottom margin.
the bottom margin
Returns the lower left x-coordinate.
the lower left x-coordinate
Returns the upper right x-coordinate.
the upper right x-coordinate.
Returns the upper right y-coordinate.
the upper right y-coordinate.
Returns the lower left y-coordinate.
the lower left y-coordinate.
Returns the lower left x-coordinate considering a given margin.
a margin
the lower left x-coordinate
Returns the upper right x-coordinate, considering a given margin.
a margin
the upper right x-coordinate
Returns the upper right y-coordinate, considering a given margin.
a margin
the upper right y-coordinate
Returns the lower left y-coordinate, considering a given margin.
a margin
the lower left y-coordinate
Gets the pagesize.
the page size
Checks if the document is open.
true if the document is open
Gets the JavaScript onLoad command.
the JavaScript onLoad command.
Gets the JavaScript onUnLoad command.
the JavaScript onUnLoad command
Gets the style class of the HTML body tag
the style class of the HTML body tag
Gets the margin mirroring flag.
@return the margin mirroring flag
Signals that an error has occurred in a Document.
Constructs a new DocumentException
Has two overloads.
Construct a new DocumentException
error message
Constructs a DocumentException with a message and a Exception.
a message describing the exception
an exception that has to be turned into a DocumentException
An abstract Writer class for documents.
DocWriter is the abstract class of several writers such
as PdfWriter and HtmlWriter.
A DocWriter can be added as a DocListener
to a certain Document by getting an instance (see method
GetInstance() in the specific writer-classes).
Every Element added to the original Document
will be written to the stream of the listening
DocWriter.
This is some byte that is often used.
This is some byte that is often used.
This is some byte that is often used.
This is some byte that is often used.
This is some byte that is often used.
This is some byte that is often used.
This is some byte that is often used.
This is some byte that is often used.
The pageSize.
This is the document that has to be written.
The stream of this writer.
Is the writer open for writing?
Do we have to pause all writing actions?
Closes the stream on document close
Constructs a DocWriter.
The Document that has to be written
The Stream the writer has to write to.
Signals that an Element was added to the Document.
This method should be overriden in the specific DocWriter classes
derived from this abstract class.
false
Signals that the Document was opened.
Sets the pagesize.
the new pagesize
a boolean
Sets the margins.
This does nothing. Has to be overridden if needed.
the margin on the left
the margin on the right
the margin on the top
the margin on the bottom
Signals that an new page has to be started.
This does nothing. Has to be overridden if needed.
true if the page was added, false if not.
Sets the page number to 0.
This method should be overriden in the specific DocWriter classes
derived from this abstract class if they actually support the use of
pagenumbers.
Sets the page number.
This method should be overriden in the specific DocWriter classes
derived from this abstract class if they actually support the use of
pagenumbers.
Signals that the Document was closed and that no other
Elements will be added.
Converts a string into a Byte array
according to the ISO-8859-1 codepage.
the text to be converted
the conversion result
Let the writer know that all writing has to be paused.
Checks if writing is paused.
@return true
if writing temporarely has to be paused, false
otherwise.
Let the writer know that writing may be resumed.
Flushes the Stream.
Writes a string to the stream.
the string to write
Writes a number of tabs.
the number of tabs to add
Writes a key-value pair to the stream.
the name of an attribute
the value of an attribute
Writes a starttag to the stream.
the name of the tag
Writes an endtag to the stream.
the name of the tag
Writes an endtag to the stream.
Writes the markup attributes of the specified MarkupAttributes
object to the stream.
the MarkupAttributes to write.
@see com.lowagie.text.DocListener#setMarginMirroring(boolean)
@since 2.1.6
Interface for a text element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element
This is a possible type of Element
This is a possible type of Element
This is a possible type of Element
This is a possible type of Element
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element
.
This is a possible type of Element.
This is a possible type of Element.
This is a possible type of Element
.
@since 2.1.5
This is a possible type of Element
.
@since 5.3.0
This is a possible type of Element
.
This is a possible type of Element
.
@since 2.1.2
This is an element thats not an element.
@see WritableDirectElement
A possible value for paragraph Element. This
specifies that the text is aligned to the left
indent and extra whitespace should be placed on
the right.
A possible value for paragraph Element. This
specifies that the text is aligned to the left
indent and extra whitespace should be placed on
the right.
A possible value for paragraph Element. This
specifies that the text is aligned to the center
and extra whitespace should be placed equally on
the left and right.
A possible value for paragraph Element. This
specifies that the text is aligned to the right
indent and extra whitespace should be placed on
the left.
A possible value for paragraph Element. This
specifies that extra whitespace should be spread
out through the rows of the paragraph with the
text lined up with the left and right indent
except on the last line which should be aligned
to the left.
A possible value for vertical Element.
A possible value for vertical Element.
A possible value for vertical Element.
A possible value for vertical Element.
Does the same as ALIGN_JUSTIFIED but the last line is also spread out.
Pure two-dimensional encoding (Group 4)
Pure one-dimensional encoding (Group 3, 1-D)
Mixed one- and two-dimensional encoding (Group 3, 2-D)
A flag indicating whether 1-bits are to be interpreted as black pixels
and 0-bits as white pixels,
A flag indicating whether the filter expects extra 0-bits before each
encoded line so that the line begins on a byte boundary.
A flag indicating whether end-of-line bit patterns are required to be
present in the encoding.
A flag indicating whether the filter expects the encoded data to be
terminated by an end-of-block pattern, overriding the Rows
parameter. The use of this flag will set the key /EndOfBlock to false.
Localizes error messages. The messages are located in the package
com.lowagie.text.error_messages in the form language_country.lng.
The internal file encoding is UTF-8 without any escape chars, it's not a
normal property file. See en.lng for more information on the internal format.
@author Paulo Soares (psoares@glintt.com)
Get a message without parameters.
@param key the key to the message
@return the message
Get a message with parameters. The parameters will replace the strings
"{1}", "{2}", ..., "{n}" found in the message.
@param key the key to the message
@param p the variable parameter
@return the message
Sets the language to be used globally for the error messages. The language
is a two letter lowercase country designation like "en" or "pt". The country
is an optional two letter uppercase code like "US" or "PT".
@param language the language
@param country the country
@return true if the language was found, false otherwise
@throws IOException on error
Sets the error messages directly from a Reader.
@param r the Reader
@throws IOException on error
Typed exception used when opening an existing PDF document.
Gets thrown when the document isn't a valid PDF document.
@since 2.1.5 It was written for iText 2.0.8, but moved to another package
Creates an exception saying the user password was incorrect.
Typed exception used when creating PDF syntax that isn't valid.
@since 2.1.6
Creates an exception saying the PDF syntax isn't correct.
@param message some extra info about the exception
RuntimeException to indicate that the provided Image is invalid/corrupted.
Should only be thrown/not caught when ignoring invalid images.
@since 5.4.2
Typed exception used when opening an existing PDF document.
Gets thrown when the document isn't a valid PDF document.
@since 2.1.5
Creates an instance of with a message and no cause
@param message the reason why the document isn't a PDF document according to iText.
Creates an exception with a message and a cause
@param message the reason why the document isn't a PDF document according to iText.
@param cause the cause of the exception, if any
Typed exception used when opening an existing PDF document.
Gets thrown when the document isn't a valid PDF document according to iText,
but it's different from the InvalidPdfException in the sense that it may
be an iText limitation (most of the times it isn't but you might have
bumped into something that has been added to the PDF specs, but that isn't
supported in iText yet).
@since 2.1.5
Creates an instance of an UnsupportedPdfException.
@param message the reason why the document isn't a PDF document according to iText.
This class can produce String combinations representing a number built with
Greek letters (from alpha to omega, then alpha alpha, alpha beta, alpha gamma).
We are aware of the fact that the original Greek numbering is different;
See http://www.cogsci.indiana.edu/farg/harry/lan/grknum.htm#ancient
but this isn't implemented yet; the main reason being the fact that we
need a font that has the obsolete Greek characters qoppa and sampi.
Changes an int into a lower case Greek letter combination.
@param index the original number
@return the letter combination
Changes an int into a lower case Greek letter combination.
@param index the original number
@return the letter combination
Changes an int into a upper case Greek letter combination.
@param index the original number
@return the letter combination
Changes an int into a Greek letter combination.
@param index the original number
@return the letter combination
This class can produce String combinations representing a number.
"a" to "z" represent 1 to 26, "AA" represents 27, "AB" represents 28,
and so on; "ZZ" is followed by "AAA".
Translates a positive integer (not equal to zero)
into a String using the letters 'a' to 'z';
1 = a, 2 = b, ..., 26 = z, 27 = aa, 28 = ab,...
Translates a positive integer (not equal to zero)
into a String using the letters 'a' to 'z';
1 = a, 2 = b, ..., 26 = z, 27 = aa, 28 = ab,...
Translates a positive integer (not equal to zero)
into a String using the letters 'A' to 'Z';
1 = A, 2 = B, ..., 26 = Z, 27 = AA, 28 = AB,...
Translates a positive integer (not equal to zero)
into a String using the letters 'a' to 'z'
(a = 1, b = 2, ..., z = 26, aa = 27, ab = 28,...).
This class can produce String combinations representing a roman number.
Helper class for Roman Digits
part of a roman number
value of the roman digit
can the digit be used as a prefix
Constructs a roman digit
@param digit the roman digit
@param value the value
@param pre can it be used as a prefix
Array with Roman digits.
Changes an int into a lower case roman number.
@param index the original number
@return the roman number (lower case)
Changes an int into a lower case roman number.
@param index the original number
@return the roman number (lower case)
Changes an int into an upper case roman number.
@param index the original number
@return the roman number (lower case)
Changes an int into a roman number.
@param index the original number
@return the roman number (lower case)
Contains all the specifications of a font: fontfamily, size, style and color.
Paragraph p = new Paragraph("This is a paragraph",
new Font(Font.HELVETICA, 18, Font.BOLDITALIC, new BaseColor(0, 0, 255)));
this is a possible style.
this is a possible style.
this is a possible style.
this is a possible style.
this is a possible style.
this is a possible style.
the value of an undefined attribute.
the value of the default size.
the value of the fontfamily.
the value of the fontsize.
the value of the style.
the value of the color.
the external font
Copy constructor of a Font
@param other the font that has to be copied
Constructs a Font.
the family to which this font belongs
the size of this font
the style of this font
the BaseColor of this font.
Constructs a Font.
the external font
the size of this font
the style of this font
the BaseColor of this font.
Constructs a Font.
the external font
the size of this font
the style of this font
Constructs a Font.
the external font
the size of this font
Constructs a Font.
the external font
Constructs a Font.
the family to which this font belongs
the size of this font
the style of this font
Constructs a Font.
the family to which this font belongs
the size of this font
Constructs a Font.
the family to which this font belongs
Constructs a Font.
Has nine overloads.
Compares this Font with another
the other Font
a value
Gets the family of this font.
the value of the family
Gets the familyname as a string.
the familyname
Sets the family using a String ("Courier",
"Helvetica", "Times New Roman", "Symbol" or "ZapfDingbats").
A String representing a certain font-family.
Translates a string-value of a certain family
into the index that is used for this family in this class.
A string representing a certain font-family
the corresponding index
Get/set the size of this font.
the size of this font
Gets the size that can be used with the calculated BaseFont
.
@return the size that can be used with the calculated BaseFont
Gets the leading that can be used with this font.
@param multipliedLeading
a certain multipliedLeading
@return the height of a line
Gets the style of this font.
the style of this font
Gets the style that can be used with the calculated BaseFont
.
@return the style that can be used with the calculated BaseFont
checks if this font is Bold.
a boolean
checks if this font is Bold.
a boolean
checks if this font is underlined.
a boolean
checks if the style of this font is STRIKETHRU.
a boolean
Sets the style using a String containing one of
more of the following values: normal, bold, italic, underline, strike.
A String representing a certain style.
Sets the style.
@param style the style.
Translates a string-value of a certain style
into the index value is used for this style in this class.
a string
the corresponding value
Get/set the color of this font.
the color of this font
Sets the color.
the red-value of the new color
the green-value of the new color
the blue-value of the new color
Gets the BaseFont inside this object.
the BaseFont
Gets the BaseFont
this class represents.
For the built-in fonts a BaseFont
is calculated.
@param specialEncoding true
to use the special encoding for Symbol and ZapfDingbats,
false
to always use Cp1252
@return the BaseFont
this class represents
Checks if the properties of this font are undefined or null.
If so, the standard should be used.
a boolean
If you are using True Type fonts, you can declare the paths of the different ttf- and ttc-files
to this static class first and then create fonts in your code using one of the static getFont-method
without having to enter a path as parameter.
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is a possible value of a base 14 type 1 font
This is the default encoding to use.
This is the default value of the embedded variable.
Creates new FontFactory
Constructs a Font-object.
the name of the font
the encoding of the font
true if the font is to be embedded in the PDF
the size of this font
the style of this font
the BaseColor of this font
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
true if the font is to be embedded in the PDF
the size of this font
the style of this font
the BaseColor of this font
true if the font comes from the cache or is added to the cache if new, false if the font is always created new
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
true if the font is to be embedded in the PDF
the size of this font
the style of this font
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
true if the font is to be embedded in the PDF
the size of this font
Constructs a Font-object.
the name of the font
the encoding of the font
true if the font is to be embedded in the PDF
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
the size of this font
the style of this font
the BaseColor of this font
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
the size of this font
the style of this font
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
the size of this font
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
a Font object
Constructs a Font-object.
the name of the font
the size of this font
the style of this font
the BaseColor of this font
a Font object
Constructs a Font-object.
the name of the font
the size of this font
the BaseColor of this font
a Font object
Constructs a Font-object.
the name of the font
the size of this font
the style of this font
a Font object
Constructs a Font-object.
the name of the font
the size of this font
a Font object
Constructs a Font-object.
the name of the font
a Font object
Register a font by giving explicitly the font family and name.
@param familyName the font family
@param fullName the font name
@param path the font path
Register a ttf- or a ttc-file.
the path to a ttf- or ttc-file
Register a ttf- or a ttc-file and use an alias for the font contained in the ttf-file.
the path to a ttf- or ttc-file
the alias you want to use for the font
Register all the fonts in a directory.
@param dir the directory
@return the number of fonts registered
Register fonts in some probable directories. It usually works in Windows,
Linux and Solaris.
@return the number of fonts registered
Gets a set of registered fontnames.
a set of registered fontnames
Gets a set of registered font families.
a set of registered font families
Checks whether the given font is contained within the object
the name of the font
true if font is contained within the object
Checks if a certain font is registered.
the name of the font that has to be checked
true if the font is found
If you are using True Type fonts, you can declare the paths of the different ttf- and ttc-files
to this class first and then create fonts in your code using one of the getFont method
without having to enter a path as parameter.
This is a map of postscriptfontnames of True Type fonts and the path of their ttf- or ttc-file.
This is a map of fontfamilies.
This is the default encoding to use.
This is the default value of the embedded variable.
Creates new FontFactory
Constructs a Font-object.
the name of the font
the encoding of the font
true if the font is to be embedded in the PDF
the size of this font
the style of this font
the BaseColor of this font
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
true if the font is to be embedded in the PDF
the size of this font
the style of this font
the BaseColor of this font
true if the font comes from the cache or is added to the cache if new, false if the font is always created new
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
true if the font is to be embedded in the PDF
the size of this font
the style of this font
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
true if the font is to be embedded in the PDF
the size of this font
Constructs a Font-object.
the name of the font
the encoding of the font
true if the font is to be embedded in the PDF
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
the size of this font
the style of this font
the BaseColor of this font
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
the size of this font
the style of this font
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
the size of this font
a Font object
Constructs a Font-object.
the name of the font
the encoding of the font
a Font object
Constructs a Font-object.
the name of the font
the size of this font
the style of this font
the BaseColor of this font
a Font object
Constructs a Font-object.
the name of the font
the size of this font
the BaseColor of this font
a Font object
Constructs a Font-object.
the name of the font
the size of this font
the style of this font
a Font object
Constructs a Font-object.
the name of the font
the size of this font
a Font object
Constructs a Font-object.
the name of the font
a Font object
Register a font by giving explicitly the font family and name.
@param familyName the font family
@param fullName the font name
@param path the font path
Register a ttf- or a ttc-file.
the path to a ttf- or ttc-file
Register a ttf- or a ttc-file and use an alias for the font contained in the ttf-file.
the path to a ttf- or ttc-file
the alias you want to use for the font
Register all the fonts in a directory.
@param dir the directory
@return the number of fonts registered
Register fonts in windows
@return the number of fonts registered
Gets a set of registered fontnames.
a set of registered fontnames
Gets a set of registered font families.
a set of registered font families
Checks if a certain font is registered.
the name of the font that has to be checked
true if the font is found
A special-version of LIST
whitch use greek-letters.
@see com.lowagie.text.List
Initialization
@param symbolIndent indent
Initialisierung
@param symbolIndent indent
Initialisierung
@param greeklower greek-char in lowercase
@param symbolIndent indent
change the font to SYMBOL
Adds an Object
to the List
.
@param o the object to add.
@return true if adding the object succeeded
This is an Element that contains
some userdefined meta information about the document.
Header header = new Header("inspired by", "William Shakespeare");
This is the content of this chunk of text.
Constructs a Header.
the name of the meta-information
the content
Returns the name of the meta information.
a string
List with the HTML translation of all the characters.
Set containing tags that trigger a new line.
@since iText 5.0.6
Converts a String
to the HTML-format of this String
.
@param string The String
to convert
@return a String
Converts a BaseColor
into a HTML representation of this BaseColor
.
@param color the BaseColor
that has to be converted.
@return the HTML representation of this BaseColor
Translates the alignment value.
@param alignment the alignment value
@return the translated value
Returns true if the tag causes a new line like p, br etc.
@since iText 5.0.6
Static final values of supported HTML tags and attributes.
@since 5.0.6
@deprecated since 5.5.2
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag
name of a tag
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag
name of a tag
name of a tag
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag
name of a tag
name of a tag
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag
name of a tag
name of a tag
name of a tag
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag.
@since 5.0.6 (reorganized all constants)
name of a tag
name of a tag.
@since 5.0.6 (reorganized all constants)
name of an attribute
name of an attribute
@since 5.0.6
name of an attribute
@since 5.0.6
name of an attribute
name of an attribute
name of an attribute
@since 5.0.6
name of an attribute
@since 5.0.6
name of an attribute
@since 5.0.6
Name of an attribute.
@since 5.0.6
Name of an attribute.
@since 5.0.6
Name of an attribute.
@since 5.0.6
Name of an attribute.
@since 5.0.6
Name of an attribute.
@since 5.0.6
Name of an attribute.
@since 5.0.6
name of an attribute
name of an attribute
Name of an attribute.
@since 5.0.6
Name of an attribute.
@since 5.0.6
name of an attribute
the possible value of an alignment attribute
the possible value of an alignment attribute
the possible value of an alignment attribute
The possible value of an alignment attribute.
@since 5.0.6
The possible value of an alignment attribute.
@since 5.0.6
the possible value of an alignment attribute
the possible value of an alignment attribute
the possible value of an alignment attribute
the possible value of an alignment attribute
This is used for inline css style information
Attribute for specifying externally defined CSS class.
@since 5.0.6
the CSS tag for text color
The CSS tag for the font size.
@since 5.0.6
The CSS tag for the font size.
@since 5.0.6
The CSS tag for the font size.
@since 5.0.6
The CSS tag for the font size.
@since 5.0.6
The CSS tag for the font size.
@since 5.0.6
The CSS tag for the font size.
@since 5.0.6
The CSS tag for the font size.
@since 5.0.6
The CSS tag for the font size.
@since 5.0.6
the CSS tag for text decorations
a CSS value for text decoration
@since 5.0.6
a CSS value for text decoration
@since 5.0.6
a CSS value for text decoration
@since 5.0.6
a CSS value for text decoration
@since 5.0.6
a CSS value for text decoration
@since 5.0.6
a CSS value for text decoration
@since 5.0.6
A possible attribute.
@since 5.0.6
A possible attribute.
@since 5.0.6
Stores the hierarchy of tags along with the attributes of each tag.
@since 5.0.6 renamed from ChainedProperties
@deprecated since 5.5.2
Class that stores the info about one tag in the chain.
A possible tag
The styles corresponding with the tag
Constructs a chained property.
@param tag an XML/HTML tag
@param attrs the tag's attributes
A list of chained properties representing the tag hierarchy.
Creates a new instance of ChainedProperties
Walks through the hierarchy (bottom-up) looking for
a property key. Returns a value as soon as a match
is found or null if the key can't be found.
@param key the key of the property
@return the value of the property
Walks through the hierarchy (bottom-up) looking for
a property key. Returns true as soon as a match is
found or false if the key can't be found.
@param key the key of the property
@return true if the key is found
Adds a tag and its corresponding properties to the chain.
@param tag the tags that needs to be added to the chain
@param props the tag's attributes
If the properties contain a font size, the size may need to
be adjusted based on font sizes higher in the hierarchy.
@param attrs the attributes that may have to be updated
@since 5.0.6 (renamed)
Old iText class that allows you to convert HTML to PDF.
We've completely rewritten HTML to PDF conversion and we made it a separate project named XML Worker.
@deprecated since 5.5.2; please switch to XML Worker instead (this is a separate project)
DocListener that will listen to the Elements
produced by parsing the HTML.
This can be a com.lowagie.text.Document adding
the elements to a Document directly, or an
HTMLWorker instance strong the objects in a List
The map with all the supported tags.
@since 5.0.6
The object defining all the styles.
Creates a new instance of HTMLWorker
@param document A class that implements DocListener
Creates a new instance of HTMLWorker
@param document A class that implements DocListener
@param tags A map containing the supported tags
@param style A StyleSheet
@since 5.0.6
Sets the map with supported tags.
@param tags
@since 5.0.6
Setter for the StyleSheet
@param style the StyleSheet
Parses content read from a java.io.Reader object.
@param reader the content
@throws IOException
Stack with the Elements that already have been processed.
@since iText 5.0.6 (private => protected)
Keeps the content of the current paragraph
@since iText 5.0.6 (private => protected)
The current hierarchy chain of tags.
@since 5.0.6
@see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#startDocument()
@see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#startElement(java.lang.String, java.util.Dictionary)
@see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#text(java.lang.String)
@see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#endElement(java.lang.String)
@see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#endDocument()
Adds a new line to the currentParagraph.
@since 5.0.6
Flushes the current paragraph, indicating that we're starting
a new block.
If the stack is empty, the paragraph is added to the document.
Otherwise the Paragraph is added to the stack.
@since 5.0.6
Stacks the current paragraph, indicating that we're starting
a new span.
@since 5.0.6
Pushes an element to the Stack.
@param element
@since 5.0.6
Updates the chain with a new tag and new attributes.
@param tag the new tag
@param attrs the corresponding attributes
@since 5.0.6
Updates the chain by removing a tag.
@param tag the new tag
@since 5.0.6
Key used to store the image provider in the providers map.
@since 5.0.6
Key used to store the image processor in the providers map.
@since 5.0.6
Key used to store the image store in the providers map.
@since 5.0.6
Key used to store the image baseurl provider in the providers map.
@since 5.0.6
Key used to store the font provider in the providers map.
@since 5.0.6
Key used to store the link provider in the providers map.
@since 5.0.6
IDictionary containing providers such as a FontProvider or ImageProvider.
@since 5.0.6 (renamed from interfaceProps)
Setter for the providers.
If a FontProvider is added, the ElementFactory is updated.
@param providers a IDictionary with different providers
@since 5.0.6
Factory that is able to create iText Element objects.
@since 5.0.6
Creates a Chunk using the factory.
@param content the content of the chunk
@return a Chunk with content
@since 5.0.6
Creates a Paragraph using the factory.
@return a Paragraph without any content
@since 5.0.6
Creates a List object.
@param tag should be "ol" or "ul"
@return a List object
@since 5.0.6
Creates a ListItem object.
@return a ListItem object
@since 5.0.6
Creates a LineSeparator object.
@param attrs properties of the LineSeparator
@return a LineSeparator object
@since 5.0.6
Creates an Image object.
@param attrs properties of the Image
@return an Image object (or null if the Image couldn't be found)
@throws DocumentException
@throws IOException
@since 5.0.6
Creates a Cell.
@param tag the tag
@return a CellWrapper object
@since 5.0.6
Adds a link to the current paragraph.
@since 5.0.6
Fetches the List from the Stack and adds it to
the TextElementArray on top of the Stack,
or to the Document if the Stack is empty.
@throws DocumentException
@since 5.0.6
Looks for the List object on the Stack,
and adds the ListItem to the List.
@throws DocumentException
@since 5.0.6
Processes an Image.
@param img
@param attrs
@throws DocumentException
@since 5.0.6
Processes the Table.
@throws DocumentException
@since 5.0.6
Gets the TableWrapper from the Stack and adds a new row.
@since 5.0.6
Stack to keep track of table tags.
Boolean to keep track of TR tags.
Boolean to keep track of TD and TH tags
Boolean to keep track of LI tags
Boolean to keep track of PRE tags
@since 5.0.6 renamed from isPRE
Indicates if text needs to be skipped.
@since iText 5.0.6 (private => protected)
Pushes the values of pendingTR and pendingTD
to a state stack.
@since 5.0.6
Pops the values of pendingTR and pendingTD
from a state stack.
@since 5.0.6
@return the pendingTR
@since 5.0.6
@param pendingTR the pendingTR to set
@since 5.0.6
@return the pendingTD
@since 5.0.6
@param pendingTD the pendingTD to set
@since 5.0.6
@return the pendingLI
@since 5.0.6
@param pendingLI the pendingLI to set
@since 5.0.6
@return the insidePRE
@since 5.0.6
@param insidePRE the insidePRE to set
@since 5.0.6
@return the skipText
@since 5.0.6
@param skipText the skipText to set
@since 5.0.6
The resulting list of elements.
Parses an HTML source to a List of Element objects
@param reader the HTML source
@param style a StyleSheet object
@return a List of Element objects
@throws IOException
Parses an HTML source to a List of Element objects
@param reader the HTML source
@param style a StyleSheet object
@param providers map containing classes with extra info
@return a List of Element objects
@throws IOException
Parses an HTML source to a List of Element objects
@param reader the HTML source
@param style a StyleSheet object
@param tags a map containing supported tags and their processors
@param providers map containing classes with extra info
@return a List of Element objects
@throws IOException
@since 5.0.6
@see com.itextpdf.text.ElementListener#add(com.itextpdf.text.Element)
@see com.itextpdf.text.DocListener#close()
@see com.itextpdf.text.DocListener#newPage()
@see com.itextpdf.text.DocListener#open()
@see com.itextpdf.text.DocListener#resetPageCount()
@see com.itextpdf.text.DocListener#setMarginMirroring(bool)
@see com.itextpdf.text.DocListener#setMarginMirroring(bool)
@since 2.1.6
@see com.itextpdf.text.DocListener#setMargins(float, float, float, float)
@see com.itextpdf.text.DocListener#setPageCount(int)
@see com.itextpdf.text.DocListener#setPageSize(com.itextpdf.text.Rectangle)
Sets the providers.
@deprecated use SetProviders() instead
Gets the providers
@deprecated use GetProviders() instead
@deprecated since 5.5.2
Old class to define styles for HTMLWorker.
We've completely rewritten HTML to PDF functionality; see project XML Worker.
XML Worker is able to parse CSS files and "style" attribute values.
@deprecated since 5.5.2
IDictionary storing tags and their corresponding styles.
@since 5.0.6 (changed Dictionary => IDictionary)
IDictionary storing possible names of the "class" attribute
and their corresponding styles.
@since 5.0.6 (changed Dictionary => IDictionary)
Creates a new instance of StyleSheet
Associates a IDictionary containing styles with a tag.
@param tag the name of the HTML/XML tag
@param attrs a map containing styles
Adds an extra style key-value pair to the styles IDictionary
of a specific tag
@param tag the name of the HTML/XML tag
@param key the key specifying a specific style
@param value the value defining the style
Associates a IDictionary containing styles with a class name.
@param className the value of the class attribute
@param attrs a map containing styles
Adds an extra style key-value pair to the styles IDictionary
of a specific tag
@param className the name of the HTML/XML tag
@param key the key specifying a specific style
@param value the value defining the style
Resolves the styles based on the tag name and the value
of the class attribute.
@param tag the tag that needs to be resolved
@param attrs existing style map that will be updated
Method contributed by Lubos Strapko
@param h
@param chain
@since 2.1.3
We use a CellWrapper because we need some extra info
that isn't available in PdfPCell.
@author psoares
@since 5.0.6 (renamed)
@deprecated since 5.5.2
The cell that is wrapped in this stub.
The width of the cell.
@since iText 5.0.6
Indicates if the width is a percentage.
@since iText 5.0.6
Creates a new instance of IncCell.
@param tag the cell that is wrapped in this object.
@param chain properties such as width
@since 5.0.6
Creates a PdfPCell element based on a tag and its properties.
@param tag a cell tag
@param chain the hierarchy chain
@see com.lowagie.text.Element#isContent()
@since iText 2.0.8
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
Factory that produces iText Element objects,
based on tags and their properties.
@author blowagie
@author psoares
@since 5.0.6 (renamed)
@deprecated since 5.5.2
The font provider that will be used to fetch fonts.
@since iText 5.0 This used to be a FontFactoryImp
Creates a new instance of FactoryProperties.
Setter for the font provider
@param provider
@since 5.0.6 renamed from setFontImp
Creates a Font object based on a chain of properties.
@param chain chain of properties
@return an iText Font object
Creates an iText Chunk
@param content the content of the Chunk
@param chain the hierarchy chain
@return a Chunk
Creates an iText Paragraph object using the properties
of the different tags and properties in the hierarchy chain.
@param chain the hierarchy chain
@return a Paragraph without any content
Creates an iText Paragraph object using the properties
of the different tags and properties in the hierarchy chain.
@param chain the hierarchy chain
@return a ListItem without any content
Method that does the actual Element creating for
the createParagraph and createListItem method.
@param paragraph
@param chain
Sets the leading of a Paragraph object.
@param paragraph the Paragraph for which we set the leading
@param leading the String value of the leading
Gets a HyphenationEvent based on the hyphenation entry in
the hierarchy chain.
@param chain the hierarchy chain
@return a HyphenationEvent
@since 2.1.2
Creates a LineSeparator.
@since 5.0.6
This class maps tags such as div and span to their corresponding
TagProcessor classes.
@deprecated since 5.5.2
Creates a Map containing supported tags.
Object that processes the following tags:
i, em, b, strong, s, strike, u, sup, sub
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
Maps em to i, strong to b, and strike to s.
This is a convention: the style parser expects i, b and s.
@param tag the original tag
@return the mapped tag
Object that processes the a tag.
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
Object that processes the br tag.
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@throws DocumentException
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@throws DocumentException
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@throws DocumentException
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#startElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String, java.util.Map)
@see com.itextpdf.text.html.simpleparser.HTMLTagProcessors#endElement(com.itextpdf.text.html.simpleparser.HTMLWorker, java.lang.String)
Interface that needs to be implemented by every tag that is supported by HTMLWorker.
@deprecated since 5.5.2
Implement this class to tell the HTMLWorker what to do
when an open tag is encountered.
@param worker the HTMLWorker
@param tag the tag that was encountered
@param attrs the current attributes of the tag
@throws DocumentException
@throws IOException
Implement this class to tell the HTMLWorker what to do
when an close tag is encountered.
@param worker the HTMLWorker
@param tag the tag that was encountered
@throws DocumentException
Implement this interface to process images and
to indicate if the image needs to be added or
skipped.
@since 5.0.6 (renamed)
@deprecated since 5.5.2
Allows you to (pre)process the image before (or instead of)
adding it to the DocListener with HTMLWorker.
@param img the Image object
@param attrs attributes of the image
@param chain hierarchy of attributes
@param doc the DocListener to which the Image needs to be added
@return false if you still want HTMLWorker to add the Image
Allows you to do additional processing on a Paragraph that contains a link.
@author psoares
@since 5.0.6 (renamed)
@deprecated since 5.5.2
Does additional processing on a link paragraph
@param current the Paragraph that has the link
@param attrs the attributes
@return false if the Paragraph no longer needs processing
@since 5.0.6
@deprecated since 5.5.2
We use a TableWrapper because PdfPTable is rather complex
to put on the HTMLWorker stack.
@author psoares
@since 5.0.6 (renamed)
@deprecated since 5.5.2
The styles that need to be applied to the table
@since 5.0.6 renamed from props
Nested list containing the PdfPCell elements that are part of this table.
Array containing the widths of the columns.
@since iText 5.0.6
Creates a new instance of IncTable.
@param attrs a Map containing attributes
Adds a new row to the table.
@param row a list of PdfPCell elements
Setter for the column widths
@since iText 5.0.6
Creates a new PdfPTable based on the info assembled
in the table stub.
@return a PdfPTable
This class is a HashMap that contains the names of colors as a key and the
corresponding Color as value. (Source: Wikipedia
http://en.wikipedia.org/wiki/Web_colors )
@author blowagie
@deprecated since 5.5.2
A web color string without the leading # will be 3 or 6 characters long
and all those characters will be hex digits. NOTE: colStr must be all
lower case or the current hex letter test will fail.
@param colStr
A non-null, lower case string that might describe an RGB color
in hex.
@return Is this a web color hex string without the leading #?
@since 5.0.6
Gives you a BaseColor based on a name.
@param name
a name such as black, violet, cornflowerblue or #RGB or
#RRGGBB or RGB or RRGGBB or rgb(R,G,B)
@return the corresponding BaseColor object. Never returns null.
@throws IllegalArgumentException
if the String isn't a know representation of a color.
A class that contains some utilities to parse HTML attributes and content.
@since 5.0.6 (some of these methods used to be in the Markup class)
@deprecated since 5.5.2
a default value for font-size
@since 2.1.3
Parses a length.
@param str
a length in the form of an optional + or -, followed by a
number and a unit.
@return a float
New method contributed by: Lubos Strapko
@since 2.1.3
Converts a BaseColor
into a HTML representation of this
BaseColor
.
@param s
the BaseColor
that has to be converted.
@return the HTML representation of this BaseColor
This method parses a String with attributes and returns a Properties
object.
@param str
a String of this form: 'key1="value1"; key2="value2";...
keyN="valueN" '
@return a Properties object
Removes the comments sections of a String.
@param str
the original String
@param startComment
the String that marks the start of a Comment section
@param endComment
the String that marks the end of a Comment section.
@return the String stripped of its comment section
Helper class that reduces the white space in a String
@param content content containing whitespace
@return the content without all unnecessary whitespace
A series of predefined font sizes.
@since 5.0.6 (renamed)
Picks a font size from a series of predefined font sizes.
@param value the new value of a font, expressed as an index
@param previous the previous value of the font size
@return a new font size.
Translates a String value to an alignment value.
(written by Norman Richards, integrated into iText by Bruno)
@param alignment a String (one of the ALIGN_ constants of this class)
@return an alignment value (one of the ALIGN_ constants of the Element interface)
A class that implements DocListener will perform some
actions when some actions are performed on a Document.
Signals that the Document has been opened and that
Elements can be added.
Signals that the Document was closed and that no other
Elements will be added.
The output stream of every writer implementing IDocListener will be closed.
Signals that an new page has to be started.
true if the page was added, false if not.
Sets the pagesize.
the new pagesize
a boolean
Sets the margins.
the margin on the left
the margin on the right
the margin on the top
the margin on the bottom
Parameter that allows you to do margin mirroring (odd/even pages)
@param marginMirroring
@return true if succesfull
Parameter that allows you to do top/bottom margin mirroring (odd/even pages)
@param marginMirroringTopBottom
@return true if successful
@since 2.1.6
Sets the page number.
the new page number
Sets the page number to 0.
Interface for a text element.
Processes the element by adding it (or the different parts) to an
IElementListener.
an IElementListener
true if the element was processed successfully
Gets the type of the text element.
a type
Checks if this element is a content object.
If not, it's a metadata object.
@since iText 2.0.8
@return true if this is a 'content' element; false if this is a 'medadata' element
Checks if this element is nestable.
@since iText 2.0.8
@return true if this element can be nested inside other elements.
Gets all the chunks in this element.
an ArrayList
Gets the content of the text element.
the content of the text element
A class that implements ElementListener will perform some
actions when an Element is added.
Signals that an Element was added to the Document.
Element added
true if the element was added, false if not.
These two methods are used by FactoryProperties (for HTMLWorker).
It's implemented by FontFactoryImp.
@since iText 5.0
Checks if a certain font is registered.
@param fontname the name of the font that has to be checked.
@return true if the font is found
Constructs a Font
-object.
@param fontname the name of the font
@param encoding the encoding of the font
@param embedded true if the font is to be embedded in the PDF
@param size the size of this font
@param style the style of this font
@param color the BaseColor
of this font.
@return the Font constructed based on the parameters
Interface implemented by Element objects that can potentially consume
a lot of memory. Objects implementing the LargeElement interface can
be added to a Document more than once. If you have invoked setCompleted(false),
they will be added partially and the content that was added will be
removed until you've invoked setCompleted(true);
@since iText 2.0.8
If you invoke setCompleted(false), you indicate that the content
of the object isn't complete yet; it can be added to the document
partially, but more will follow. If you invoke setCompleted(true),
you indicate that you won't add any more data to the object.
@since iText 2.0.8
@param complete false if you'll be adding more data after
adding the object to the document.
Flushes the content that has been added.
An Image is the representation of a graphic element (JPEG, PNG or GIF)
that has to be inserted into the document
this is a kind of image Element.
this is a kind of image Element.
this is a kind of image Element.
this is a kind of image Element.
this is a kind of image Element.
this is a kind of image Element.
This represents a coordinate in the transformation matrix.
This represents a coordinate in the transformation matrix.
This represents a coordinate in the transformation matrix.
This represents a coordinate in the transformation matrix.
This represents a coordinate in the transformation matrix.
This represents a coordinate in the transformation matrix.
This represents a coordinate in the transformation matrix.
This represents a coordinate in the transformation matrix.
type of image
type of image
type of image
type of image
type of image
type of image
type of image
type of image
type of image
@since 2.1.5
Image color inversion
The imagetype.
The URL of the image.
The raw data of the image.
The template to be treated as an image.
The alignment of the Image.
Text that can be shown instead of the image.
This is the absolute X-position of the image.
This is the absolute Y-position of the image.
This is the width of the image without rotation.
This is the width of the image without rotation.
This is the scaled width of the image taking rotation into account.
This is the original height of the image taking rotation into account.
The compression level of the content streams.
@since 2.1.3
This is the rotation of the image.
this is the colorspace of a jpeg-image.
this is the bits per component of the raw image. It also flags a CCITT image.
this is the transparency information of the raw image
the indentation to the left.
the indentation to the right.
Holds value of property dpiX.
Holds value of property dpiY.
Holds value of property interpolation.
if the annotation is not null the image will be clickable.
ICC Profile attached
Holds value of property deflated.
Holds value of property smask.
Holds value of property XYRatio.
Holds value of property originalType.
Holds value of property originalData.
The spacing before the image.
The spacing after the image.
Holds value of property widthPercentage.
Holds value of property initialRotation.
Constructs an Image-object, using an url.
the URL where the image can be found.
Constructs an Image object duplicate.
another Image object.
Gets an instance of an Image.
an Image
an object of type Gif, Jpeg or Png
Gets an instance of an Image.
an URL
an object of type Gif, Jpeg or Png
Gets an instance of an Image.
an URL
an object of type Gif, Jpeg or Png
Gets an instance of an Image.
a byte array
an object of type Gif, Jpeg or Png
Gets an instance of an Image from a System.Drwaing.Image.
the System.Drawing.Image to convert
if different from null the transparency
pixels are replaced by this color
if true the image is treated as black and white
an object of type ImgRaw
Converts a .NET image to a Native(PNG, JPG, GIF, WMF) image
Gets an instance of an Image from a System.Drawing.Image.
the System.Drawing.Image to convert
if different from null the transparency
pixels are replaced by this color
an object of type ImgRaw
Gets an instance of an Image.
a filename
an object of type Gif, Jpeg or Png
Gets an instance of an Image in raw mode.
the width of the image in pixels
the height of the image in pixels
1,3 or 4 for GrayScale, RGB and CMYK
bits per component
the image data
an object of type ImgRaw
Creates a JBIG2 Image.
@param width the width of the image
@param height the height of the image
@param data the raw image data
@param globals JBIG2 globals
@since 2.1.5
Reuses an existing image.
@param ref the reference to the image dictionary
@throws BadElementException on error
@return the image
Gets an instance of an Image in raw mode.
Gets an instance of an Image in raw mode.
the width of the image in pixels
the height of the image in pixels
Gets an instance of an Image in raw mode.
the width of the image in pixels
the height of the image in pixels
1,3 or 4 for GrayScale, RGB and CMYK
bits per component
the image data
transparency information in the Mask format of the
image dictionary
an object of type ImgRaw
Sets the absolute position of the Image.
Scale the image to the dimensions of the rectangle
dimensions to scale the Image
Scale the image to an absolute width and an absolute height.
the new width
the new height
Scale the image to an absolute width.
the new width
Scale the image to an absolute height.
the new height
Scale the image to a certain percentage.
the scaling percentage
Scale the width and height of an image to a certain percentage.
the scaling percentage of the width
the scaling percentage of the height
Scales the images to the dimensions of the rectangle.
the dimensions to fit
Scales the image so that it fits a certain width and height.
the width to fit
the height to fit
Gets the current image rotation in radians.
@return the current image rotation in radians
Sets the rotation of the image in radians.
rotation in radians
Sets the rotation of the image in degrees.
rotation in degrees
Get/set the annotation.
the Annotation
Gets the bpc for the image.
this only makes sense for Images of the type RawImage.
a bpc value
Gets the raw data for the image.
this only makes sense for Images of the type RawImage.
the raw data
Get/set the template to be used as an image.
this only makes sense for Images of the type ImgTemplate.
the template
Checks if the Images has to be added at an absolute position.
a bool
Checks if the Images has to be added at an absolute X position.
a bool
Returns the absolute X position.
a position
Returns the absolute Y position.
a position
Returns the type.
a type
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
Returns true if the image is a Jpeg-object.
a bool
Returns true if the image is a ImgRaw-object.
a bool
Returns true if the image is an ImgTemplate-object.
a bool
Gets the string-representation of the reference to the image.
a string
Get/set the alignment for the image.
a value
Get/set the alternative text for the image.
a string
Gets the scaled width of the image.
a value
Gets the scaled height of the image.
a value
Gets the colorspace for the image.
this only makes sense for Images of the type Jpeg.
a colorspace value
Returns the transformation matrix of the image.
an array [AX, AY, BX, BY, CX, CY, DX, DY]
Returns the transformation matrix of the image.
@return an array [AX, AY, BX, BY, CX, CY, DX, DY]
Returns the transparency.
the transparency
Gets the plain width of the image.
a value
Gets the plain height of the image.
a value
generates new serial id
returns serial id for this object
Gets the dots-per-inch in the X direction. Returns 0 if not available.
the dots-per-inch in the X direction
Gets the dots-per-inch in the Y direction. Returns 0 if not available.
the dots-per-inch in the Y direction
Sets the dots per inch value
@param dpiX
dpi for x coordinates
@param dpiY
dpi for y coordinates
Returns true if this Image has the
requisites to be a mask.
true if this Image can be a mask
Make this Image a mask.
Get/set the explicit masking.
the explicit masking
Returns true if this Image is a mask.
true if this Image is a mask
Inverts the meaning of the bits of a mask.
true to invert the meaning of the bits of a mask
Sets the image interpolation. Image interpolation attempts to
produce a smooth transition between adjacent sample values.
New value of property interpolation.
Tags this image with an ICC profile.
@param profile the profile
Checks is the image has an ICC profile.
@return the ICC profile or null
Indicates if the image should be scaled to fit the line
when the image exceeds the available width.
@since iText 5.0.6
Indicates if the image should be scaled to fit
when the image exceeds the available height.
@since iText 5.4.2
Gets and sets the value of scaleToFitHeight.
@return true if the image size has to scale to the available height
@since iText 5.4.2
Replaces CalRGB and CalGray colorspaces with DeviceRGB and DeviceGray.
Some image formats, like TIFF may present the images rotated that have
to be compensated.
Sets the compression level to be used if the image is written as a compressed stream.
@param compressionLevel a value between 0 (best speed) and 9 (best compression)
@since 2.1.3
CCITT Image data that has to be inserted into the document
@see Element
@see Image
@author Paulo Soares
CCITT Image data that has to be inserted into the document
Creats an Image in CCITT mode.
the exact width of the image
the exact height of the image
reverses the bits in data.
Bit 0 is swapped with bit 7 and so on
the type of compression in data. It can be
CCITTG4, CCITTG31D, CCITTG32D
parameters associated with this stream. Possible values are
CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFLINE and CCITT_ENDOFBLOCK or a
combination of them
the image data
Support for JBIG2 images.
@since 2.1.5
JBIG2 globals
A unique hash
Copy contstructor.
@param image another Image
Empty constructor.
Actual constructor for ImgJBIG2 images.
@param width the width of the image
@param height the height of the image
@param data the raw image data
@param globals JBIG2 globals
Getter for the JBIG2 global data.
@return an array of bytes
Getter for the unique hash.
@return an array of bytes
Raw Image data that has to be inserted into the document
Creats an Image in raw mode.
the exact width of the image
the exact height of the image
1,3 or 4 for GrayScale, RGB and CMYK
bits per component. Must be 1,2,4 or 8
data the image data
PdfTemplate that has to be inserted into the document
Creats an Image from a PdfTemplate.
the Image
Creats an Image from a PdfTemplate.
the PdfTemplate
An ImgWMF is the representation of a windows metafile
that has to be inserted into the document
@see Element
@see Image
@see Gif
@see Png
An ImgWMF is the representation of a windows metafile
that has to be inserted into the document
Constructs an ImgWMF-object
a Image
Constructs an ImgWMF-object, using an url.
the URL where the image can be found
Constructs an ImgWMF-object, using a filename.
a string-representation of the file that contains the image.
Constructs an ImgWMF-object from memory.
the memory image
This method checks if the image is a valid WMF and processes some parameters.
Reads the WMF into a template.
the template to read to
A RandomAccessSource that is based on an underlying byte array
@since 5.3.5
@since 5.3.5
The source
Constructs a new OffsetRandomAccessSource
@param source the source
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
A RandomAccessSource that is based on a set of underlying sources, treating the sources as if they were a contiguous block of data.
@since 5.3.5
The underlying sources (along with some meta data to quickly determine where each source begins and ends)
Cached value to make multiple reads from the same underlying source more efficient
Cached size of the underlying channel
Constructs a new {@link GroupedRandomAccessSource} based on the specified set of sources
@param sources the sources used to build this group
For a given offset, return the index of the source that contains the specified offset.
This is an optimization feature to help optimize the access of the correct source without having to iterate
through every single source each time. It is safe to always return 0, in which case the full set of sources will be searched.
Subclasses should override this method if they are able to compute the source index more efficiently (for example {@link FileChannelRandomAccessSource} takes advantage of fixed size page buffers to compute the index)
@param offset the offset
@return the index of the input source that contains the specified offset, or 0 if unknown
Returns the SourceEntry that contains the byte at the specified offset
sourceReleased is called as a notification callback so subclasses can take care of cleanup when the source is no longer the active source
@param offset the offset of the byte to look for
@return the SourceEntry that contains the byte at the specified offset
@throws IOException if there is a problem with IO (usually the result of the sourceReleased() call)
Called when a given source is no longer the active source. This gives subclasses the abilty to release resources, if appropriate.
@param source the source that is no longer the active source
@throws IOException if there are any problems
Called when a given source is about to become the active source. This gives subclasses the abilty to retrieve resources, if appropriate.
@param source the source that is about to become the active source
@throws IOException if there are any problems
{@inheritDoc}
The source that contains the byte at position is retrieved, the correct offset into that source computed, then the value
from that offset in the underlying source is returned.
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
Closes all of the underlying sources
Used to track each source, along with useful meta data
The underlying source
The first byte (in the coordinates of the GroupedRandomAccessSource) that this source contains
The last byte (in the coordinates of the GroupedRandomAccessSource) that this source contains
The index of this source in the GroupedRandomAccessSource
Standard constructor
@param index the index
@param source the source
@param offset the offset of the source in the GroupedRandomAccessSource
Given an absolute offset (in the GroupedRandomAccessSource coordinates), calculate the effective offset in the underlying source
@param absoluteOffset the offset in the parent GroupedRandomAccessSource
@return the effective offset in the underlying source
A RandomAccessSource that is wraps another RandomAccessSouce but does not propagate close(). This is useful when
passing a RandomAccessSource to a method that would normally close the source.
@since 5.3.5
The source
Constructs a new OffsetRandomAccessSource
@param source the source
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
Does nothing - the underlying source is not closed
Represents an abstract source that bytes can be read from. This class forms the foundation for all byte input in iText.
Implementations do not keep track of a current 'position', but rather provide absolute get methods. Tracking position
should be handled in classes that use RandomAccessSource internally (via composition).
@since 5.3.5
Gets a byte at the specified position
@param position
@return the byte, or -1 if EOF is reached
Gets an array at the specified position. If the number of bytes requested cannot be read, the bytes that can be
read will be placed in bytes and the number actually read will be returned.
@param position the position in the RandomAccessSource to read from
@param bytes output buffer
@param off offset into the output buffer where results will be placed
@param len the number of bytes to read
@return the number of bytes actually read, or -1 if the file is at EOF
@return the length of this source
Closes this source. The underlying data structure or source (if any) will also be closed
@throws IOException
A RandomAccessSource that uses a {@link RandomAccessFile} as it's source
Note: Unlike most of the RandomAccessSource implementations, this class is not thread safe
The source
The length of the underling RAF. Note that the length is cached at construction time to avoid the possibility
of IOExceptions when reading the length.
Creates this object
@param raf the source for this RandomAccessSource
@throws IOException if the RAF can't be read
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
Note: the length is determined when the {@link RAFRandomAccessSource} is constructed. If the file length changes
after construction, that change will not be reflected in this call.
Closes the underlying RandomAccessFile
Factory to create {@link RandomAccessSource} objects based on various types of sources
@since 5.3.5
whether the full content of the source should be read into memory at construction
Whether {@link RandomAccessFile} should be used instead of a {@link FileChannel}, where applicable
Whether the underlying file should have a RW lock on it or just an R lock
Creates a factory that will give preference to accessing the underling data source using memory mapped files
Determines whether the full content of the source will be read into memory
@param forceRead true if the full content will be read, false otherwise
@return this object (this allows chaining of method calls)
Creates a {@link RandomAccessSource} based on a byte array
@param data the byte array
@return the newly created {@link RandomAccessSource}
Creates a {@link RandomAccessSource} based on a URL. The data available at the URL is read into memory and used
as the source for the {@link RandomAccessSource}
@param url the url to read from
@return the newly created {@link RandomAccessSource}
Creates a {@link RandomAccessSource} based on an {@link InputStream}. The full content of the InputStream is read into memory and used
as the source for the {@link RandomAccessSource}
@param is the stream to read from
@return the newly created {@link RandomAccessSource}
Creates a {@link RandomAccessSource} based on a filename string.
If the filename describes a URL, a URL based source is created
If the filename describes a file on disk, the contents may be read into memory (if forceRead is true), opened using memory mapped file channel (if usePlainRandomAccess is false), or opened using {@link RandomAccessFile} access (if usePlainRandomAccess is true)
This call will automatically failover to using {@link RandomAccessFile} if the memory map operation fails
@param filename the name of the file or resource to create the {@link RandomAccessSource} for
@return the newly created {@link RandomAccessSource}
Creates a new {@link RandomAccessSource} by reading the specified file/resource into memory
@param filename the name of the resource to read
@return the newly created {@link RandomAccessSource}
@throws IOException if reading the underling file or stream fails
Creates a new {@link RandomAccessSource} by reading the specified file/resource into memory
@param filename the name of the resource to read
@return the newly created {@link RandomAccessSource}
@throws IOException if reading the underling file or stream fails
An input stream that uses a RandomAccessSource as it's underlying source
@since 5.3.5
The source
The current position in the source
Creates an input stream based on the source
@param source the source
Utility class with commonly used stream operations
@since 5.3.5
Reads the full content of a stream and returns them in a byte array
@param is the stream to read
@return a byte array containing all of the bytes from the stream
@throws IOException if there is a problem reading from the input stream
Gets the font resources.
@param key the name of the resource
@return the Stream
to get the resource or
null
if not found
A RandomAccessSource that wraps another RandomAccessSouce and provides a window of it at a specific offset and over
a specific length. Position 0 becomes the offset position in the underlying source.
@since 5.3.5
The source
The amount to offset the source by
The length
Constructs a new OffsetRandomAccessSource that extends to the end of the underlying source
@param source the source
@param offset the amount of the offset to use
Constructs a new OffsetRandomAccessSource with an explicit length
@param source the source
@param offset the amount of the offset to use
@param length the number of bytes to be included in this RAS
{@inheritDoc}
Note that the position will be adjusted to read from the corrected location in the underlying source
{@inheritDoc}
Note that the position will be adjusted to read from the corrected location in the underlying source
{@inheritDoc}
Note that the length will be adjusted to read from the corrected location in the underlying source
{@inheritDoc}
The RTF jar depends on the iText jar, but the iText jar may not
depend on the RTF jar. This interface offers a temporary solution
until we find a more elegant way to solve this.
Interface for customizing the split character.
Interface for a text element to which other objects can be added.
Adds an object to the TextElementArray.
an object that has to be added
true if the addition succeeded; false otherwise
An Jpeg is the representation of a graphic element (JPEG)
that has to be inserted into the document
This is a type of marker.
This is a type of marker.
Acceptable Jpeg markers.
This is a type of marker.
Unsupported Jpeg markers.
This is a type of marker.
Jpeg markers without additional parameters.
Marker value for Photoshop IRB
sequence preceding Photoshop resolution data
Construct a Jpeg-object, using a Image
a Image
Constructs a Jpeg-object, using an Uri.
Deprecated, use Image.GetInstance(...) to create an Image
the Uri where the image can be found
Constructs a Jpeg-object from memory.
the memory image
Constructs a Jpeg-object from memory.
the memory image.
the width you want the image to have
the height you want the image to have
Reads a short from the Stream.
the Stream
an int
Reads an inverted short from the Stream.
the Stream
an int
Returns a type of marker.
an int
a type: VALID_MARKER, UNSUPPORTED_MARKER or NOPARAM_MARKER
This method checks if the image is a valid JPEG and processes some parameters.
An Jpeg2000
is the representation of a graphic element (JPEG)
that has to be inserted into the document
@see Element
@see Image
Constructs a Jpeg2000
-object, using an url.
@param url the URL
where the image can be found
@throws BadElementException
@throws IOException
Constructs a Jpeg2000
-object from memory.
@param img the memory image
@throws BadElementException
@throws IOException
Constructs a Jpeg2000
-object from memory.
@param img the memory image.
@param width the width you want the image to have
@param height the height you want the image to have
@throws BadElementException
@throws IOException
This method checks if the image is a valid JPEG and processes some parameters.
@throws BadElementException
@throws IOException
@return true
if the image is JP2, false
if a codestream.
A List contains several ListItems.
Example 1:
List list = new List(true, 20);
list.Add(new ListItem("First line"));
list.Add(new ListItem("The second line is longer to see what happens once the end of the line is reached. Will it start on a new line?"));
list.Add(new ListItem("Third line"));
The result of this code looks like this:
-
First line
-
The second line is longer to see what happens once the end of the line is reached. Will it start on a new line?
-
Third line
Example 2:
List overview = new List(false, 10);
overview.Add(new ListItem("This is an item"));
overview.Add("This is another item");
The result of this code looks like this:
-
This is an item
-
This is another item
a possible value for the numbered parameter
a possible value for the numbered parameter
a possible value for the lettered parameter
a possible value for the lettered parameter
a possible value for the lettered parameter
a possible value for the lettered parameter
This is the ArrayList containing the different ListItems.
Indicates if the list has to be numbered.
Indicates if the listsymbols are numerical or alphabetical.
Indicates if the listsymbols are lowercase or uppercase.
Indicates if the indentation has to be set automatically.
Indicates if the indentation of all the items has to be aligned.
This variable indicates the first number of a numbered list.
This is the listsymbol of a list that is not numbered.
In case you are using numbered/lettered lists, this String is added before the number/letter.
@since iText 2.1.1
In case you are using numbered/lettered lists, this String is added after the number/letter.
@since iText 2.1.1
The indentation of this list on the left side.
The indentation of this list on the right side.
The indentation of the listitems.
Constructs a List
.
Constructs a List
with a specific symbol indentation.
@param symbolIndent the symbol indentation
@since iText 2.0.8
Constructs a List
.
@param numbered a bool
Constructs a List
.
@param numbered a bool
@param lettered has the list to be 'numbered' with letters
Constructs a List.
the parameter symbolIndent is important for instance when
generating PDF-documents; it indicates the indentation of the listsymbol.
a bool
the indentation that has to be used for the listsymbol
Constructs a List.
a bool
a bool
the indentation that has to be used for the listsymbol
Processes the element by adding it (or the different parts) to an
IElementListener.
an IElementListener
true if the element was processed successfully
Gets the type of the text element.
a type
Gets all the chunks in this element.
an ArrayList
Adds an Object to the List.
the object to add
true is successful
Makes sure all the items in the list have the same indentation.
Alias for VB.NET compatibility.
Get/set the first number
an int
Sets the symbol
a Chunk
Sets the listsymbol.
This is a shortcut for SetListSymbol(Chunk symbol).
a string
Get/set the indentation of this paragraph on the left side.
the indentation
Get/set the indentation of this paragraph on the right side.
the indentation
Gets the symbol indentation.
the symbol indentation
@see com.lowagie.text.Element#isContent()
@since iText 2.0.8
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
Gets all the items in the list.
an ArrayList containing ListItems
Gets the size of the list.
a size
Returns true
if the list is empty.
@return true
if the list is empty
Gets the leading of the first listitem.
a leading
Get/set the symbol indentation.
a Chunk
Returns the String that is after a number or letter in the list symbol.
@return the String that is after a number or letter in the list symbol
@since iText 2.1.1
Sets the String that has to be added after a number or letter in the list symbol.
@since iText 2.1.1
@param postSymbol the String that has to be added after a number or letter in the list symbol.
Sets the String that has to be added before a number or letter in the list symbol.
@since iText 2.1.1
@param preSymbol the String that has to be added before a number or letter in the list symbol.
A ListItem is a Paragraph
that can be added to a List.
Example 1:
List list = new List(true, 20);
list.Add(new ListItem("First line"));
list.Add(new ListItem("The second line is longer to see what happens once the end of the line is reached. Will it start on a new line?"));
list.Add(new ListItem("Third line"));
The result of this code looks like this:
-
First line
-
The second line is longer to see what happens once the end of the line is reached. Will it start on a new line?
-
Third line
Example 2:
List overview = new List(false, 10);
overview.Add(new ListItem("This is an item"));
overview.Add("This is another item");
The result of this code looks like this:
-
This is an item
-
This is another item
this is the symbol that wil proceed the listitem.
Constructs a ListItem.
Constructs a ListItem with a certain leading.
the leading
Constructs a ListItem with a certain Chunk.
a Chunk
Constructs a ListItem with a certain string.
a string
Constructs a ListItem with a certain string
and a certain Font.
a string
a string
Constructs a ListItem with a certain Chunk
and a certain leading.
the leading
a Chunk
Constructs a ListItem with a certain string
and a certain leading.
the leading
a string
Constructs a ListItem with a certain leading, string
and Font.
@param leading the leading
@param string a string
@param font a Font
Constructs a ListItem with a certain leading, string
and Font.
the leading
a string
a Font
Constructs a ListItem with a certain Phrase.
a Phrase
Gets the type of the text element.
a type
Get/set the listsymbol.
a Chunk
Sets the indentation of this paragraph on the left side.
@param indentation the new indentation
Changes the font of the list symbol to the font of the first chunk
in the list item.
@since 5.0.6
Factory that creates a counter for every reader or writer class.
You can implement your own counter and declare it like this:
CounterFactory.getInstance().setCounter(new SysoCounter());
SysoCounter is just an example of a Counter implementation.
It writes info about files being read and written to the System.out.
This functionality can be used to create metrics in a SaaS context.
The singleton instance.
The current counter implementation.
The empty constructor.
Returns the singleton instance of the factory.
Returns a counter factory.
Getter for the counter.
Setter for the counter.
Implementation of the Counter interface that doesn't do anything.
@param klass
@return this Counter implementation
@see com.itextpdf.text.log.Counter#getCounter(java.lang.Class)
@see com.itextpdf.text.log.Counter#read(long)
@see com.itextpdf.text.log.Counter#written(long)
Interface that can be implemented if you want to count the number of documents
that are being processed by iText.
Implementers may use this method to record actual system usage for licensing purposes
(e.g. count the number of documents or the volumne in bytes in the context of a SaaS license).
Gets a Counter instance for a specific class.
This method gets triggered if a file is read.
@param l the length of the file that was written
This method gets triggered if a file is written.
@param l the length of the file that was written
Implementation of the Counter interface that doesn't do anything.
@param klass The Class asking for the Counter
@return the Counter instance
@see com.itextpdf.text.log.Counter#getCounter(java.lang.Class)
@see com.itextpdf.text.log.Counter#read(long)
@see com.itextpdf.text.log.Counter#written(long)
The name of the class for which the Counter was created
(or iText if no name is available)
Empty SysoCounter constructor.
Constructs a SysoCounter for a specific class.
@param klass
@see com.itextpdf.text.log.Counter#getCounter(java.lang.Class)
@see com.itextpdf.text.log.Counter#read(long)
@see com.itextpdf.text.log.Counter#written(long)
Logger interface
{@link LoggerFactory#setLogger(Logger)}.
@author redlab_b
@param klass
@return the logger for the given klass
@param level
@return true if there should be logged for the given level
Log a warning message.
@param message
Log a trace message.
@param message
Log a debug message.
@param message
Log an info message.
@param message
Log an error message.
@param message
Log an error message and exception.
@param message
@param e
The different log levels.
@author redlab_b
LoggerFactory can be used to set a logger. The logger should be created by
implementing {@link Logger}. In the implementation users can choose how they
log received messages. Added for developers. For some cases it can be handy
to receive logging statements while developing applications with iText
@author redlab_b
Returns the logger set in this LoggerFactory. Defaults to {@link NoOpLogger}
@param klass
@return the logger.
Returns the logger set in this LoggerFactory. Defaults to {@link NoOpLogger}
@param name
@return the logger.
Returns the LoggerFactory
@return singleton instance of this LoggerFactory
Set the global logger to process logging statements with.
@param logger the logger
Get the logger.
@return the logger
The no-operation logger, it does nothing with the received logging
statements. And returns false by default for {@link NoOpLogger#isLogging(Level)}
@author redlab_b
A Simple System.out logger.
@author redlab_be
Defaults packageReduce to 1.
Amount of characters each package name should be reduced with.
@param packageReduce
@param klass
@param shorten
@param name2
@return
Wrapper that allows to add properties to 'basic building block' objects.
Before iText 1.5 every 'basic building block' implemented the MarkupAttributes interface.
By setting attributes, you could add markup to the corresponding XML and/or HTML tag.
This functionality was hardly used by anyone, so it was removed, and replaced by
the MarkedObject functionality.
@deprecated since 5.5.9. This class is no longer used.
The element that is wrapped in a MarkedObject.
Contains extra markupAttributes
This constructor is for internal use only.
Creates a MarkedObject.
Gets all the chunks in this element.
@return an ArrayList
Processes the element by adding it (or the different parts) to an
ElementListener
.
@param listener an ElementListener
@return true
if the element was processed successfully
Gets the type of the text element.
@return a type
@see com.lowagie.text.Element#isContent()
@since iText 2.0.8
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
@return the markupAttributes
Wrapper that allows to add properties to a Chapter/Section object.
Before iText 1.5 every 'basic building block' implemented the MarkupAttributes interface.
By setting attributes, you could add markup to the corresponding XML and/or HTML tag.
This functionality was hardly used by anyone, so it was removed, and replaced by
the MarkedObject functionality.
@deprecated since 5.5.9. This class is no longer used.
This is the title of this section.
Creates a MarkedObject with a Section or Chapter object.
@param section the marked section
Adds a Paragraph
, List
or Table
to this Section
.
@param index index at which the specified element is to be inserted
@param o an object of type Paragraph
, List
or Table
=
@throws ClassCastException if the object is not a Paragraph
, List
or Table
Adds a Paragraph
, List
, Table
or another Section
to this Section
.
@param o an object of type Paragraph
, List
, Table
or another Section
@return a bool
@throws ClassCastException if the object is not a Paragraph
, List
, Table
or Section
Processes the element by adding it (or the different parts) to an
ElementListener
.
@param listener an ElementListener
@return true
if the element was processed successfully
Adds a collection of Element
s
to this Section
.
@param collection a collection of Paragraph
s, List
s and/or Table
s
@return true
if the action succeeded, false
if not.
@throws ClassCastException if one of the objects isn't a Paragraph
, List
, Table
Creates a Section
, adds it to this Section
and returns it.
@param indentation the indentation of the new section
@param numberDepth the numberDepth of the section
@return a new Section object
Creates a Section
, adds it to this Section
and returns it.
@param indentation the indentation of the new section
@return a new Section object
Creates a Section
, add it to this Section
and returns it.
@param numberDepth the numberDepth of the section
@return a new Section object
Creates a Section
, adds it to this Section
and returns it.
@return a new Section object
Sets the title of this section.
@param title the new title
Sets the indentation of this Section
on the left side.
@param indentation the indentation
Sets the indentation of this Section
on the right side.
@param indentation the indentation
Sets the indentation of the content of this Section
.
@param indentation the indentation
Setter for property bookmarkOpen.
@param bookmarkOpen false if the bookmark children are not
visible.
Setter for property triggerNewPage.
@param triggerNewPage true if a new page has to be triggered.
Sets the bookmark title. The bookmark title is the same as the section title but
can be changed with this method.
@param bookmarkTitle the bookmark title
Adds a new page to the section.
@since 2.1.1
This is an Element that contains
some meta information about the document.
An object of type Meta can not be constructed by the user.
Userdefined meta information should be placed in a Header-object.
Meta is reserved for: Subject, Keywords, Author, Title, Producer
and Creationdate information.
This is the type of Meta-information this object contains.
This is the content of the Meta-information.
The possible value of an alignment attribute.
@since 5.0.6 (moved from ElementTags)
The possible value of an alignment attribute.
@since 5.0.6 (moved from ElementTags)
The possible value of an alignment attribute.
@since 5.0.6 (moved from ElementTags)
The possible value of an alignment attribute.
@since 5.0.6 (moved from ElementTags)
The possible value of an alignment attribute.
@since 5.0.6 (moved from ElementTags)
The possible value of an alignment attribute.
@since 5.0.6 (moved from ElementTags)
The possible value of an alignment attribute.
@since 5.0.6 (moved from ElementTags)
Constructs a Meta.
the type of meta-information
the content
Constructs a Meta.
the tagname of the meta-information
the content
Processes the element by adding it (or the different parts) to a
IElementListener.
the IElementListener
true if the element was processed successfully
Gets the type of the text element.
a type
Gets all the chunks in this element.
an ArrayList
@see com.lowagie.text.Element#isContent()
@since iText 2.0.8
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
appends some text to this Meta.
a string
a StringBuilder
Returns the content of the meta information.
a string
Returns the name of the meta information.
a string
Returns the name of the meta information.
name to match
a string
The PageSize-object contains a number of read only rectangles representing the most common paper sizes.
This is the letter format
This is the note format
This is the legal format
This is the tabloid format
This is the executive format
This is the postcard format
This is the a0 format
This is the a1 format
This is the a2 format
This is the a3 format
This is the a4 format
This is the a5 format
This is the a6 format
This is the a7 format
This is the a8 format
This is the a9 format
This is the a10 format
This is the b0 format
This is the b1 format
This is the b2 format
This is the b3 format
This is the b4 format
This is the b5 format
This is the b6 format
This is the b7 format
This is the b8 format
This is the b9 format
This is the b10 format
This is the archE format
This is the archD format
This is the archC format
This is the archB format
This is the archA format
This is the American Foolscap format
This is the European Foolscap format
This is the halfletter format
This is the 11x17 format
This is the ISO 7810 ID-1 format (85.60 x 53.98 mm or 3.370 x 2.125 inch)
This is the ISO 7810 ID-2 format (A7 rotated)
This is the ISO 7810 ID-3 format (B7 rotated)
This is the ledger format
This is the Crown Quarto format
This is the Large Crown Quarto format
This is the Demy Quarto format.
This is the Royal Quarto format.
This is the Crown Octavo format
This is the Large Crown Octavo format
This is the Demy Octavo format
This is the Royal Octavo format.
This is the small paperback format.
This is the Pengiun small paperback format.
This is the Penguin large paparback format.
This is the letter format
@since iText 5.0.6
This is the legal format
@since iText 5.0.6
This is the a4 format
@since iText 5.0.6
This method returns a Rectangle based on a String.
Possible values are the the names of a constant in this class
(for instance "A4", "LETTER",...) or a value like "595 842"
A Paragraph is a series of Chunks and/or Phrases.
A Paragraph has the same qualities of a Phrase, but also
some additional layout-parameters:
the indentation
the alignment of the text
Paragraph p = new Paragraph("This is a paragraph",
FontFactory.GetFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new BaseColor(0, 0, 255)));
The alignment of the text.
The indentation of this paragraph on the left side.
The indentation of this paragraph on the right side.
Holds value of property firstLineIndent.
The spacing before the paragraph.
The spacing after the paragraph.
Holds value of property extraParagraphSpace.
Does the paragraph has to be kept together on 1 page.
Constructs a Paragraph.
Constructs a Paragraph with a certain leading.
the leading
Constructs a Paragraph with a certain Chunk.
a Chunk
Constructs a Paragraph with a certain Chunk
and a certain leading.
the leading
a Chunk
Constructs a Paragraph with a certain string.
a string
Constructs a Paragraph with a certain string
and a certain Font.
a string
a Font
Constructs a Paragraph with a certain string
and a certain leading.
the leading
a string
Constructs a Paragraph with a certain leading, string
and Font.
the leading
a string
a Font
Constructs a Paragraph with a certain Phrase.
a Phrase
Creates a shallow clone of the Paragraph.
@return
Creates a shallow clone of the Paragraph.
@return
Breaks this Paragraph up in different parts, separating paragraphs, lists and tables from each other.
@return
Breaks this Paragraph up in different parts, separating paragraphs, lists and tables from each other.
@return
Gets the type of the text element.
a type
Adds an Object to the Paragraph.
the object to add
a bool
Get/set the alignment of this paragraph.
a integer
Get/set the indentation of this paragraph on the left side.
a float
Get/set the indentation of this paragraph on the right side.
a float
Set/get if this paragraph has to be kept together on one page.
a bool
A Phrase is a series of Chunks.
A Phrase has a main Font, but some chunks
within the phrase can have a Font that differs from the
main Font. All the Chunks in a Phrase
have the same leading.
// When no parameters are passed, the default leading = 16
Phrase phrase0 = new Phrase();
Phrase phrase1 = new Phrase("this is a phrase");
// In this example the leading is passed as a parameter
Phrase phrase2 = new Phrase(16, "this is a phrase with leading 16");
// When a Font is passed (explicitely or embedded in a chunk), the default leading = 1.5 * size of the font
Phrase phrase3 = new Phrase("this is a phrase with a red, normal font Courier, size 12", FontFactory.GetFont(FontFactory.COURIER, 12, Font.NORMAL, new Color(255, 0, 0)));
Phrase phrase4 = new Phrase(new Chunk("this is a phrase"));
Phrase phrase5 = new Phrase(18, new Chunk("this is a phrase", FontFactory.GetFont(FontFactory.HELVETICA, 16, Font.BOLD, new Color(255, 0, 0)));
This is the leading of this phrase.
The text leading that is multiplied by the biggest font size in the line.
This is the font of this phrase.
Null, unless the Phrase has to be hyphenated.
@since 2.1.2
Predefined tab position and properties(alignment, leader and etc.);
@since 5.4.1
Constructs a Phrase without specifying a leading.
Has nine overloads.
Copy constructor for Phrase
.
Constructs a Phrase with a certain leading.
the leading
Constructs a Phrase with a certain Chunk.
a Chunk
Constructs a Phrase with a certain Chunk and a certain leading.
the leading
a Chunk
Constructs a Phrase with a certain string.
a string
Constructs a Phrase with a certain string and a certain Font.
a string
a Font
Constructs a Phrase with a certain leading and a certain string.
the leading
a string
Processes the element by adding it (or the different parts) to an
.
an IElementListener
true if the element was processed successfully
Gets the type of the text element.
a type
Gets all the chunks in this element.
an ArrayList
@see com.lowagie.text.Element#isContent()
@since iText 2.0.8
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
Adds a Chunk, an Anchor or another Phrase
to this Phrase.
index at which the specified element is to be inserted
an object of type Chunk, Anchor, or Phrase
Adds a String
to this Phrase
.
@param s a string
@return a boolean
@since 5.0.1
Adds a Chunk, Anchor or another Phrase
to this Phrase.
an object of type Chunk, Anchor or Phrase
a bool
Adds a collection of Chunks
to this Phrase.
a collection of Chunks, Anchors and Phrases.
true if the action succeeded, false if not.
Adds a Chunk.
This method is a hack to solve a problem I had with phrases that were split between chunks
in the wrong place.
a Chunk
a bool
Adds a Object to the Paragraph.
the object to add.
Checks is this Phrase contains no or 1 empty Chunk.
false if the Phrase
contains more than one or more non-emptyChunks.
Gets/sets the leading of this phrase.
the linespacing
Gets the total leading.
This method is based on the assumption that the
font of the Paragraph is the font of all the elements
that make part of the paragraph. This isn't necessarily
true.
@return the total leading (fixed and multiplied)
Gets the font of the first Chunk that appears in this Phrase.
a Font
Returns the content as a String object.
This method differs from toString because toString will return an ArrayList with the toString value of the Chunks in this Phrase.
Setter/getter for the hyphenation.
@param hyphenation a HyphenationEvent instance
@since 2.1.2
Setter/getter for the tabSettings.
@param tabSettings a TabSettings instance
@since 5.4.1
Constructs a Phrase that can be used in the static GetInstance() method.
@param dummy a dummy parameter
Gets a special kind of Phrase that changes some characters into corresponding symbols.
@param string
@return a newly constructed Phrase
Gets a special kind of Phrase that changes some characters into corresponding symbols.
@param leading
@param string
@return a newly constructed Phrase
Gets a special kind of Phrase that changes some characters into corresponding symbols.
@param leading
@param string
@param font
@return a newly constructed Phrase
A Rectangle is the representation of a geometric figure.
This is the value that will be used as undefined.
This represents one side of the border of the Rectangle.
This represents one side of the border of the Rectangle.
This represents one side of the border of the Rectangle.
This represents one side of the border of the Rectangle.
This represents a rectangle without borders.
This represents a type of border.
the lower left x-coordinate.
the lower left y-coordinate.
the upper right x-coordinate.
the upper right y-coordinate.
This represents the status of the 4 sides of the rectangle.
This is the width of the border around this rectangle.
This is the color of the border of this rectangle.
The color of the left border of this rectangle.
The color of the right border of this rectangle.
The color of the top border of this rectangle.
The color of the bottom border of this rectangle.
The width of the left border of this rectangle.
The width of the right border of this rectangle.
The width of the top border of this rectangle.
The width of the bottom border of this rectangle.
Whether variable width borders are used.
This is the color of the background of this rectangle.
This is the rotation value of this rectangle.
Constructs a Rectangle-object.
lower left x
lower left y
upper right x
upper right y
Constructs a Rectangle
-object.
@param llx lower left x
@param lly lower left y
@param urx upper right x
@param ury upper right y
@param rotation the rotation (0, 90, 180, or 270)
@since iText 5.0.6
Constructs a Rectangle-object starting from the origin (0, 0).
upper right x
upper right y
Constructs a Rectangle
-object starting from the origin
(0, 0) and with a specific rotation (valid values are 0, 90, 180, 270).
@param urx upper right x
@param ury upper right y
@param rotation the rotation of the rectangle
@since iText 5.0.6
Constructs a Rectangle-object.
another Rectangle
Constructs a Rectangle
-object based on a com.itextpdf.awt.geom.Rectangle
object
@param rect com.itextpdf.awt.geom.Rectangle
Copies all of the parameters from a Rectangle
object
except the position.
@param rect
Rectangle
to copy from
Copies all of the parameters from a Rectangle
object
except the position.
@param rect
Rectangle
to copy from
Processes the element by adding it (or the different parts) to an
IElementListener.
an IElementListener
true if the element was processed successfully
Gets the type of the text element.
a type
Gets all the chunks in this element.
an ArrayList
@see com.lowagie.text.Element#isContent()
@since iText 2.0.8
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
Switches lowerleft with upperright
Gets a Rectangle that is altered to fit on the page.
the top position
the bottom position
a Rectangle
Swaps the values of urx and ury and of lly and llx in order to rotate the rectangle.
a Rectangle
Get/set the upper right y-coordinate.
a float
Enables the border on the specified side.
@param side
the side to enable. One of LEFT, RIGHT, TOP, BOTTOM
Disables the border on the specified side.
@param side
the side to disable. One of LEFT, RIGHT, TOP, BOTTOM
Get/set the border
a int
Get/set the grayscale of the rectangle.
a float
Get/set the lower left x-coordinate.
a float
Get/set the upper right x-coordinate.
a float
Get/set the lower left y-coordinate.
a float
Returns the lower left x-coordinate, considering a given margin.
a margin
the lower left x-coordinate
Returns the upper right x-coordinate, considering a given margin.
a margin
the upper right x-coordinate
Returns the upper right y-coordinate, considering a given margin.
a margin
the upper right y-coordinate
Returns the lower left y-coordinate, considering a given margin.
a margin
the lower left y-coordinate
Returns the width of the rectangle.
a width
Returns the height of the rectangle.
a height
Indicates if the table has borders.
a bool
Indicates if the table has a some type of border.
the type of border
a bool
Get/set the borderwidth.
a float
Gets the color of the border.
@return a value
Get/set the color of the border.
a BaseColor
Gets the backgroundcolor.
@return a value
Get/set the backgroundcolor.
a BaseColor
Set/gets the rotation
a int
Updates the border flag for a side based on the specified width. A width
of 0 will disable the border on that side. Any other width enables it.
@param width
width of border
@param side
border side constant
Sets a parameter indicating if the rectangle has variable borders
@param useVariableBorders
indication if the rectangle has variable borders
A RectangleReadOnly is the representation of a geometric figure.
It's the same as a Rectangle but immutable.
Constructs a RectangleReadOnly-object.
lower left x
lower left y
upper right x
upper right y
Constructs a RectangleReadOnly
-object.
@param llx lower left x
@param lly lower left y
@param urx upper right x
@param ury upper right y
@param rotation the rotation of the Rectangle (0, 90, 180, 270)
@since iText 5.0.6
Constructs a RectangleReadOnly-object starting from the origin (0, 0).
upper right x
upper right y
Constructs a RectangleReadOnly
-object starting from the origin
(0, 0) and with a specific rotation (valid values are 0, 90, 180, 270).
@param urx upper right x
@param ury upper right y
@since iText 5.0.6
Constructs a RectangleReadOnly-object.
another Rectangle
Copies all of the parameters from a Rectangle
object
except the position.
@param rect
Rectangle
to copy from
Copies all of the parameters from a Rectangle
object
except the position.
@param rect
Rectangle
to copy from
Switches lowerleft with upperright
Get/set the upper right y-coordinate.
a float
Enables the border on the specified side.
@param side
the side to enable. One of LEFT, RIGHT, TOP, BOTTOM
Disables the border on the specified side.
@param side
the side to disable. One of LEFT, RIGHT, TOP, BOTTOM
Get/set the border
a int
Get/set the grayscale of the rectangle.
a float
Get/set the lower left x-coordinate.
a float
Get/set the upper right x-coordinate.
a float
Get/set the lower left y-coordinate.
a float
Get/set the borderwidth.
a float
Gets the color of the border.
@return a value
Get/set the color of the border.
a BaseColor
Gets the backgroundcolor.
@return a value
Get/set the backgroundcolor.
a BaseColor
Set/gets the rotation
a int
Sets a parameter indicating if the rectangle has variable borders
@param useVariableBorders
indication if the rectangle has variable borders
A special-version of LIST
which use roman-letters.
@see com.lowagie.text.List
@version 2003-06-22
@author Michael Niedermair
Initialization
Initialization
@param symbolIndent indent
Initialization
@param romanlower roman-char in lowercase
@param symbolIndent indent
Adds an Object
to the List
.
@param o the object to add.
@return true if adding the object succeeded
A Section is a part of a Document containing
other Sections, Paragraphs, List
and/or Tables.
You can not construct a Section yourself.
You will have to ask an instance of Section to the
Chapter or Section to which you want to
add the new Section.
Paragraph title2 = new Paragraph("This is Chapter 2", FontFactory.GetFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255)));
Chapter chapter2 = new Chapter(title2, 2);
Paragraph someText = new Paragraph("This is some text");
chapter2.Add(someText);
Paragraph title21 = new Paragraph("This is Section 1 in Chapter 2", FontFactory.GetFont(FontFactory.HELVETICA, 16, Font.BOLD, new Color(255, 0, 0)));
Section section1 = chapter2.AddSection(title21);
Paragraph someSectionText = new Paragraph("This is some silly paragraph in a chapter and/or section. It contains some text to test the functionality of Chapters and Section.");
section1.Add(someSectionText);
Paragraph title211 = new Paragraph("This is SubSection 1 in Section 1 in Chapter 2", FontFactory.GetFont(FontFactory.HELVETICA, 14, Font.BOLD, new Color(255, 0, 0)));
Section section11 = section1.AddSection(40, title211, 2);
section11.Add(someSectionText);strong>
A possible number style. The default number style: "1.2.3."
@since iText 2.0.8
A possible number style. For instance: "1.2.3"
@since iText 2.0.8
This is the title of this section.
This is the number of sectionnumbers that has to be shown before the section title.
The style for sectionnumbers.
@since iText 2.0.8
The indentation of this section on the left side.
The indentation of this section on the right side.
The additional indentation of the content of this section.
This is the number of subsections.
This is the complete list of sectionnumbers of this section and the parents of this section.
Indicates if the Section will be complete once added to the document.
@since iText 2.0.8
Indicates if the Section was added completely to the document.
@since iText 2.0.8
Indicates if this is the first time the section was added.
@since iText 2.0.8
false if the bookmark children are not visible
true if the section has to trigger a new page
The bookmark title if different from the content title
Constructs a new Section.
Has 2 overloads.
Constructs a new Section.
a Paragraph
the numberDepth
Sets the number of this section.
the number of this section
an ArrayList, containing the numbers of the Parent
Processes the element by adding it (or the different parts) to an
IElementListener.
the IElementListener
true if the element was processed successfully
Gets the type of the text element.
a type
Gets all the chunks in this element.
an ArrayList
@see com.lowagie.text.Element#isContent()
@since iText 2.0.8
@see com.lowagie.text.Element#isNestable()
@since iText 2.0.8
Adds a Paragraph, List or Table
to this Section.
index at which the specified element is to be inserted
an object of type Paragraph, List or Table
Adds a Paragraph, List, Table or another Section
to this Section.
an object of type Paragraph, List, Table or another Section
a bool
Adds a collection of Elements
to this Section.
a collection of Paragraphs, Lists and/or Tables
true if the action succeeded, false if not.
Creates a Section, adds it to this Section and returns it.
the indentation of the new section
the title of the new section
the numberDepth of the section
the newly added Section
Creates a Section, adds it to this Section and returns it.
the indentation of the new section
the title of the new section
the newly added Section
Creates a Section, add it to this Section and returns it.
the title of the new section
the numberDepth of the section
the newly added Section
Adds a marked section. For use in class MarkedSection only!
Creates a Section, adds it to this Section and returns it.
the title of the new section
the newly added Section
Adds a Section to this Section and returns it.
@param indentation the indentation of the new section
@param title the title of the new section
@param numberDepth the numberDepth of the section
Adds a Section to this Section and returns it.
the indentation of the new section
the title of the new section
the numberDepth of the section
the newly added Section
Adds a Section to this Section and returns it.
@param title the title of the new section
@param numberDepth the numberDepth of the section
Adds a Section to this Section and returns it.
the title of the new section
the numberDepth of the section
the newly added Section
Adds a Section to this Section and returns it.
the indentation of the new section
the title of the new section
the newly added Section
Adds a Section to this Section and returns it.
the title of the new section
the newly added Section
Get/set the title of this section
a Paragraph
Sets the style for numbering sections.
Possible values are NUMBERSTYLE_DOTTED: 1.2.3. (the default)
or NUMBERSTYLE_DOTTED_WITHOUT_FINAL_DOT: 1.2.3
@since iText 2.0.8
Constructs a Paragraph that will be used as title for a Section or Chapter.
@param title the title of the section
@param numbers a list of sectionnumbers
@param numberDepth how many numbers have to be shown
@param numberStyle the numbering style
@return a Paragraph object
@since iText 2.0.8
Checks if this object is a Chapter.
true if it is a Chapter,
false if it is a Section
Checks if this object is a Section.
true if it is a Section,
false if it is a Chapter.
Get/set the numberdepth of this Section.
a int
Get/set the indentation of this Section on the left side.
the indentation
Get/set the indentation of this Section on the right side.
the indentation
Get/set the indentation of the content of this Section.
the indentation
Returns the depth of this section.
the depth
Get/set the bookmark
a bool
Gets the bookmark title.
@return the bookmark title
Sets the bookmark title. The bookmark title is the same as the section title but
can be changed with this method.
@param bookmarkTitle the bookmark title
Changes the Chapter number.
Indicates if this is the first time the section is added.
@since iText2.0.8
@return true if the section wasn't added yet
@see com.lowagie.text.LargeElement#isAddedCompletely()
@since iText 2.0.8
@since iText 2.0.8
@see com.lowagie.text.LargeElement#flushContent()
@since iText 2.0.8
@see com.lowagie.text.LargeElement#isComplete()
Adds a new page to the section.
@since 2.1.1
Returns the first occurrence of a special symbol in a String
.
@param string a String
@return an index of -1 if no special symbol was found
Gets a chunk with a symbol character.
@param c a character that has to be changed into a symbol
@param font Font if there is no SYMBOL character corresponding with c
@return a SYMBOL version of a character
Looks for the corresponding symbol in the font Symbol.
@param c the original ASCII-char
@return the corresponding symbol in font Symbol
A collection of convenience methods that were present in many different iText
classes.
Utility method to extend an array.
@param original the original array or null
@param item the item to be added to the array
@return a new array with the item appended
Checks for a true/false value of a key in a Properties object.
@param attributes
@param key
@return
This method makes a valid URL from a given filename.
a given filename
a valid URL
Unescapes an URL. All the "%xx" are replaced by the 'xx' hex char value.
@param src the url to unescape
@return the eunescaped value
This method is an alternative for the Stream.Skip()-method
that doesn't seem to work properly for big values of size.
the stream
the number of bytes to skip
Measurement conversion from millimeters to points.
@param value a value in millimeters
@return a value in points
@since 2.1.2
Measurement conversion from millimeters to inches.
@param value a value in millimeters
@return a value in inches
@since 2.1.2
Measurement conversion from points to millimeters.
@param value a value in points
@return a value in millimeters
@since 2.1.2
Measurement conversion from points to inches.
@param value a value in points
@return a value in inches
@since 2.1.2
Measurement conversion from inches to millimeters.
@param value a value in inches
@return a value in millimeters
@since 2.1.2
Measurement conversion from inches to points.
@param value a value in inches
@return a value in points
@since 2.1.2
Reads the contents of a file to a String.
@param path the path to the file
@return a String with the contents of the file
@since iText 5.0.0
Converts an array of bytes to a String of hexadecimal values
@param bytes a byte array
@return the same bytes expressed as hexadecimal values
The ParserBase
-class provides XML document parsing.
Begins the process of processing an XML document
the XML document to parse
This method gets called when a start tag is encountered.
the name of the tag that is encountered
the list of attributes
This method gets called when an end tag is encountered.
the name of the tag that ends
This method gets called when characters are encountered.
an array of characters
the start position in the array
the number of characters to read from the array
This class contains entities that can be used in an entity tag.
This is a map that contains all possible id values of the entity tag
that can be translated to a character in font Symbol.
Gets a chunk with a symbol character.
@param e a symbol value (see Entities class: alfa is greek alfa,...)
@param font the font if the symbol isn't found (otherwise Font.SYMBOL)
@return a Chunk
Looks for the corresponding symbol in the font Symbol.
@param name the name of the entity
@return the corresponding character in font Symbol
This class contains entities that can be used in an entity tag.
This is a map that contains the names of entities and their unicode value.
Translates an entity to a unicode character.
@param name the name of the entity
@return the corresponding unicode character
Translates a IANA encoding name to a Java encoding.
The object that maps IANA to Java encodings.
The handler for the events fired by SimpleXMLParser
.
@author Paulo Soares
Called when a start tag is found.
@param tag the tag name
@param h the tag's attributes
Called when an end tag is found.
@param tag the tag name
Called when the document starts to be parsed.
Called after the document is parsed.
Called when a text element is found.
@param str the text element, probably a fragment.
The handler for the events fired by SimpleXMLParser
.
@author Paulo Soares
Called when a comment is found.
@param text the comment text
possible states
the state stack
The current character.
The previous character.
the line we are currently reading
the column where the current character occurs
was the last character equivalent to a newline?
A boolean indicating if the next character should be taken into account
if it's a space character. When nospace is false, the previous character
wasn't whitespace.
@since 2.1.5
the current state
Are we parsing HTML?
current text (whatever is encountered between tags)
current tagname
current attributes
The handler to which we are going to forward document content
The handler to which we are going to forward comments.
Keeps track of the number of tags that are open.
the quote character that was used to open the quote.
the attribute key.
the attribute value.
Creates a Simple XML parser object.
Call Go(BufferedReader) immediately after creation.
Does the actual parsing. Perform this immediately
after creating the parser object.
Gets a state from the stack
@return the previous state
Adds a state to the stack.
@param s a state to add to the stack
Flushes the text that is currently in the buffer.
The text can be ignored, added to the document
as content or as comment,... depending on the current state.
Initialized the tag name and attributes.
Sets the name of the tag.
processes the tag.
@param start if true we are dealing with a tag that has just been opened; if false we are closing a tag.
Throws an exception
Parses the XML document firing the events to the handler.
@param doc the document handler
@param r the document. The encoding is already resolved. The reader is not closed
@throws IOException on error
Parses the XML document firing the events to the handler.
@param doc the document handler
@param in the document. The encoding is deduced from the stream. The stream is not closed
@throws IOException on error
Escapes a string with the appropriated XML codes.
@param s the string to be escaped
@param onlyASCII codes above 127 will always be escaped with &#nn; if true
@return the escaped string
This {@link NewLineHandler} returns true on the tags p
,
blockqoute
and br
@author Balder
Default constructor
@since 5.0.6
Always returns false.
@author Balder
@since 5.0.6
A NewLineHandler determines if an encountered tag should result in a new line
in a document.
@author Balder
@since 5.0.6
@param tag the tag to check if after this one a new line should be in a document
@return true in case a new line should be added.
@since 5.0.6
An implementation of an XmpSchema.
default namespace identifier
default namespace uri
External Contributors to the resource (other than the authors).
The extent or scope of the resource.
The authors of the resource (listed in order of precedence, if significant).
Date(s) that something interesting happened to the resource.
A textual description of the content of the resource. Multiple values may be present for different languages.
The file format used when saving the resource. Tools and applications should set this property to the save format of the data. It may include appropriate qualifiers.
Unique identifier of the resource.
An unordered array specifying the languages used in the resource.
Publishers.
Relationships to other documents.
Informal rights statement, selected by language.
Unique identifier of the work from which this resource was derived.
An unordered array of descriptive phrases or keywords that specify the topic of the content of the resource.
The title of the document, or the name given to the resource. Typically, it will be a name by which the resource is formally known.
A document type; for example, novel, poem, or working paper.
@param shorthand
@throws IOException
Adds a title.
@param title
Adds a title.
@param title
Adds a description.
@param desc
Adds a description.
@param desc
Adds a subject.
@param subject
Adds a subject.
@param subject array of subjects
Adds a single author.
@param author
Adds an array of authors.
@param author
Adds a single publisher.
@param publisher
Adds an array of publishers.
@param publisher
A wrapper for an Encoding to suppress the preamble.
Key for the default language.
Creates a Properties object that stores languages for use in an XmpSchema
Creates a Properties object that stores languages for use in an XmpSchema
Add a language.
Process a property.
Creates a String that can be used in an XmpSchema.
An implementation of an XmpSchema.
default namespace identifier
default namespace uri
Keywords.
The PDF file version (for example: 1.0, 1.3, and so on).
The Producer.
@throws IOException
Adds keywords.
@param keywords
Adds the producer.
@param producer
Adds the version.
@param version
StringBuilder to construct an XMP array.
An array that is unordered.
An array that is ordered.
An array with alternatives.
the type of array.
Creates an XmpArray.
@param type the type of array: UNORDERED, ORDERED or ALTERNATIVE.
Returns the String representation of the XmpArray.
@return a String representation
An implementation of an XmpSchema.
default namespace identifier
default namespace uri
An unordered array specifying properties that were edited outside the authoring application. Each item should contain a single namespace and XPath separated by one ASCII space (U+0020).
The base URL for relative URLs in the document content. If this document contains Internet links, and those links are relative, they are relative to this base URL. This property provides a standard way for embedded relative URLs to be interpreted by tools. Web authoring tools should set the value based on their notion of where URLs will be interpreted.
The date and time the resource was originally created.
The name of the first known tool used to create the resource. If history is present in the metadata, this value should be equivalent to that of xmpMM:History�s softwareAgent property.
An unordered array of text strings that unambiguously identify the resource within a given context.
The date and time that any metadata for this resource was last changed.
The date and time the resource was last modified.
A short informal name for the resource.
An alternative array of thumbnail images for a file, which can differ in characteristics such as size or image encoding.
@param shorthand
@throws IOException
Adds the creatortool.
@param creator
Adds the creation date.
@param date
Adds the modification date.
@param date
Adds the meta data date.
@param date
Adds the identifier.
@param id
Adds the nickname.
@param name
An implementation of an XmpSchema.
default namespace identifier
default namespace uri
A reference to the original document from which this one is derived. It is a minimal reference; missing components can be assumed to be unchanged. For example, a new version might only need to specify the instance ID and version number of the previous version, or a rendition might only need to specify the instance ID and rendition class of the original.
The common identifier for all versions and renditions of a document.
An ordered array of high-level user actions that resulted in this resource. It is intended to give human readers a general indication of the steps taken to make the changes from the previous version to this one. The list should be at an abstract level; it is not intended to be an exhaustive keystroke or other detailed history.
A reference to the document as it was prior to becoming managed. It is set when a managed document is introduced to an asset management system that does not currently own it. It may or may not include references to different management systems.
The name of the asset management system that manages this resource.
A URI identifying the managed resource to the asset management system; the presence of this property is the formal indication that this resource is managed. The form and content of this URI is private to the asset management system.
A URI that can be used to access information about the managed resource through a web browser. It might require a custom browser plugin.
Specifies a particular variant of the asset management system. The format of this property is private to the specific asset management system.
The rendition class name for this resource.
Can be used to provide additional rendition parameters that are too complex or verbose to encode in xmpMM: RenditionClass.
The document version identifier for this resource.
The version history associated with this resource.
@throws IOException
Reads an XMP stream into an org.w3c.dom.Document objects.
Allows you to replace the contents of a specific tag.
@since 2.1.3
String used to fill the extra space.
Processing Instruction required at the start of an XMP stream
@since iText 2.1.6
Processing Instruction required at the end of an XMP stream for XMP streams that can be updated
@since iText 2.1.6
Constructs an XMP reader
@param bytes the XMP content
@throws ExceptionConverter
@throws IOException
@throws SAXException
Replaces the content of a tag.
@param namespaceURI the URI of the namespace
@param localName the tag name
@param value the new content for the tag
@return true if the content was successfully replaced
@since 2.1.6 the return type has changed from void to boolean
Replaces the content of an attribute in the description tag.
@param namespaceURI the URI of the namespace
@param localName the tag name
@param value the new content for the tag
@return true if the content was successfully replaced
@since 5.0.0 the return type has changed from void to boolean
Adds a tag.
@param namespaceURI the URI of the namespace
@param parent the tag name of the parent
@param localName the name of the tag to add
@param value the new content for the tag
@return true if the content was successfully added
@since 2.1.6
Sets the text of this node. All the child's node are deleted and a new
child text node is created.
@param domDocument the Document
that contains the node
@param n the Node
to add the text to
@param value the text to add
Writes the document to a byte array.
Abstract superclass of the XmpSchemas supported by iText.
the namesspace
Constructs an XMP schema.
@param xmlns
The String representation of the contents.
@return a String representation.
Processes a property
@param buf
@param p
@return Returns the xmlns.
@param key
@param value
@return the previous property (null if there wasn't one)
@see java.util.Properties#setProperty(java.lang.String, java.lang.String)
@param key
@param value
@return the previous property (null if there wasn't one)
@param content
@return
With this class you can create an Xmp Stream that can be used for adding
Metadata to a PDF Dictionary. Remark that this class doesn't cover the
complete XMP specification.
A possible charset for the XMP.
A possible charset for the XMP.
A possible charset for the XMP.
A possible charset for the XMP.
Creates an XmpWriter.
@param os
@param utfEncoding
@param extraSpace
@throws IOException
Creates an XmpWriter.
@param os
@throws IOException
@param os
@param info
@throws IOException
@param os
@param info
@throws IOException
@since 5.0.1 (generic type in signature)
Sets the XMP to read-only
@param about The about to set.
Adds an rdf:Description.
@param xmlns
@param content
@throws IOException
Adds an rdf:Description.
@param s
@throws IOException
@param schemaNS The namespace URI for the property. Has the same usage as in getProperty.
@param propName The name of the property.
Has the same usage as in getProperty()
.
@param value the value for the property (only leaf properties have a value).
Arrays and non-leaf levels of structs do not have values.
Must be null
if the value is not relevant.
The value is automatically detected: Boolean, Integer, Long, Double, XMPDateTime and
byte[] are handled, on all other toString()
is called.
@throws XMPException Wraps all errors and exceptions that may occur.
Simplifies the construction of an array by not requiring that you pre-create an empty array.
The array that is assigned is created automatically if it does not yet exist. Each call to
AppendArrayItem() appends an item to the array.
@param schemaNS The namespace URI for the array.
@param arrayName The name of the array. May be a general path expression, must not be null or
the empty string.
@param value the value of the array item.
@throws XMPException Wraps all errors and exceptions that may occur.
Simplifies the construction of an ordered array by not requiring that you pre-create an empty array.
The array that is assigned is created automatically if it does not yet exist. Each call to
AppendArrayItem() appends an item to the array.
@param schemaNS The namespace URI for the array.
@param arrayName The name of the array. May be a general path expression, must not be null or
the empty string.
@param value the value of the array item.
@throws XMPException Wraps all errors and exceptions that may occur.
Simplifies the construction of an alternate array by not requiring that you pre-create an empty array.
The array that is assigned is created automatically if it does not yet exist. Each call to
AppendArrayItem() appends an item to the array.
@param schemaNS The namespace URI for the array.
@param arrayName The name of the array. May be a general path expression, must not be null or
the empty string.
@param value the value of the array item.
@throws XMPException Wraps all errors and exceptions that may occur.
Flushes and closes the XmpWriter.
@throws IOException
Flushes and closes the XmpWriter.
@throws IOException
External Contributors to the resource (other than the authors).
The extent or scope of the resource.
The authors of the resource (listed in order of precedence, if significant).
Date(s) that something interesting happened to the resource.
A textual description of the content of the resource. Multiple values may be present for different languages.
The file format used when saving the resource. Tools and applications should set this property to the save format of the data. It may include appropriate qualifiers.
Unique identifier of the resource.
An unordered array specifying the languages used in the resource.
Publishers.
Relationships to other documents.
Informal rights statement, selected by language.
Unique identifier of the work from which this resource was derived.
An unordered array of descriptive phrases or keywords that specify the topic of the content of the resource.
The title of the document, or the name given to the resource. Typically, it will be a name by which the resource is formally known.
A document type; for example, novel, poem, or working paper.
Adds a title.
@param xmpMeta
@param title
Sets a title.
@param xmpMeta
@param title
@param genericLang The name of the generic language
@param specificLang The name of the specific language
Adds a description.
@param xmpMeta
@param desc
Sets a description.
@param xmpMeta
@param desc
@param genericLang The name of the generic language
@param specificLang The name of the specific language
Adds a subject.
@param xmpMeta
@param subject
Sets a subject.
@param xmpMeta
@param subject array of subjects
Adds a single author.
@param xmpMeta
@param author
Sets an array of authors.
@param xmpMeta
@param author
Adds a single publisher.
@param xmpMeta
@param publisher
Sets an array of publishers.
@param xmpMeta
@param publisher
Keywords.
The PDF file version (for example: 1.0, 1.3, and so on).
The Producer.
Adds keywords.
@param xmpMeta
@param keywords
Adds the producer.
@param xmpMeta
@param producer
Adds the version.
@param xmpMeta
@param version
An unordered array specifying properties that were edited outside the authoring application. Each item should contain a single namespace and XPath separated by one ASCII space (U+0020).
The base URL for relative URLs in the document content. If this document contains Internet links, and those links are relative, they are relative to this base URL. This property provides a standard way for embedded relative URLs to be interpreted by tools. Web authoring tools should set the value based on their notion of where URLs will be interpreted.
The date and time the resource was originally created.
The name of the first known tool used to create the resource. If history is present in the metadata, this value should be equivalent to that of xmpMM:History's softwareAgent property.
An unordered array of text strings that unambiguously identify the resource within a given context.
The date and time that any metadata for this resource was last changed.
The date and time the resource was last modified.
A short informal name for the resource.
An alternative array of thumbnail images for a file, which can differ in characteristics such as size or image encoding.
Adds the creatortool.
@param xmpMeta
@param creator
Adds the creation date.
@param xmpMeta
@param date
Adds the modification date.
@param xmpMeta
@param date
Adds the meta data date.
@param xmpMeta
@param date
Sets the identifier.
@param xmpMeta
@param id
Adds the nickname.
@param xmpMeta
@param name
A reference to the original document from which this one is derived. It is a minimal reference; missing components can be assumed to be unchanged. For example, a new version might only need to specify the instance ID and version number of the previous version, or a rendition might only need to specify the instance ID and rendition class of the original.
The common identifier for all versions and renditions of a document.
An ordered array of high-level user actions that resulted in this resource. It is intended to give human readers a general indication of the steps taken to make the changes from the previous version to this one. The list should be at an abstract level; it is not intended to be an exhaustive keystroke or other detailed history.
A reference to the document as it was prior to becoming managed. It is set when a managed document is introduced to an asset management system that does not currently own it. It may or may not include references to different management systems.
The name of the asset management system that manages this resource.
A URI identifying the managed resource to the asset management system; the presence of this property is the formal indication that this resource is managed. The form and content of this URI is private to the asset management system.
A URI that can be used to access information about the managed resource through a web browser. It might require a custom browser plugin.
Specifies a particular variant of the asset management system. The format of this property is private to the specific asset management system.
The rendition class name for this resource.
Can be used to provide additional rendition parameters that are too complex or verbose to encode in xmpMM: RenditionClass.
The document version identifier for this resource.
The version history associated with this resource.
@author psoares
Print writer.
Canonical output.
Processing XML 1.1 document.
Default constructor.
Sets whether output is canonical.
Sets the output stream for printing.
Sets the output writer.
Writes the specified node, recursively.
Returns a sorted list of attributes.
Normalizes and prints the given string.
Normalizes and print the given character.
This class converts XML into plain text stripping all tags.
Buffer that stores all content that is encountered.
Static method that parses an XML Stream.
@param is the XML input that needs to be parsed
@return a String obtained by removing all tags from the XML
Creates an instance of XML to TXT.
@return the String after parsing.
@see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#startElement(java.lang.String, java.util.Map)
@see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#endElement(java.lang.String)
@see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#startDocument()
@see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#endDocument()
@see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#text(java.lang.String)
Contains utility methods for XML.
@author Balder
@since 5.0.6
Escapes a string with the appropriated XML codes.
@param s the string to be escaped
@param onlyASCII codes above 127 will always be escaped with &#nn; if true
@return the escaped string
@since 5.0.6
Unescapes 'lt', 'gt', 'apos', 'quote' and 'amp' to the
corresponding character values.
@param s a string representing a character
@return a character value
Checks if a character value should be escaped/unescaped.
@param s the String representation of an integer
@return true if it's OK to escape or unescape this value
Checks if a character value should be escaped/unescaped.
@param c a character value
@return true if it's OK to escape or unescape this value
Looks for a character in a character array, starting from a certain position
@param needle the character you're looking for
@param haystack the character array
@param start the start position
@return the position where the character was found, or -1 if it wasn't found.
Returns the IANA encoding name that is auto-detected from
the bytes specified, with the endian-ness of that encoding where appropriate.
(method found in org.apache.xerces.impl.XMLEntityManager, originally published
by the Apache Software Foundation under the Apache Software License; now being
used in iText under the MPL)
@param b4 The first four bytes of the input.
@return an IANA-encoding string
@since 5.0.6
A special-version of LIST
whitch use zapfdingbats-letters.
@see com.lowagie.text.List
@author Michael Niedermair and Bruno Lowagie
char-number in zapfdingbats
Creates a ZapfDingbatsList
@param zn a char-number
Creates a ZapfDingbatsList
@param zn a char-number
@param symbolIndent indent
Sets the dingbat's color.
@param zapfDingbatColor color for the ZapfDingbat
set the char-number
@param zn a char-number
Adds an Object
to the List
.
@param o the object to add.
@return true if adding the object succeeded
A special-version of LIST
whitch use zapfdingbats-numbers (1..10).
@see com.lowagie.text.List
@version 2003-06-22
@author Michael Niedermair
which type
Creates a ZapdDingbatsNumberList
@param type the type of list
@param symbolIndent indent
Creates a ZapdDingbatsNumberList
@param type the type of list
@param symbolIndent indent
get the type
@return char-number
Adds an Object
to the List
.
@param o the object to add.
@return true if adding the object succeeded
Objects implementing Indentable allow to set indentation left and right.
Sets the indentation on the left side.
@param indentation the new indentation
Sets the indentation on the right side.
@param indentation the new indentation
Objects implementing Spaceable allow setting spacing before and after.
Sets the spacing before.
@param spacing the new spacing
Sets the spacing after.
@param spacing the new spacing
@author itextpdf.com
Receive a writer and the document to do certain operations on them.
@param writer the PdfWriter
@param doc the document
@throws DocumentException
This class contains version information about iText.
DO NOT CHANGE THE VERSION INFORMATION WITHOUT PERMISSION OF THE COPYRIGHT HOLDERS OF ITEXT.
Changing the version makes it extremely difficult to debug an application.
Also, the nature of open source software is that you honor the copyright of the original creators of the software.
String that will indicate if the AGPL version is used.
The iText version instance.
This String contains the name of the product.
iText is a registered trademark by iText Group NV.
Please don't change this constant.
This String contains the version number of this iText release.
For debugging purposes, we request you NOT to change this constant.
This String contains the iText version as shown in the producer line.
iText is a product developed by iText Group NV.
iText Group requests that you retain the iText producer line
in every PDF that is created or manipulated using iText.
The license key.
Gets an instance of the iText version that is currently used.
Note that iText Group requests that you retain the iText producer line
in every PDF that is created or manipulated using iText.
* Gets the product name.
* iText Group requests that you retain the iText producer line
* in every PDF that is created or manipulated using iText.
* @return the product name
* Gets the release number.
* iText Group requests that you retain the iText producer line
* in every PDF that is created or manipulated using iText.
* @return the release number
* Returns the iText version as shown in the producer line.
* iText is a product developed by iText Group NV.
* iText Group requests that you retain the iText producer line
* in every PDF that is created or manipulated using iText.
* @return iText version
Returns a license key if one was provided, or null if not.
@return a license key.
Checks if the AGPL version is used.
@return returns true if the AGPL version is used.
An element that is not an element, it holds {@link Element#WRITABLE_DIRECT}
as Element type. It implements WriterOperation to do operations on the
{@link PdfWriter} and the {@link Document} that must be done at the time of
the writing. Much like a {@link VerticalPositionMark} but little different.
@author itextpdf.com
@return {@link Element#WRITABLE_DIRECT}
The TYPE_UNKNOWN
is an initial type value
The min value equivalent to zero. If absolute value less then ZERO it considered as zero.
The values of transformation matrix
The transformation type
Multiply matrix of two AffineTransform objects
@param t1 - the AffineTransform object is a multiplicand
@param t2 - the AffineTransform object is a multiplier
@return an AffineTransform object that is a result of t1 multiplied by matrix t2.
A utility class to perform base64 encoding and decoding as specified
in RFC-1521. See also RFC 1421.
@version $Revision: 1.4 $
marker for invalid bytes
marker for accepted whitespace bytes
marker for an equal symbol
Encode the given byte[].
the source string.
the base64-encoded data.
Encode the given byte[].
the source string.
a linefeed is added after linefeed
characters;
must be dividable by four; 0 means no linefeeds
the base64-encoded data.
Encode the given string.
the source string.
the base64-encoded string.
Decode the given byte[].
the base64-encoded data.
the decoded data.
Decode the given string.
the base64-encoded string.
the decoded string.
Byte buffer container including length of valid data.
@since 11.10.2006
the initial capacity for this buffer
a byte array that will be wrapped with ByteBuffer
.
a byte array that will be wrapped with ByteBuffer
.
the length of valid bytes in the array
Loads the stream into a buffer.
an InputStream
If the stream cannot be read.
a byte array that will be wrapped with ByteBuffer
.
the offset of the provided buffer.
the length of valid bytes in the array
Returns a byte stream that is limited to the valid amount of bytes.
Returns the length, that means the number of valid bytes, of the buffer;
the inner byte array might be bigger than that.
Detects the encoding of the byte buffer, stores and returns it.
Only UTF-8, UTF-16LE/BE and UTF-32LE/BE are recognized.
Note: UTF-32 flavors are not supported by Java, the XML-parser will complain.
Returns the encoding string.
the index to retrieve the byte from
Returns a byte from the buffer
the index to retrieve a byte as int or char.
Returns a byte from the buffer
Appends a byte to the buffer.
a byte
Appends a byte array or part of to the buffer.
a byte array
an offset with
Append a byte array to the buffer
a byte array
Append another buffer to this buffer.
another ByteBuffer
Ensures the requested capacity by increasing the buffer size when the
current length is exceeded.
requested new buffer length
An OutputStream
that counts the written bytes.
@since 08.11.2006
the decorated output stream
the byte counter
Constructor with providing the output stream to decorate.
an OutputStream
the bytesWritten
Abstract class for reading filtered character streams.
The abstract class FilterReader
itself
provides default methods that pass all requests to
the contained stream. Subclasses of FilterReader
should override some of these methods and may also provide
additional methods and fields.
@author Mark Reinhold
@since JDK1.1
Reads a single character.
@exception IOException If an I/O error occurs
Reads characters into a portion of an array.
@exception IOException If an I/O error occurs
**
@since 22.08.2006
the result of the escaping sequence
count the digits of the sequence
the state of the automaton
Processes numeric escaped chars to find out if they are a control character.
a char
Returns the char directly or as replacement for the escaped sequence.
Converts between ISO 8601 Strings and Calendar
with millisecond resolution.
@since 16.02.2006
a date string that is ISO 8601 conform.
an existing XMPDateTime to set with the parsed date
Returns an XMPDateTime-object containing the ISO8601-date.
Is thrown when the string is non-conform.
@since 22.08.2006
initializes the parser container
Returns the length of the input.
Returns whether there are more chars to come.
index of char
Returns char at a certain index.
Returns the current char or 0x0000 if there are no more chars.
Skips the next char.
Returns the current position.
Parses a integer from the source and sets the pointer after it.
Error message to put in the exception if no number can be found
the max value of the number to return
Returns the parsed integer.
Thrown if no integer can be found.
@since 12.10.2006
Private constructor
Converts a Cp1252 char (contains all Latin-1 chars above 0x80) into a
UTF-8 byte sequence. The bytes 0x81, 0x8D, 0x8F, 0x90, and 0x9D are
formally undefined by Windows 1252 and therefore replaced by a space
(0x20).
an Cp1252 / Latin-1 byte
Returns a byte array containing a UTF-8 byte sequence.
@since 11.08.2006
private constructor
Asserts that an array name is set.
an array name
Array name is null or empty
Asserts that a property name is set.
a property name or path
Property name is null or empty
Asserts that a schema namespace is set.
a schema namespace
Schema is null or empty
Asserts that a prefix is set.
a prefix
Prefix is null or empty
Asserts that a specific language is set.
a specific lang
Specific language is null or empty
Asserts that a struct name is set.
a struct name
Struct name is null or empty
Asserts that any string parameter is set.
any string parameter
Thrown if the parameter is null or has length 0.
Asserts that the xmp object is of this implemention
().
the XMP object
A wrong implentaion is used.
Parser for "normal" XML serialisation of RDF.
@since 14.07.2006
Start of coreSyntaxTerms.
End of coreSyntaxTerms
Start of additions for syntax Terms.
End of of additions for syntaxTerms.
Start of oldTerms.
End of oldTerms.
! Yes, the syntax terms include the core terms.
this prefix is used for default namespaces
The main parsing method. The XML tree is walked through from the root node and and XMP tree
is created. This is a raw parse, the normalisation of the XMP tree happens outside.
the XML root node
Returns an XMP metadata object (not normalized)
Occurs if the parsing fails for any reason.
Each of these parsing methods is responsible for recognizing an RDF
syntax production and adding the appropriate structure to the XMP tree.
They simply return for success, failures will throw an exception.
the xmp metadata object that is generated
the top-level xml node
thown on parsing errors
7.2.5 nodeElementURIs
anyURI - ( coreSyntaxTerms | rdf:li | oldTerms )
7.2.11 nodeElement
start-element ( URI == nodeElementURIs,
attributes == set ( ( idAttr | nodeIdAttr | aboutAttr )?, propertyAttr* ) )
propertyEltList
end-element()
A node element URI is rdf:Description or anything else that is not an RDF
term.
the xmp metadata object that is generated
the parent xmp node
the currently processed XML node
Flag if the node is a top-level node
thown on parsing errors
7.2.7 propertyAttributeURIs
anyURI - ( coreSyntaxTerms | rdf:Description | rdf:li | oldTerms )
7.2.11 nodeElement
start-element ( URI == nodeElementURIs,
attributes == set ( ( idAttr | nodeIdAttr | aboutAttr )?, propertyAttr* ) )
propertyEltList
end-element()
Process the attribute list for an RDF node element. A property attribute URI is
anything other than an RDF term. The rdf:ID and rdf:nodeID attributes are simply ignored,
as are rdf:about attributes on inner nodes.
the xmp metadata object that is generated
the parent xmp node
the currently processed XML node
Flag if the node is a top-level node
thown on parsing errors
7.2.13 propertyEltList
ws* ( propertyElt ws* )*
the xmp metadata object that is generated
the parent xmp node
the currently processed XML node
Flag if the node is a top-level node
thown on parsing errors
7.2.14 propertyElt
resourcePropertyElt | literalPropertyElt | parseTypeLiteralPropertyElt |
parseTypeResourcePropertyElt | parseTypeCollectionPropertyElt |
parseTypeOtherPropertyElt | emptyPropertyElt
7.2.15 resourcePropertyElt
start-element ( URI == propertyElementURIs, attributes == set ( idAttr? ) )
ws* nodeElement ws*
end-element()
7.2.16 literalPropertyElt
start-element (
URI == propertyElementURIs, attributes == set ( idAttr?, datatypeAttr?) )
text()
end-element()
7.2.17 parseTypeLiteralPropertyElt
start-element (
URI == propertyElementURIs, attributes == set ( idAttr?, parseLiteral ) )
literal
end-element()
7.2.18 parseTypeResourcePropertyElt
start-element (
URI == propertyElementURIs, attributes == set ( idAttr?, parseResource ) )
propertyEltList
end-element()
7.2.19 parseTypeCollectionPropertyElt
start-element (
URI == propertyElementURIs, attributes == set ( idAttr?, parseCollection ) )
nodeElementList
end-element()
7.2.20 parseTypeOtherPropertyElt
start-element ( URI == propertyElementURIs, attributes == set ( idAttr?, parseOther ) )
propertyEltList
end-element()
7.2.21 emptyPropertyElt
start-element ( URI == propertyElementURIs,
attributes == set ( idAttr?, ( resourceAttr | nodeIdAttr )?, propertyAttr* ) )
end-element()
The various property element forms are not distinguished by the XML element name,
but by their attributes for the most part. The exceptions are resourcePropertyElt and
literalPropertyElt. They are distinguished by their XML element content.
NOTE: The RDF syntax does not explicitly include the xml:lang attribute although it can
appear in many of these. We have to allow for it in the attibute counts below.
the xmp metadata object that is generated
the parent xmp node
the currently processed XML node
Flag if the node is a top-level node
thown on parsing errors
7.2.15 resourcePropertyElt
start-element ( URI == propertyElementURIs, attributes == set ( idAttr? ) )
ws* nodeElement ws*
end-element()
This handles structs using an rdf:Description node,
arrays using rdf:Bag/Seq/Alt, and typedNodes. It also catches and cleans up qualified
properties written with rdf:Description and rdf:value.
the xmp metadata object that is generated
the parent xmp node
the currently processed XML node
Flag if the node is a top-level node
thown on parsing errors
7.2.16 literalPropertyElt
start-element ( URI == propertyElementURIs,
attributes == set ( idAttr?, datatypeAttr?) )
text()
end-element()
Add a leaf node with the text value and qualifiers for the attributes.
the xmp metadata object that is generated
the parent xmp node
the currently processed XML node
Flag if the node is a top-level node
thown on parsing errors
7.2.17 parseTypeLiteralPropertyElt
start-element ( URI == propertyElementURIs,
attributes == set ( idAttr?, parseLiteral ) )
literal
end-element()
thown on parsing errors
7.2.18 parseTypeResourcePropertyElt
start-element ( URI == propertyElementURIs,
attributes == set ( idAttr?, parseResource ) )
propertyEltList
end-element()
Add a new struct node with a qualifier for the possible rdf:ID attribute.
Then process the XML child nodes to get the struct fields.
the xmp metadata object that is generated
the parent xmp node
the currently processed XML node
Flag if the node is a top-level node
thown on parsing errors
7.2.19 parseTypeCollectionPropertyElt
start-element ( URI == propertyElementURIs,
attributes == set ( idAttr?, parseCollection ) )
nodeElementList
end-element()
thown on parsing errors
7.2.20 parseTypeOtherPropertyElt
start-element ( URI == propertyElementURIs, attributes == set ( idAttr?, parseOther ) )
propertyEltList
end-element()
thown on parsing errors
Adds a child node.
the xmp metadata object that is generated
the parent xmp node
the currently processed XML node
Node value
Flag if the node is a top-level node
Returns the newly created child node.
thown on parsing errors
Adds a qualifier node.
the parent xmp node
the name of the qualifier which has to be
QName including the default prefix
the value of the qualifier
Returns the newly created child node.
thown on parsing errors
The parent is an RDF pseudo-struct containing an rdf:value field. Fix the
XMP data model. The rdf:value node must be the first child, the other
children are qualifiers. The form, value, and children of the rdf:value
node are the real ones. The rdf:value node's qualifiers must be added to
the others.
the parent xmp node
thown on parsing errors
Checks if the node is a white space.
an XML-node
Returns whether the node is a whitespace node,
i.e. a text node that contains only whitespaces.
7.2.6 propertyElementURIs
anyURI - ( coreSyntaxTerms | rdf:Description | oldTerms )
the term id
Return true if the term is a property element name.
Determines the ID for a certain RDF Term.
Arranged to hopefully minimize the parse time for large XMP.
an XML node
Returns the term ID.
A character-stream reader that allows characters to be pushed back into the
stream.
@author Mark Reinhold
@since JDK1.1
Pushback buffer
Current position in buffer
Creates a new pushback reader with a one-character pushback buffer.
The reader from which characters will be read
Checks to make sure that the stream has not been closed.
Reads a single character.
The character read, or -1 if the end of the stream has been
reached
If an I/O error occurs
Reads characters into a portion of an array.
Destination buffer
Offset at which to start writing characters
Maximum number of characters to read
The number of characters read, or -1 if the end of the
stream has been reached
If an I/O error occurs
Pushes back a single character by copying it to the front of the
pushback buffer. After this method returns, the next character to be read
will have the value (char)c
.
The int value representing a character to be pushed back
If the pushback buffer is full,
or if some other I/O error occurs
Pushes back a portion of an array of characters by copying it to the
front of the pushback buffer. After this method returns, the next
character to be read will have the value cbuf[off]
, the
character after that will have the value cbuf[off+1]
, and
so forth.
Character array
Offset of first character to push back
Number of characters to push back
If there is insufficient room in the pushback
buffer, or if some other I/O error occurs
Pushes back an array of characters by copying it to the front of the
pushback buffer. After this method returns, the next character to be
read will have the value cbuf[0]
, the character after that
will have the value cbuf[1]
, and so forth.
Character array to push back
If there is insufficient room in the pushback
buffer, or if some other I/O error occurs
Closes the stream and releases any system resources associated with
it. Once the stream has been closed, further read(),
unread(), ready(), or skip() invocations will throw an IOException.
Closing a previously closed stream has no effect.
If an I/O error occurs
@since 09.11.2006
XML localname
XML namespace prefix
Splits a qname into prefix and localname.
a QName
Constructor that initializes the fields
the prefix
the name
the localName
the prefix
Returns whether the QName has a prefix.
Utility functions for the XMPToolkit implementation.
@since 06.06.2006
segments of a UUID
length of a UUID
init char tables
Private constructor
a schema namespace
an XMP Property
Returns true if the property is defined as "Internal
Property", see XMP Specification.
Check some requirements for an UUID:
- Length of the UUID is 32
- The Delimiter count is 4 and all the 4 delimiter are on their right
position (8,13,18,23)
uuid to test
true - this is a well formed UUID, false - UUID has not the expected format
Checks if the value is a legal "unqualified" XML name, as
defined in the XML Namespaces proposed recommendation.
These are XML names, except that they must not contain a colon.
the value to check
Returns true if the name is a valid "unqualified" XML name.
a char
Returns true if the char is an ASCII control char.
Replaces the ASCII control chars with a space.
a node value
Returns the cleaned up value
Simple check if a character is a valid XML start name char.
All characters according to the XML Spec 1.1 are accepted:
http://www.w3.org/TR/xml11/#NT-NameStartChar
a character
Returns true if the character is a valid first char of an XML name.
Simple check if a character is a valid XML name char
(every char except the first one), according to the XML Spec 1.1:
http://www.w3.org/TR/xml11/#NT-NameChar
a character
Returns true if the character is a valid char of an XML name.
Initializes the char tables for the chars 0x00-0xFF for later use,
according to the XML 1.1 specification
http://www.w3.org/TR/xml11
The implementation of XMPDateTime
. Internally a calendar
is used
plus an additional nano seconds field, because Calendar
supports only milli
seconds. The nanoSeconds
convers only the resolution beyond a milli second.
@since 16.02.2006
The nano seconds take micro and nano seconds, while the milli seconds are in the calendar.
Use NO time zone as default
Creates an XMPDateTime
-instance with the current time in the default time
zone.
Creates an XMPDateTime
-instance from a calendar.
a Calendar
Creates an XMPDateTime
-instance from
a Date
and a TimeZone
.
a date describing an absolute point in time
a TimeZone how to interpret the date
Creates an XMPDateTime
-instance from an ISO 8601 string.
an ISO 8601 string
If the string is a non-conform ISO 8601 string, an exception is thrown
Returns the ISO string representation.
The XMPIterator
implementation.
Iterates the XMP Tree according to a set of options.
During the iteration the XMPMeta-object must not be changed.
Calls to skipSubtree()
/ skipSiblings()
will affect the iteration.
@since 29.06.2006
the node iterator doing the work
stores the iterator options
the base namespace of the property path, will be changed during the iteration
flag to indicate that skipSiblings() has been called.
flag to indicate that skipSiblings() has been called.
Constructor with optionsl initial values. If propName
is provided,
schemaNs
has also be provided.
the iterated metadata object.
the iteration is reduced to this schema (optional)
the iteration is redurce to this property within the schemaNs
advanced iteration options, see
If the node defined by the paramters is not existing.
Exposes the options for inner class.
Exposes the options for inner class.
The XMPIterator
implementation.
It first returns the node itself, then recursivly the children and qualifier of the node.
@since 29.06.2006
iteration state
iteration state
iteration state
the recursively accumulated path
the currently visited node
the iterator that goes through the children and qualifier list
index of node with parent, only interesting for arrays
the cached PropertyInfo
to return
the state of the iteration
the iterator for each child
Constructor for the node iterator.
the currently visited node
the accumulated path of the node
the index within the parent node (only for arrays)
the childrenIterator
Returns the returnProperty.
Sets the returnProperty as next item or recurses into hasNext()
.
Returns if there is a next item to return.
Handles the iteration of the children or qualfier
an iterator
Returns if there are more elements available.
the node that will be added to the path.
the path up to this node.
the current array index if an arrey is traversed
Returns the updated path.
Creates a property info object from an XMPNode
.
an XMPNode
the base namespace to report
the full property path
Returns a XMPProperty
-object that serves representation of the node.
This iterator is derived from the default NodeIterator
,
and is only used for the option .
@since 02.10.2006
Constructor
the node which children shall be iterated.
the full path of the former node without the leaf node.
Implementation for .
@since 17.02.2006
Property values are Strings by default
root of the metadata tree
the xpacket processing instructions content
Constructor for an empty metadata object.
Constructor for a cloned metadata tree.
an prefilled metadata tree which fulfills all
XMPNode
contracts.
Returns the root node of the XMP tree.
Locate or create the item node and set the value. Note the index
parameter is one-based! The index can be in the range [1..size + 1] or
"last()", normalize it and check the insert flags. The order of the
normalization checks is important. If the array is empty we end up with
an index and location to set item size + 1.
an array node
the index where to insert the item
the item value
the options for the new item
insert oder overwrite at index position?
The internals for SetProperty() and related calls, used after the node is
found or created.
the newly created node
the node value, can be null
options for the new node, must not be null
.
flag if the existing value is to be overwritten
thrown if options and value do not correspond
Evaluates a raw node value to the given value type, apply special
conversions for defined types in XMP.
an int indicating the value type
the node containing the value
Returns a literal value for the node.
This class replaces the ExpatAdapter.cpp
and does the
XML-parsing and fixes the prefix. After the parsing several normalisations
are applied to the XMPTree.
@since 01.02.2006
Hidden constructor, initialises the SAX parser handler.
Parses the input source into an XMP metadata object, including
de-aliasing and normalisation.
the input can be an InputStream
, a String
or
a byte buffer containing the XMP packet.
the parse options
Returns the resulting XMP metadata object
Thrown if parsing or normalisation fails.
Parses XML from an ,
fixing the encoding (Latin-1 to UTF-8) and illegal control character optionally.
an InputStream
the parsing options
Returns an XML DOM-Document.
Thrown when the parsing fails.
Parses XML from a byte buffer,
fixing the encoding (Latin-1 to UTF-8) and illegal control character optionally.
a byte buffer containing the XMP packet
the parsing options
Returns an XML DOM-Document.
Thrown when the parsing fails.
Parses XML from a ,
fixing the illegal control character optionally.
a String
containing the XMP packet
the parsing options
Returns an XML DOM-Document.
Thrown when the parsing fails.
A node in the internally XMP tree, which can be a schema node, a property node, an array node,
an array item, a struct node or a qualifier node (without '?').
Possible improvements:
1. The kind Node of node might be better represented by a class-hierarchy of different nodes.
2. The array type should be an enum
3. isImplicitNode should be removed completely and replaced by return values of fi.
4. hasLanguage, hasType should be automatically maintained by XMPNode
@since 21.02.2006
flag if the node is an alias
list of child nodes, lazy initialized
flag if the node has aliases
flag if the node has an "rdf:value" child node.
flag if the node is implicitly created
name of the node, contains different information depending of the node kind
options describing the kind of the node
link to the parent node
list of qualifier of the node, lazy initialized
value of the node, contains different information depending of the node kind
Creates an XMPNode
with initial values.
the name of the node
the value of the node
the options of the node
Constructor for the node without value.
the name of the node
the options of the node
Returns the parent node.
Returns the number of children without neccessarily creating a list.
Returns the number of qualifier without neccessarily creating a list.
Returns the name.
Returns the value.
Returns the options.
Returns the implicit flag
Returns if the node contains aliases (applies only to schema nodes)
Returns if the node contains aliases (applies only to schema nodes)
the hasValueChild
Returns whether this node is a language qualifier.
Returns whether this node is a type qualifier.
Note: This method should always be called when accessing 'children' to be sure
that its initialized.
Returns list of children that is lazy initialized.
Returns a read-only copy of child nodes list.
Returns list of qualifier that is lazy initialized.
Resets the node.
an index [1..size]
Returns the child with the requested index.
Adds a node as child to this node.
an XMPNode
Adds a node as child to this node.
the index of the node before which the new one is inserted.
Note: The node children are indexed from [1..size]!
An index of size + 1 appends a node.
an XMPNode
Replaces a node with another one.
the index of the node that will be replaced.
Note: The node children are indexed from [1..size]!
the replacement XMPNode
Removes a child at the requested index.
the index to remove [1..size]
Removes a child node.
If its a schema node and doesn't have any children anymore, its deleted.
the child node to delete.
Removes the children list if this node has no children anymore;
checks if the provided node is a schema node and doesn't have any children anymore,
its deleted.
Removes all children from the node.
child node name to look for
Returns an XMPNode
if node has been found, null
otherwise.
an index [1..size]
Returns the qualifier with the requested index.
Appends a qualifier to the qualifier list and sets respective options.
a qualifier node.
Removes one qualifier node and fixes the options.
qualifier to remove
Removes all qualifiers from the node and sets the options appropriate.
qualifier node name to look for
Returns a qualifier XMPNode
if node has been found,
null
otherwise.
Returns whether the node has children.
Returns an iterator for the children.
Note: take care to use it.remove(), as the flag are not adjusted in that case.
Returns whether the node has qualifier attached.
Returns an iterator for the qualifier.
Note: take care to use it.remove(), as the flag are not adjusted in that case.
Performs a deep clone of the complete subtree (children and
qualifier )into and add it to the destination node.
the node to add the cloned subtree
Renders this node and the tree unter this node in a human readable form.
Flag is qualifier and child nodes shall be rendered too
Returns a multiline string containing the dump.
Dumps this node and its qualifier and children recursively.
Note: It creats empty options on every node.
the buffer to append the dump.
Flag is qualifier and child nodes shall be rendered too
the current indent level.
the index within the parent node (important for arrays)
Internal find.
the list to search in
the search expression
Returns the found node or nulls
.
Checks that a node name is not existing on the same level, except for array items.
the node name to check
Thrown if a node with the same name is existing.
Checks that a qualifier name is not existing on the same level.
the new qualifier name
Thrown if a node with the same name is existing.
Utilities for XMPNode
.
@since Aug 28, 2006
Private Constructor
Find or create a schema node if createNodes
is false and
the root of the xmp tree.
a namespace
a flag indicating if the node shall be created if not found.
Note: The namespace must be registered prior to this call.
Returns the schema node if found, null
otherwise.
Note: If createNodes
is true
, it is always
returned a valid node.
An exception is only thrown if an error occurred, not if a
node was not found.
Find or create a schema node if createNodes
is true.
the root of the xmp tree.
a namespace
If a prefix is suggested, the namespace is allowed to be registered.
a flag indicating if the node shall be created if not found.
Note: The namespace must be registered prior to this call.
Returns the schema node if found, null
otherwise.
Note: If createNodes
is true
, it is always
returned a valid node.
An exception is only thrown if an error occurred, not if a
node was not found.
Find or create a child node under a given parent node. If the parent node is no
Returns the found or created child node.
the parent node
the node name to find
flag, if new nodes shall be created.
Returns the found or created node or null
.
Thrown if
Follow an expanded path expression to find or create a node.
the node to begin the search.
the complete xpath
flag if nodes shall be created
(when called by setProperty()
)
the options for the created leaf nodes (only when
createNodes == true
).
Returns the node if found or created or null
.
An exception is only thrown if an error occurred,
not if a node was not found.
Deletes the the given node and its children from its parent.
Takes care about adjusting the flags.
the top-most node to delete.
This is setting the value of a leaf node.
an XMPNode
a value
Verifies the PropertyOptions for consistancy and updates them as needed.
If options are null
they are created with default values.
the PropertyOptions
the node value to set
Returns the updated options.
If the options are not consistant.
Converts the node value to String, apply special conversions for defined
types in XMP.
the node value to set
Returns the String representation of the node value.
Find or create a qualifier node under a given parent node. Returns a pointer to the
qualifier node, and optionally an iterator for the node's position in
the parent's vector of qualifiers. The iterator is unchanged if no qualifier node (null)
is returned.
Note: On entry, the qualName parameter must not have the leading '?' from the
XmpPath step.
the parent XMPNode
the qualifier name
flag if nodes shall be created
Returns the qualifier node if found or created, null
otherwise.
an array node
the segment containing the array index
flag if new nodes are allowed to be created.
Returns the index or index = -1 if not found
Throws Exceptions
Searches for a field selector in a node:
[fieldName="value] - an element in an array of structs, chosen by a field value.
No implicit nodes are created by field selectors.
Returns the index of the field if found, otherwise -1.
Searches for a qualifier selector in a node:
[?qualName="value"] - an element in an array, chosen by a qualifier value.
No implicit nodes are created for qualifier selectors,
except for an alias to an x-default item.
an array node
the qualifier name
the qualifier value
in case the qual selector results from an alias,
an x-default node is created if there has not been one.
Returns the index of th
Make sure the x-default item is first. Touch up "single value"
arrays that have a default plus one real language. This case should have
the same value for both items. Older Adobe apps were hardwired to only
use the "x-default" item, so we copy that value to the other
item.
an alt text array node
See if an array is an alt-text array. If so, make sure the x-default item
is first.
the array node to check if its an alt-text array
Appends a language item to an alt text array.
the language array
the language of the item
the content of the item
Thrown if a duplicate property is added
Looks for the appropriate language item in a text alternative array.item
an array node
the requested language
Returns the index if the language has been found, -1 otherwise.
@since Aug 18, 2006
caches the correct dc-property array forms
init char tables
Hidden constructor
Normalizes a raw parsed XMPMeta-Object
the raw metadata object
the parsing options
Returns the normalized metadata object
Collects all severe processing errors.
Tweak old XMP: Move an instance ID from rdf:about to the
xmpMM:InstanceID property. An old instance ID usually looks
like "uuid:bac965c4-9d87-11d9-9a30-000d936b79c4", plus InDesign
3.0 wrote them like "bac965c4-9d87-11d9-9a30-000d936b79c4". If
the name looks like a UUID simply move it to xmpMM:InstanceID,
don't worry about any existing xmpMM:InstanceID. Both will
only be present when a newer file with the xmpMM:InstanceID
property is updated by an old app that uses rdf:about.
the root of the metadata tree
Thrown if tweaking fails.
Visit all schemas to do general fixes and handle special cases.
the metadata object implementation
Thrown if the normalisation fails.
Make sure that the array is well-formed AltText. Each item must be simple
and have an "xml:lang" qualifier. If repairs are needed, keep simple
non-empty items by adding the "xml:lang" with value "x-repair".
the property node of the array to repair.
Forwards unexpected exceptions.
Visit all of the top level nodes looking for aliases. If there is
no base, transplant the alias subtree. If there is a base and strict
aliasing is on, make sure the alias and base subtrees match.
the root of the metadata tree
th parsing options
Forwards XMP errors
Moves an alias node of array form to another schema into an array
the node to be moved
the base array for the array item
Forwards XMP errors
Fixes the GPS Timestamp in EXIF.
the EXIF schema node
Thrown if the date conversion fails.
Remove all empty schemas from the metadata tree that were generated during the rdf parsing.
the root of the metadata tree
The outermost call is special. The names almost certainly differ. The
qualifiers (and hence options) will differ for an alias to the x-default
item of a langAlt array.
the alias node
the base node of the alias
marks the outer call of the recursion
Forwards XMP errors
The initial support for WAV files mapped a legacy ID3 audio copyright
into a new xmpDM:copyright property. This is special case code to migrate
that into dc:rights['x-default']. The rules:
1. If there is no dc:rights array, or an empty array -
Create one with dc:rights['x-default'] set from double linefeed and xmpDM:copyright.
2. If there is a dc:rights array but it has no x-default item -
Create an x-default item as a copy of the first item then apply rule #3.
3. If there is a dc:rights array with an x-default item,
Look for a double linefeed in the value.
A. If no double linefeed, compare the x-default value to the xmpDM:copyright value.
A1. If they match then leave the x-default value alone.
A2. Otherwise, append a double linefeed and
the xmpDM:copyright value to the x-default value.
B. If there is a double linefeed, compare the trailing text to the xmpDM:copyright value.
B1. If they match then leave the x-default value alone.
B2. Otherwise, replace the trailing x-default text with the xmpDM:copyright value.
4. In all cases, delete the xmpDM:copyright property.
the metadata object
the "dm:copyright"-property
Initializes the map that contains the known arrays, that are fixed by
.
The schema registry handles the namespaces, aliases and global options for the XMP Toolkit. There
is only one single instance used by the toolkit.
@since 27.01.2006
a map of all registered aliases.
The map is a relationship from a qname to an XMPAliasInfo
-object.
a map from a namespace URI to its registered prefix
a map from a prefix to the associated namespace URI
The pattern that must not be contained in simple properties
Performs the initialisation of the registry with the default namespaces, aliases and global
options.
Register the standard namespaces of schemas and types that are included in the XMP
Specification and some other Adobe private namespaces.
Note: This method is not lock because only called by the constructor.
Forwards processing exceptions
Register the standard aliases.
Note: This method is not lock because only called by the constructor.
If the registrations of at least one alias fails.
Serializes the XMPMeta
-object to an OutputStream
according to the
SerializeOptions
.
@since 11.07.2006
Static method to Serialize the metadata object. For each serialisation, a new XMPSerializer
instance is created, either XMPSerializerRDF or XMPSerializerPlain so thats its possible to
serialialize the same XMPMeta objects in two threads.
a metadata implementation object
the output stream to Serialize to
serialization options, can be null
for default.
Serializes an XMPMeta
-object as RDF into a string.
Note: Encoding is forced to UTF-16 when serializing to a
string to ensure the correctness of "exact packet size".
a metadata implementation object
Options to control the serialization (see
).
Returns a string containing the serialized RDF.
on serializsation errors.
Serializes an XMPMeta
-object as RDF into a byte buffer.
a metadata implementation object
Options to control the serialization (see ).
Returns a byte buffer containing the serialized RDF.
on serializsation errors.
Serializes the XMPMeta
-object using the standard RDF serialization format.
The output is written to an OutputStream
according to the SerializeOptions
.
@since 11.07.2006
default padding
The w/r is missing inbetween
a set of all rdf attribute qualifier
the stored serialization options
the output stream to Serialize to
the padding in the XMP Packet, or the length of the complete packet in
case of option exactPacketLength.
the size of one unicode char, for UTF-8 set to 1
(Note: only valid for ASCII chars lower than 0x80),
set to 2 in case of UTF-16
this writer is used to do the actual serialization
the metadata object to be serialized.
The actual serialization.
the metadata object to be serialized
outputStream the output stream to Serialize to
the serialization options
If case of wrong options or any other serialization error.
Calculates the padding according to the options and write it to the stream.
the length of the tail string
thrown if packet size is to small to fit the padding
forwards writer errors
Checks if the supplied options are consistent.
Thrown if options are conflicting
Writes the (optional) packet header and the outer rdf-tags.
Returns the packet end processing instraction to be written after the padding.
Forwarded writer exceptions.
Serializes the metadata in pretty-printed manner.
indent level
Forwarded writer exceptions
Serializes the metadata in compact manner.
indent level to start with
Forwarded writer exceptions
Write each of the parent's simple unqualified properties as an attribute. Returns true if all
of the properties are written as attributes.
the parent property node
the current indent level
Returns true if all properties can be rendered as RDF attribute.
Recursively handles the "value" for a node that must be written as an RDF
property element. It does not matter if it is a top level property, a
field of a struct, or an item of an array. The indent is that for the
property element. The patterns bwlow ignore attribute qualifiers such as
xml:lang, they don't affect the output form.
<ns:UnqualifiedStructProperty-1
... The fields as attributes, if all are simple and unqualified
/>
<ns:UnqualifiedStructProperty-2 rdf:parseType="Resource">
... The fields as elements, if none are simple and unqualified
</ns:UnqualifiedStructProperty-2>
<ns:UnqualifiedStructProperty-3>
<rdf:Description
... The simple and unqualified fields as attributes
>
... The compound or qualified fields as elements
</rdf:Description>
</ns:UnqualifiedStructProperty-3>
<ns:UnqualifiedArrayProperty>
<rdf:Bag> or Seq or Alt
... Array items as rdf:li elements, same forms as top level properties
</rdf:Bag>
</ns:UnqualifiedArrayProperty>
<ns:QualifiedProperty rdf:parseType="Resource">
<rdf:value> ... Property "value"
following the unqualified forms ... </rdf:value>
... Qualifiers looking like named struct fields
</ns:QualifiedProperty>
*** Consider numbered array items, but has compatibility problems. ***
Consider qualified form with rdf:Description and attributes.
the parent node
the current indent level
Forwards writer exceptions
If qualifier and element fields are mixed.
Serializes a simple property.
an XMPNode
Returns an array containing the flags emitEndTag and indentEndTag.
Forwards the writer exceptions.
Serializes an array property.
an XMPNode
the current indent level
Forwards the writer exceptions.
If qualifier and element fields are mixed.
Serializes a struct property.
an XMPNode
the current indent level
Flag if the element has resource qualifier
Returns true if an end flag shall be emitted.
Forwards the writer exceptions.
If qualifier and element fields are mixed.
Serializes the general qualifier.
the root node of the subtree
the current indent level
Forwards all writer exceptions.
If qualifier and element fields are mixed.
Writes all used namespaces of the subtree in node to the output.
The subtree is recursivly traversed.
the root node of the subtree
a set containing currently used prefixes
the current indent level
Forwards all writer exceptions.
Writes one namespace declaration to the output.
a namespace prefix (without colon) or a complete qname (when namespace == null)
the a namespace
a set containing currently used prefixes
the current indent level
Forwards all writer exceptions.
Start the outer rdf:Description element, including all needed xmlns attributes.
Leave the element open so that the compact form can add property attributes.
If the writing to
Recursively handles the "value" for a node. It does not matter if it is a
top level property, a field of a struct, or an item of an array. The
indent is that for the property element. An xml:lang qualifier is written
as an attribute of the property start tag, not by itself forcing the
qualified property form. The patterns below mostly ignore attribute
qualifiers like xml:lang. Except for the one struct case, attribute
qualifiers don't affect the output form.
<ns:UnqualifiedSimpleProperty>value</ns:UnqualifiedSimpleProperty>
<ns:UnqualifiedStructProperty> (If no rdf:resource qualifier)
<rdf:Description>
... Fields, same forms as top level properties
</rdf:Description>
</ns:UnqualifiedStructProperty>
<ns:ResourceStructProperty rdf:resource="URI"
... Fields as attributes
>
<ns:UnqualifiedArrayProperty>
<rdf:Bag> or Seq or Alt
... Array items as rdf:li elements, same forms as top level properties
</rdf:Bag>
</ns:UnqualifiedArrayProperty>
<ns:QualifiedProperty>
<rdf:Description>
<rdf:value> ... Property "value" following the unqualified
forms ... </rdf:value>
... Qualifiers looking like named struct fields
</rdf:Description>
</ns:QualifiedProperty>
the property node
property shall be rendered as attribute rather than tag
use canonical form with inner description tag or
the compact form with rdf:ParseType="resource" attribute.
the current indent level
Forwards all writer exceptions.
If "rdf:resource" and general qualifiers are mixed.
Writes the array start and end tags.
an array node
flag if its the start or end tag
the current indent level
forwards writer exceptions
Serializes the node value in XML encoding. Its used for tag bodies and
attributes. Note: The attribute is always limited by quotes,
thats why '
is never serialized. Note:
Control chars are written unescaped, but if the user uses others than tab, LF
and CR the resulting XML will become invalid.
the value of the node
flag if value is an attribute value
Writes indents and automatically includes the baseindend from the options.
number of indents to write
forwards exception
Writes a char to the output.
a char
forwards writer exceptions
Writes a String to the output.
a String
forwards writer exceptions
Writes an amount of chars, mostly spaces
number of chars
a char
Writes a newline according to the options.
Forwards exception
@since 11.08.2006
Private constructor, as
see {@link XMPUtils#separateArrayItems(XMPMeta, String, String, String,
PropertyOptions, boolean)}
The XMP object containing the array to be updated.
The schema namespace URI for the array. Must not be null or
the empty string.
The name of the array. May be a general path expression, must
not be null or the empty string. Each item in the array must
be a simple string value.
The string to be separated into the array items.
Option flags to control the separation.
Flag if commas shall be preserved
Forwards the Exceptions from the metadata processing
Utility to find or create the array used by separateArrayItems()
.
a the namespace fo the array
the name of the array
the options for the array if newly created
the xmp object
Returns the array node.
Forwards exceptions
Remove all schema children according to the flag
doAllProperties
. Empty schemas are automatically remove
by XMPNode
a schema node
flag if all properties or only externals shall be removed.
Returns true if the schema is empty after the operation.
Compares two nodes including its children and qualifier.
an XMPNode
an XMPNode
Returns true if the nodes are equal, false otherwise.
Forwards exceptions to the calling method.
Make sure the separator is OK. It must be one semicolon surrounded by
zero or more spaces. Any of the recognized semicolons or spaces are
allowed.
Make sure the open and close quotes are a legitimate pair and return the
correct closing quote or an exception.
opened and closing quote in a string
the open quote
Returns a corresponding closing quote.
Classifies the character into normal chars, spaces, semicola, quotes,
control chars.
a char
Return the character kind.
the open quote char
Returns the matching closing quote for an open quote.
Add quotes to the item.
the array item
the open quote character
the closing quote character
flag if commas are allowed
Returns the value in quotes.
a character
the opening quote char
the closing quote char
Return it the character is a surrounding quote.
a character
the opening quote char
the closing quote char
Returns true if the character is a closing quote.
Representates an XMP XmpPath with segment accessor methods.
@since 28.02.2006
Marks a struct field step , also for top level nodes (schema "fields").
Marks a qualifier step.
Note: Order is significant to separate struct/qual from array kinds!
Marks an array index step
stores the segments of an XmpPath
Append a path segment
the segment to add
the index of the segment to return
Returns a path segment.
Returns the size of the xmp path.
Parser for XMP XPaths.
@since 01.03.2006
Private constructor
@param path
@param pos
@throws XmpException
Parses a struct segment
@param pos the current position in the path
@return Retusn the segment or an errror
@throws XmpException If the sement is empty
Parses an array index segment.
@param pos the xmp path
@return Returns the segment or an error
@throws XmpException thrown on xmp path errors
Parses the root node of an XMP Path, checks if namespace and prefix fit together
and resolve the property to the base property if it is an alias.
@param schemaNs the root namespace
@param pos the parsing position helper
@param expandedXPath the path to contribute to
@throws XmpException If the path is not valid.
Verifies whether the qualifier name is not XML conformant or the
namespace prefix has not been registered.
@param qualName
a qualifier name
@throws XmpException
If the name is not conformant
Verify if an XML name is conformant.
@param name
an XML name
@throws XmpException
When the name is not XML conformant
This objects contains all needed char positions to parse.
the complete path
the end of a segment name
the begin of a step
the end of a step
A segment of a parsed XmpPath
.
@since 23.06.2006
flag if segment is an alias
alias form if applicable
kind of the path segment
name of the path segment
Constructor with initial values.
the name of the segment
Constructor with initial values.
the name of the segment
the kind of the segment
Returns the kind.
Returns the name.
the flag to set
Returns the aliasForm if this segment has been created by an alias.
Returns the year, can be negative.
Returns The month in the range 1..12.
Returns the day of the month in the range 1..31.
Returns hour - The hour in the range 0..23.
Returns the minute in the range 0..59.
Returns the second in the range 0..59.
Returns milli-, micro- and nano seconds.
Nanoseconds within a second, often left as zero?
Returns the time zone.
Returns the ISO 8601 string representation of the date and time.
This flag is set either by parsing or by setting year, month or day.
Returns true if the XMPDateTime object has a date portion.
This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds.
Returns true if the XMPDateTime object has a time portion.
This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds.
Returns true if the XMPDateTime object has a defined timezone.
Skip the subtree below the current node when next()
is
called.
Skip the subtree below and remaining siblings of the current node when
next()
is called.
This class represents the set of XMP metadata as a DOM representation. It has methods to read and
modify all kinds of properties, create an iterator over all properties and Serialize the metadata
to a String, byte-array or OutputStream
.
@since 20.01.2006
This correlates to the about-attribute,
returns the empty String if no name is set.
Returns the name of the XMP object.
Returns the unparsed content of the <?xpacket> processing instruction.
This contains normally the attribute-like elements 'begin="<BOM>"
id="W5M0MpCehiHzreSzNTczkc9d"' and possibly the deprecated elements 'bytes="1234"' or
'encoding="XXX"'. If the parsed packet has not been wrapped into an xpacket,
null
is returned.
Provides access to items within an array. The index is passed as an integer, you need not
worry about the path string syntax for array items, convert a loop index to a string, etc.
The namespace URI for the array. Has the same usage as in GetProperty.
The name of the array. May be a general path expression, must not be
null
or the empty string. Has the same namespace prefix usage as
propName in GetProperty()
.
The index of the desired item. Arrays in XMP are indexed from 1. The
constant always refers to the last existing array
item.
Returns a XMPProperty
containing the value and the options or
null
if the property does not exist.
Wraps all errors and exceptions that may occur.
Returns the number of items in the array.
The namespace URI for the array. Has the same usage as in GetProperty.
The name of the array. May be a general path expression, must not be
null
or the empty string. Has the same namespace prefix usage as
propName in GetProperty()
.
Returns the number of items in the array.
Wraps all errors and exceptions that may occur.
Replaces an item within an array. The index is passed as an integer, you need not worry about
the path string syntax for array items, convert a loop index to a string, etc. The array
passed must already exist. In normal usage the selected array item is modified. A new item is
automatically appended if the index is the array size plus 1.
The namespace URI for the array. Has the same usage as in GetProperty.
The name of the array. May be a general path expression, must not be
null
or the empty string. Has the same namespace prefix usage as
propName in GetProperty.
The index of the desired item. Arrays in XMP are indexed from 1. To address
the last existing item, use to find
out the length of the array.
the new value of the array item. Has the same usage as propValue in
SetProperty()
.
the set options for the item.
Wraps all errors and exceptions that may occur.
Inserts an item into an array previous to the given index. The index is passed as an integer,
you need not worry about the path string syntax for array items, convert a loop index to a
string, etc. The array passed must already exist. In normal usage the selected array item is
modified. A new item is automatically appended if the index is the array size plus 1.
The namespace URI for the array. Has the same usage as in GetProperty.
The name of the array. May be a general path expression, must not be
null
or the empty string. Has the same namespace prefix usage as
propName in GetProperty.
The index to insert the new item. Arrays in XMP are indexed from 1. Use
XmpConst.ARRAY_LAST_ITEM
to append items.
the new value of the array item. Has the same usage as
propValue in SetProperty()
.
the set options that decide about the kind of the node.
Wraps all errors and exceptions that may occur.
Provides access to fields within a nested structure. The namespace for the field is passed as
a URI, you need not worry about the path string syntax. The names of fields should be XML
qualified names, that is within an XML namespace. The path syntax for a qualified name uses
the namespace prefix, which is unreliable because the prefix is never guaranteed. The URI is
the formal name, the prefix is just a local shorthand in a given sequence of XML text.
The namespace URI for the struct. Has the same usage as in GetProperty.
The name of the struct. May be a general path expression, must not be null
or the empty string. Has the same namespace prefix usage as propName in GetProperty.
The namespace URI for the field. Has the same URI and prefix usage as the
schemaNs parameter.
The name of the field. Must be a single XML name, must not be null or the
empty string. Has the same namespace prefix usage as the structName parameter.
the value of thefield, if the field has a value.
Has the same usage as propValue in GetProperty.
Option flags describing the field. See the earlier description.
Wraps all errors and exceptions that may occur.
Provides access to a qualifier attached to a property. The namespace for the qualifier is
passed as a URI, you need not worry about the path string syntax. In many regards qualifiers
are like struct fields. See the introductory discussion of qualified properties for more
information. The names of qualifiers should be XML qualified names, that is within an XML
namespace. The path syntax for a qualified name uses the namespace prefix, which is
unreliable because the prefix is never guaranteed. The URI is the formal name, the prefix is
just a local shorthand in a given sequence of XML text. The property the qualifier
will be attached has to exist.
The namespace URI for the struct. Has the same usage as in GetProperty.
The name of the property to which the qualifier is attached. Has the same
usage as in GetProperty.
The namespace URI for the qualifier. Has the same URI and prefix usage as the
schemaNs parameter.
The name of the qualifier. Must be a single XML name, must not be
null
or the empty string. Has the same namespace prefix usage as the
propName parameter.
A pointer to the null
terminated UTF-8 string that is the
value of the qualifier, if the qualifier has a value. Has the same usage as propValue
in GetProperty.
Option flags describing the qualifier. See the earlier description.
Wraps all errors and exceptions that may occur.
Deletes the given XMP subtree rooted at the given property. It is not an error if the
property does not exist.
The namespace URI for the property. Has the same usage as in
GetProperty()
.
The name of the property. Has the same usage as in GetProperty.
Deletes the given XMP subtree rooted at the given array item. It is not an error if the array
item does not exist.
The namespace URI for the array. Has the same usage as in GetProperty.
The name of the array. May be a general path expression, must not be
null
or the empty string. Has the same namespace prefix usage as
propName in GetProperty()
.
The index of the desired item. Arrays in XMP are indexed from 1. The
constant XmpConst.ARRAY_LAST_ITEM
always refers to the last
existing array item.
Deletes the given XMP subtree rooted at the given struct field. It is not an error if the
field does not exist.
The namespace URI for the struct. Has the same usage as in
GetProperty()
.
The name of the struct. May be a general path expression, must not be
null
or the empty string. Has the same namespace prefix usage as
propName in GetProperty.
The namespace URI for the field. Has the same URI and prefix usage as the
schemaNs parameter.
The name of the field. Must be a single XML name, must not be
null
or the empty string. Has the same namespace prefix usage as the
structName parameter.
Deletes the given XMP subtree rooted at the given qualifier. It is not an error if the
qualifier does not exist.
The namespace URI for the struct. Has the same usage as in
GetProperty()
.
The name of the property to which the qualifier is attached. Has the same
usage as in GetProperty.
The namespace URI for the qualifier. Has the same URI and prefix usage as the
schemaNs parameter.
The name of the qualifier. Must be a single XML name, must not be
null
or the empty string. Has the same namespace prefix usage as the
propName parameter.
Returns whether the property exists.
The namespace URI for the property. Has the same usage as in
GetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
Returns true if the property exists.
Tells if the array item exists.
The namespace URI for the array. Has the same usage as in
GetProperty()
.
The name of the array. May be a general path expression, must not be
null
or the empty string. Has the same namespace prefix usage as
propName in GetProperty()
.
The index of the desired item. Arrays in XMP are indexed from 1. The
constant XmpConst.ARRAY_LAST_ITEM
always refers to the last
existing array item.
Returns true
if the array exists, false
otherwise.
DoesStructFieldExist tells if the struct field exists.
The namespace URI for the struct. Has the same usage as in
GetProperty()
.
The name of the struct. May be a general path expression, must not be
null
or the empty string. Has the same namespace prefix usage as
propName in GetProperty()
.
The namespace URI for the field. Has the same URI and prefix usage as the
schemaNs parameter.
The name of the field. Must be a single XML name, must not be
null
or the empty string. Has the same namespace prefix usage as the
structName parameter.
Returns true if the field exists.
DoesQualifierExist tells if the qualifier exists.
The namespace URI for the struct. Has the same usage as in
GetProperty()
.
The name of the property to which the qualifier is attached. Has the same
usage as in GetProperty()
.
The namespace URI for the qualifier. Has the same URI and prefix usage as the
schemaNs parameter.
The name of the qualifier. Must be a single XML name, must not be
null
or the empty string. Has the same namespace prefix usage as the
propName parameter.
Returns true if the qualifier exists.
Modifies the value of a selected item in an alt-text array. Creates an appropriate array item
if necessary, and handles special cases for the x-default item. If the selected item is from
a match with the specific language, the value of that item is modified. If the existing value
of that item matches the existing value of the x-default item, the x-default item is also
modified. If the array only has 1 existing item (which is not x-default), an x-default item
is added with the given value. If the selected item is from a match with the generic language
and there are no other generic matches, the value of that item is modified. If the existing
value of that item matches the existing value of the x-default item, the x-default item is
also modified. If the array only has 1 existing item (which is not x-default), an x-default
item is added with the given value. If the selected item is from a partial match with the
generic language and there are other partial matches, a new item is created for the specific
language. The x-default item is not modified. If the selected item is from the last 2 rules
then a new item is created for the specific language. If the array only had an x-default
item, the x-default item is also modified. If the array was empty, items are created for the
specific language and x-default.
Note: In a future version of this API a method
using Java java.lang.Locale
will be added.
The namespace URI for the alt-text array. Has the same usage as in
GetProperty()
.
The name of the alt-text array. May be a general path expression, must not
be null
or the empty string. Has the same namespace prefix usage as
propName in GetProperty()
.
The name of the generic language as an RFC 3066 primary subtag. May be
null
or the empty string if no generic language is wanted.
The name of the specific language as an RFC 3066 tag. Must not be
null
or the empty string.
A pointer to the null
terminated UTF-8 string that is the new
value for the appropriate array item.
Option flags, none are defined at present.
Wraps all errors and exceptions that may occur.
These are very similar to GetProperty()
and SetProperty()
above,
but the value is returned or provided in a literal form instead of as a UTF-8 string.
The path composition functions in XMPPathFactory
may be used to compose an path
expression for fields in nested structures, items in arrays, or qualifiers.
The namespace URI for the property. Has the same usage as in
GetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
Returns a Boolean
value or null
if the property does not exist.
Wraps all exceptions that may occur,
especially conversion errors.
Convenience method to retrieve the literal value of a property.
The namespace URI for the property. Has the same usage as in
GetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
Returns an Integer
value or null
if the property does not exist.
Wraps all exceptions that may occur,
especially conversion errors.
Convenience method to retrieve the literal value of a property.
The namespace URI for the property. Has the same usage as in
GetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
Returns a Long
value or null
if the property does not exist.
Wraps all exceptions that may occur,
especially conversion errors.
Convenience method to retrieve the literal value of a property.
The namespace URI for the property. Has the same usage as in
GetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
Returns a Double
value or null
if the property does not exist.
Wraps all exceptions that may occur,
especially conversion errors.
Convenience method to retrieve the literal value of a property.
The namespace URI for the property. Has the same usage as in
GetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
Returns a XMPDateTime
-object or null
if the property does not exist.
Wraps all exceptions that may occur,
especially conversion errors.
Convenience method to retrieve the literal value of a property.
The namespace URI for the property. Has the same usage as in
GetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
Returns a Java Calendar
-object or null
if the property does not exist.
Wraps all exceptions that may occur,
especially conversion errors.
Convenience method to retrieve the literal value of a property.
The namespace URI for the property. Has the same usage as in
GetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
Returns a byte[]
-array contained the decoded base64 value
or null
if the property does not exist.
Wraps all exceptions that may occur,
especially conversion errors.
Convenience method to retrieve the literal value of a property.
Note: There is no SetPropertyString()
,
because SetProperty()
sets a string value.
The namespace URI for the property. Has the same usage as in
GetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
Returns a String
value or null
if the property does not exist.
Wraps all exceptions that may occur,
especially conversion errors.
Convenience method to set a property to a literal boolean
value.
The namespace URI for the property. Has the same usage as in
SetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
the literal property value as boolean
.
options of the property to set (optional).
Wraps all exceptions that may occur.
Convenience method to set a property to a literal int
value.
The namespace URI for the property. Has the same usage as in
SetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
the literal property value as int
.
options of the property to set (optional).
Wraps all exceptions that may occur.
Convenience method to set a property to a literal long
value.
The namespace URI for the property. Has the same usage as in
SetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
the literal property value as long
.
options of the property to set (optional).
Wraps all exceptions that may occur.
Convenience method to set a property to a literal double
value.
The namespace URI for the property. Has the same usage as in
SetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
the literal property value as double
.
options of the property to set (optional).
Wraps all exceptions that may occur.
Convenience method to set a property with an XMPDateTime-object,
which is serialized to an ISO8601 date.
The namespace URI for the property. Has the same usage as in
SetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
the property value as XMPDateTime
.
options of the property to set (optional).
Wraps all exceptions that may occur.
Convenience method to set a property with a Java Calendar-object,
which is serialized to an ISO8601 date.
The namespace URI for the property. Has the same usage as in
SetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
the property value as Java Calendar
.
options of the property to set (optional).
Wraps all exceptions that may occur.
Convenience method to set a property from a binary byte[]
-array,
which is serialized as base64-string.
The namespace URI for the property. Has the same usage as in
SetProperty()
.
The name of the property.
Has the same usage as in GetProperty()
.
the literal property value as byte array.
options of the property to set (optional).
Wraps all exceptions that may occur.
Construct an iterator for the properties within an XMP object. According to the parameters it iterates the entire data tree,
properties within a specific schema, or a subtree rooted at a specific node.
Optional schema namespace URI to restrict the iteration. Omitted (visit all
schema) by passing null
or empty String.
Optional property name to restrict the iteration. May be an arbitrary path
expression. Omitted (visit all properties) by passing null
or empty
String. If no schema URI is given, it is ignored.
Option flags to control the iteration. See for
details.
Returns an XMPIterator
for this XMPMeta
-object
considering the given options.
Wraps all errors and exceptions that may occur.
Perform the normalization as a separate parsing step.
Normally it is done during parsing, unless the parsing option
is set to true
.
Note: It does no harm to call this method to an already normalized xmp object.
It was a PDF/A requirement to get hand on the unnormalized XMPMeta
object.
optional parsing options.
Wraps all errors and exceptions that may occur.
Renders this node and the tree unter this node in a human readable form.
Returns a multiline string containing the dump.
Returns the registered prefix/namespace-pairs as map, where the keys are the
namespaces and the values are the prefixes.
Returns the registered namespace/prefix-pairs as map, where the keys are the
prefixes and the values are the namespaces.
Determines if a name is an alias, and what it is aliased to.
The namespace URI of the alias. Must not be null
or the empty
string.
The name of the alias. May be an arbitrary path expression
path, must not be null
or the empty string.
Returns the XMPAliasInfo
for the given alias namespace and property or
null
if there is no such alias.
Collects all aliases that are contained in the provided namespace.
If nothing is found, an empty array is returned.
a schema namespace URI
Returns all alias infos from aliases that are contained in the provided namespace.
Searches for registered aliases.
an XML conform qname
Returns if an alias definition for the given qname to another
schema and property is registered.
Returns the registered aliases as map, where the key is the "qname" (prefix and name)
and the value an XMPAliasInfo
-object.
Returns the primary release number, the "1" in version "1.2.3".
Returns the secondary release number, the "2" in version "1.2.3".
Returns the tertiary release number, the "3" in version "1.2.3".
Returns a rolling build number, monotonically increasing in a release.
Returns true if this is a debug build.
Returns a comprehensive version information string.
Options for XMPSchemaRegistryImpl#registerAlias.
@since 20.02.2006
This is a direct mapping. The actual data type does not matter.
The actual is an unordered array, the alias is to the first element of the array.
The actual is an ordered array, the alias is to the first element of the array.
The actual is an alternate array, the alias is to the first element of the array.
The actual is an alternate text array, the alias is to the 'x-default' element of the array.
the options to init with
If options are not consistant
Returns if the alias is of the simple form.
Returns the option.
Returns the option.
Returns the option.
Returns the option.
returns a s object
If the options are not consistant.
Options for XMPIterator
construction.
@since 24.01.2006
Just do the immediate children of the root, default is subtree.
Just do the leaf nodes, default is all nodes in the subtree.
Bugfix #2658965: If this option is set the Iterator returns the namespace
of the leaf instead of the namespace of the base property.
Return just the leaf part of the path, default is the full path.
Omit all qualifiers.
Returns whether the option is set.
Returns whether the option is set.
Returns whether the option is set.
Returns whether the option is set.
Options for .
@since 24.01.2006
Require a surrounding "x:xmpmeta" element in the xml-document.
Do not reconcile alias differences, throw an exception instead.
Convert ASCII control characters 0x01 - 0x1F (except tab, cr, and lf) to spaces.
If the input is not unicode, try to parse it as ISO-8859-1.
Do not carry run the XMPNormalizer on a packet, leave it as it is.
Sets the options to the default values.
Returns the requireXMPMeta.
Returns the strictAliasing.
Returns the strictAliasing.
Returns the strictAliasing.
Returns the option "omit normalization".
The property flags are used when properties are fetched from the XMPMeta
-object
and provide more detailed information about the property.
@since 03.07.2006
may be used in the future
Updated by iText. Indicates if the property should be writted as a separate node
Default constructor
Intialization constructor
the initialization options
If the options are not valid
Return whether the property value is a URI. It is serialized to RDF using the
rdf:resource attribute. Not mandatory for URIs, but considered RDF-savvy.
Return whether the property has qualifiers. These could be an xml:lang
attribute, an rdf:type property, or a general qualifier. See the
introductory discussion of qualified properties for more information.
Return whether this property is a qualifier for some other property. Note that if the
qualifier itself has a structured value, this flag is only set for the top node of
the qualifier's subtree. Qualifiers may have arbitrary structure, and may even have
qualifiers.
Return whether this property has an xml:lang qualifier.
Return whether this property has an rdf:type qualifier.
Return whether this property contains nested fields.
Return whether this property is an array. By itself this indicates a general
unordered array. It is serialized using an rdf:Bag container.
Return whether this property is an ordered array. Appears in conjunction with
getPropValueIsArray(). It is serialized using an rdf:Seq container.
Return whether this property is an alternative array. Appears in conjunction with
getPropValueIsArray(). It is serialized using an rdf:Alt container.
Return whether this property is an alt-text array. Appears in conjunction with
getPropArrayIsAlternate(). It is serialized using an rdf:Alt container.
Each array element is a simple property with an xml:lang attribute.
the value to set
Returns this to enable cascaded options.
Returns whether the SCHEMA_NODE option is set.
Returns whether the property is of composite type - an array or a struct.
Returns whether the property is of composite type - an array or a struct.
Returns true if only array options are set.
Compares two options set for array compatibility.
other options
Returns true if the array options of the sets are equal.
Merges the set options of a another options object with this.
If the other options set is null, this objects stays the same.
other options
If illegal options are provided
Checks that a node not a struct and array at the same time;
and URI cannot be a struct.
the bitmask to check.
Thrown if the options are not consistent.
Options for .
@since 24.01.2006
Omit the XML packet wrapper.
Mark packet as read-only. Default is a writeable packet.
Use a compact form of RDF.
The compact form is the default serialization format (this flag is technically ignored).
To Serialize to the canonical form, set the flag USE_CANONICAL_FORMAT.
If both flags "compact" and "canonical" are set, canonical is used.
Use the canonical form of RDF if set. By default the compact form is used
Include a padding allowance for a thumbnail image. If no xmp:Thumbnails property
is present, the typical space for a JPEG thumbnail is used.
The padding parameter provides the overall packet length. The actual amount of padding is
computed. An exception is thrown if the packet exceeds this length with no padding.
Sort the struct properties and qualifier before serializing
Bit indicating little endian encoding, unset is big endian
Bit indication UTF16 encoding.
UTF8 encoding; this is the default
UTF16BE encoding
UTF16LE encoding
The number of levels of indentation to be used for the outermost XML element in the
serialized RDF. This is convenient when embedding the RDF in other text, defaults to 0.
The string to be used for each level of indentation in the serialized
RDF. If empty it defaults to two ASCII spaces, U+0020.
The string to be used as a line terminator. If empty it defaults to; linefeed, U+000A, the
standard XML newline.
Omits the Toolkit version attribute, not published, only used for Unit tests.
The amount of padding to be added if a writeable XML packet is created. If zero is passed
(the default) an appropriate amount of padding is computed.
Default constructor.
Constructor using inital options
the inital options
Thrown if options are not consistant.
Returns the option.
Returns the option.
Returns the option.
Returns the option.
Returns the option.
Returns the option.
Returns the option.
Returns the option.
Returns the option.
Returns the option.
Returns the baseIndent.
Returns the indent.
Returns the newline.
Returns the padding.
Returns whether the Toolkit version attribute shall be omitted.
Note: This options can only be set by unit tests.
Returns the encoding as Java encoding String.
Returns clone of this SerializeOptions-object with the same options set.
The base class for a collection of 32 flag bits. Individual flags are defined as enum value bit
masks. Inheriting classes add convenience accessor methods.
@since 24.01.2006
a map containing the bit names
the internal int containing all options
The default constructor.
Constructor with the options bit mask.
the options bit mask
If the options are not correct
Is friendly to access it during the tests.
Returns the options.
Creates a human readable string from the set options. Note: This method is quite
expensive and should only be used within tests or as
Returns a String listing all options that are set to true
by their name,
like "option1 | option4".
To be implemeted by inheritants.
Returns a bit mask where all valid option bits are set.
Resets the options.
an option bitmask
Returns true, if this object is equal to the given options.
an option bitmask
Returns true, if this object contains all given options.
an option bitmask
Returns true, if this object contain at least one of the given options.
the binary bit or bits that are requested
Returns if all of the requested bits are set or not.
the binary bit or bits that shall be set to the given value
the boolean value to set
Returns the options as hex bitmask.
To be implemeted by inheritants.
a single, valid option bit.
Returns a human readable name for an option bit.
The inheriting option class can do additional checks on the options.
Note: For performance reasons this method is only called
when setting bitmasks directly.
When get- and set-methods are used, this method must be called manually,
normally only when the Options-object has been created from a client
(it has to be made public therefore).
the bitmask to check.
Thrown if the options are not consistent.
Checks options before they are set.
First it is checked if only defined options are used,
second the additional -method is called.
the options to check
Thrown if the options are invalid.
Looks up or asks the inherited class for the name of an option bit.
Its save that there is only one valid option handed into the method.
a single option bit
Returns the option name or undefined.
Returns the optionNames map and creates it if required.
This interface is used to return info about an alias.
@since 27.01.2006
Returns Returns the namespace URI for the base property.
Returns the default prefix for the given base property.
Returns the path of the base property.
Returns the kind of the alias. This can be a direct alias
(ARRAY), a simple property to an ordered array
(ARRAY_ORDERED), to an alternate array
(ARRAY_ALTERNATE) or to an alternate text array
(ARRAY_ALT_TEXT).
This interface is used to return a text property together with its and options.
@since 23.01.2006
Returns the value of the property.
Returns the options of the property.
Only set by .
Returns the language of the alt-text item.
This interface is used to return a property together with its path and namespace.
It is returned when properties are iterated with the XMPIterator
.
@since 06.07.2006
Returns the namespace of the property
Returns the path of the property, but only if returned by the iterator.
Common constants for the XMP Toolkit.
@since 20.01.2006
The XML namespace for XML.
The XML namespace for RDF.
The XML namespace for the Dublin Core schema.
The XML namespace for the IPTC Core schema.
The XML namespace for the IPTC Extension schema.
The XML namespace for the DICOM medical schema.
The XML namespace for the PLUS (Picture Licensing Universal System, http://www.useplus.org)
The XML namespace Adobe XMP Metadata.
The XML namespace for the XMP "basic" schema.
The XML namespace for the XMP copyright schema.
The XML namespace for the XMP digital asset management schema.
The XML namespace for the job management schema.
The XML namespace for the job management schema.
The XML namespace for the PDF schema.
The XML namespace for the PDF schema.
The XML namespace for the Photoshop custom schema.
The XML namespace for the Photoshop Album schema.
The XML namespace for Adobe's EXIF schema.
NS for the CIPA XMP for Exif document v1.1
The XML namespace for Adobe's TIFF schema.
BExt Schema
RIFF Info Schema
Transform XMP
Adobe Flash SWF
legacy Dublin Core NS, will be converted to NS_DC
The XML namespace for qualifiers of the xmp:Identifier property.
The XML namespace for fields of the Dimensions type.
The XML namespace for fields of a graphical image. Used for the Thumbnail type.
The XML namespace for fields of the ResourceEvent type.
The XML namespace for fields of the ResourceRef type.
The XML namespace for fields of the Version type.
The XML namespace for fields of the JobRef type.
The canonical true string value for Booleans in serialized XMP. Code that converts from the
string to a bool should be case insensitive, and even allow "1".
The canonical false string value for Booleans in serialized XMP. Code that converts from the
string to a bool should be case insensitive, and even allow "0".
Index that has the meaning to be always the last item in an array.
Node name of an array item.
The x-default string for localized properties
xml:lang qualfifier
rdf:type qualfifier
Processing Instruction (PI) for xmp packet
XMP meta tag version new
XMP meta tag version old
A factory to create XMPDateTime
-instances from a Calendar
or an
ISO 8601 string or for the current time.
@since 16.02.2006
Obtain the current date and time.
Returns The returned time is UTC, properly adjusted for the local time zone. The
resolution of the time is not guaranteed to be finer than seconds.
Creates an XMPDateTime
from a Calendar
-object.
a Calendar
-object.
An XMPDateTime
-object.
Creates an empty XMPDateTime
-object.
Returns an XMPDateTime
-object.
Creates an XMPDateTime
from an ISO 8601 string.
The ISO 8601 string representation of the date/time.
An XMPDateTime
-object.
When the ISO 8601 string is non-conform
Sets the local time zone without touching any other Any existing time zone value is replaced,
the other date/time fields are not adjusted in any way.
the XMPDateTime
variable containing the value to be modified.
Returns an updated XMPDateTime
-object.
Make sure a time is UTC. If the time zone is not UTC, the time is
adjusted and the time zone set to be UTC.
the XMPDateTime
variable containing the time to
be modified.
Returns an updated XMPDateTime
-object.
Make sure a time is local. If the time zone is not the local zone, the time is adjusted and
the time zone set to be local.
the XMPDateTime
variable containing the time to be modified.
Returns an updated XMPDateTime
-object.
@since 21.09.2006
Note: This is an error code introduced by Java.
This exception wraps all errors that occur in the XMP Toolkit.
@since 16.02.2006
the errorCode of the XMP toolkit
Constructs an exception with a message and an error code.
the message
the error code
Constructs an exception with a message, an error code and a Throwable
the error message.
the error code
the exception source
Returns the errorCode.
Creates XMPMeta
-instances from an InputStream
@since 30.01.2006
The singleton instance of the XMPSchemaRegistry
.
cache for version info
Returns the singleton instance of the XMPSchemaRegistry
.
Returns an empty XMPMeta
-object.
Serializes an XMPMeta
-object as RDF into an OutputStream
with default options.
a metadata object
an OutputStream
to write the serialized RDF to.
on serializsation errors.
Serializes an XMPMeta
-object as RDF into an OutputStream
.
a metadata object
Options to control the serialization (see ).
an OutputStream
to write the serialized RDF to.
on serializsation errors.
Serializes an XMPMeta
-object as RDF into a byte buffer.
a metadata object
Options to control the serialization (see ).
Returns a byte buffer containing the serialized RDF.
on serializsation errors.
Serializes an XMPMeta
-object as RDF into a string. Note: Encoding
is ignored when serializing to a string.
a metadata object
Options to control the serialization (see ).
Returns a string containing the serialized RDF.
on serializsation errors.
Asserts that xmp is compatible to XMPMetaImpl
.s
Resets the _schema registry to its original state (creates a new one).
Be careful this might break all existing XMPMeta-objects and should be used
only for testing purpurses.
Obtain version information. The XMPVersionInfo singleton is created the first time
its requested.
Returns the version information.
Compose the path expression for an item in an array.
The name of the array. May be a general path expression, must not be
null
or the empty string.
The index of the desired item. Arrays in XMP are indexed from 1.
0 and below means last array item and renders as [last()]
.
Returns the composed path basing on fullPath. This will be of the form
ns:arrayName[i], where "ns" is the prefix for schemaNs and
"i" is the decimal representation of itemIndex.
Throws exeption if index zero is used.
Compose the path expression for a field in a struct. The result can be added to the
path of
The namespace URI for the field. Must not be null
or the empty
string.
The name of the field. Must be a simple XML name, must not be
null
or the empty string.
Returns the composed path. This will be of the form
ns:structName/fNS:fieldName, where "ns" is the prefix for
schemaNs and "fNS" is the prefix for fieldNs.
Thrown if the path to create is not valid.
Compose the path expression for a qualifier.
The namespace URI for the qualifier. May be null
or the empty
string if the qualifier is in the XML empty namespace.
The name of the qualifier. Must be a simple XML name, must not be
null
or the empty string.
Returns the composed path. This will be of the form
ns:propName/?qNS:qualName, where "ns" is the prefix for
schemaNs and "qNS" is the prefix for qualNs.
Thrown if the path to create is not valid.
Compose the path expression to select an alternate item by language. The
path syntax allows two forms of "content addressing" that may
be used to select an item in an array of alternatives. The form used in
ComposeLangSelector lets you select an item in an alt-text array based on
the value of its xml:lang qualifier. The other form of content
addressing is shown in ComposeFieldSelector. \note ComposeLangSelector
does not supplant SetLocalizedText or GetLocalizedText. They should
generally be used, as they provide extra logic to choose the appropriate
language and maintain consistency with the 'x-default' value.
ComposeLangSelector gives you an path expression that is explicitly and
only for the language given in the langName parameter.
The name of the array. May be a general path expression, must
not be null
or the empty string.
The RFC 3066 code for the desired language.
Returns the composed path. This will be of the form
ns:arrayName[@xml:lang='langName'], where
"ns" is the prefix for schemaNs.
ParameterAsserts that a qualifier namespace is set.
a qualifier namespace
Qualifier schema is null or empty
ParameterAsserts that a qualifier name is set.
a qualifier name or path
Qualifier name is null or empty
ParameterAsserts that a struct field namespace is set.
a struct field namespace
Struct field schema is null or empty
ParameterAsserts that a struct field name is set.
a struct field name or path
Struct field name is null or empty
Utility methods for XMP. I included only those that are different from the
Java default conversion utilities.
@since 21.02.2006
Private constructor
Create a single edit string from an array of strings.
The XMP object containing the array to be catenated.
The schema namespace URI for the array. Must not be null or
the empty string.
The name of the array. May be a general path expression, must
not be null or the empty string. Each item in the array must
be a simple string value.
The string to be used to separate the items in the catenated
string. Defaults to "; ", ASCII semicolon and space
(U+003B, U+0020).
The characters to be used as quotes around array items that
contain a separator. Defaults to '"'
Option flag to control the catenation.
Returns the string containing the catenated array items.
Forwards the Exceptions from the metadata processing
Separate a single edit string into an array of strings.
The XMP object containing the array to be updated.
The schema namespace URI for the array. Must not be null or
the empty string.
The name of the array. May be a general path expression, must
not be null or the empty string. Each item in the array must
be a simple string value.
The string to be separated into the array items.
Option flags to control the separation.
Flag if commas shall be preserved
Forwards the Exceptions from the metadata processing
Alias without the new option deleteEmptyValues
.
The source XMP object.
The destination XMP object.
Do internal properties in addition to external properties.
Replace the values of existing properties.
Forwards the Exceptions from the metadata processing
Convert from boolean to string.
a boolean value
The XMP string representation of the boolean. The values used are
given by the constnts and
.
Converts a string value to an int
.
the string value
Returns an int.
If the rawValue
is null
or empty or the
conversion fails.
Convert from int to string.
an int value
The string representation of the int.
Converts a string value to a long
.
the string value
Returns a long.
If the rawValue
is null
or empty or the
conversion fails.
Convert from long to string.
a long value
The string representation of the long.
Converts a string value to a double
.
the string value
Returns a double.
If the rawValue
is null
or empty or the
conversion fails.
Convert from long to string.
a long value
The string representation of the long.
Converts a string value to an XMPDateTime
.
the string value
Returns an XMPDateTime
-object.
If the rawValue
is null
or empty or the
conversion fails.
Convert from XMPDateTime
to string.
an XMPDateTime
The string representation of the long.
Convert from a byte array to a base64 encoded string.
the byte array to be converted
Returns the base64 string.
Decode from Base64 encoded string to raw data.
a base64 encoded string
Returns a byte array containg the decoded string.
Thrown if the given string is not property base64 encoded
Implementation of the IndicLigaturizer for Devanagari.
Warning: this is an incomplete and experimental implementation of Devanagari. This implementation should not be used in production.
Constructor for the IndicLigaturizer for Devanagari.
Produces a blank (or empty) signature. Useful for deferred signing with
MakeSignature.signExternalContainer().
@author Paulo Soares
Add
args: ByVal key As IComparable, ByVal data As Object
key is object that implements IComparable interface
performance tip: change to use use int type (such as the hashcode)
RestoreAfterInsert
Additions to red-black trees usually destroy the red-black
properties. Examine the tree and restore. Rotations are normally
required to restore it
RotateLeft
Rebalance the tree by rotating the nodes to the left
RotateRight
Rebalance the tree by rotating the nodes to the right
RestoreAfterDelete
Deletions from red-black trees may destroy the red-black
properties. Examine the tree and restore. Rotations are normally
required to restore it
Key
Data
Determine order, walk the tree and push the nodes onto the stack
HasMoreElements
NextElement
MoveNext
For .NET compatibility
Key
Data
Color
Left
Right
Provides the base class for a generic read-only dictionary.
The type of keys in the dictionary.
The type of values in the dictionary.
An instance of the ReadOnlyDictionary generic class is
always read-only. A dictionary that is read-only is simply a
dictionary with a wrapper that prevents modifying the
dictionary; therefore, if changes are made to the underlying
dictionary, the read-only dictionary reflects those changes.
See for a modifiable version of
this class.
Notes to Implementers This base class is provided to
make it easier for implementers to create a generic read-only
custom dictionary. Implementers are encouraged to extend this
base class instead of creating their own.
Initializes a new instance of the
class that wraps
the supplied .
The
that will be wrapped.
Thrown when the dictionary is null.
Gets the number of key/value pairs contained in the
.
The number of key/value pairs.
The number of key/value pairs contained in the
.
Gets a collection containing the keys in the
.
A
containing the keys.
A
containing the keys in the
.
Gets a collection containing the values of the
.
The collection of values.
Gets a value indicating whether the dictionary is read-only.
This value will always be true.
Gets a value indicating whether access to the dictionary
is synchronized (thread safe).
Gets an object that can be used to synchronize access to dictionary.
Gets or sets the value associated with the specified key.
The value associated with the specified key. If the specified key
is not found, a get operation throws a
,
and a set operation creates a new element with the specified key.
The key of the value to get or set.
Thrown when the key is null.
The property is retrieved and key does not exist in the collection.
This method is not supported by the
.
The object to use as the key of the element to add.
The object to use as the value of the element to add.
Determines whether the
contains the specified key.
True if the contains
an element with the specified key; otherwise, false.
The key to locate in the
.
Thrown when the key is null.
This method is not supported by the .
The key of the element to remove.
True if the element is successfully removed; otherwise, false.
Gets the value associated with the specified key.
The key of the value to get.
When this method returns, contains the value
associated with the specified key, if the key is found;
otherwise, the default value for the type of the value parameter.
This parameter is passed uninitialized.
true if the contains
an element with the specified key; otherwise, false.
This method is not supported by the
.
The object to add to the .
This method is not supported by the
.
Determines whether the contains a
specific value.
The object to locate in the .
true if item is found in the ICollection;
otherwise, false.
Copies the elements of the ICollection to an Array, starting at a
particular Array index.
The one-dimensional Array that is the
destination of the elements copied from ICollection.
The Array must have zero-based indexing.
The zero-based index in array at which copying begins.
This method is not supported by the
.
The object to remove from the ICollection.
Will never return a value.
Returns an enumerator that iterates through the collection.
A IEnumerator that can be used to iterate through the collection.
Returns an enumerator that iterates through a collection.
An IEnumerator that can be used to iterate through the collection.
For a description of this member, see .
The one-dimensional Array that is the destination of the elements copied from
ICollection. The Array must have zero-based indexing.
The zero-based index in Array at which copying begins.
Summary description for ListIterator.
Summary description for Properties.
Summary description for Util.
Summary description for DeflaterOutputStream.
Summary description for DeflaterOutputStream.