Dispose the object.
Frees unmanaged resources used by the object. The object becomes unusable
after that.
The method needs to be called only in the case if unmanaged image was allocated
using method. In the case if the class instance was created using constructor,
this method does not free unmanaged memory.
Dispose the object.
Indicates if disposing was initiated manually.
Clone image.
Source image.
Return clone of the source image.
The original Bitmap.Clone()
does not produce the desired result - it does not create an actual clone (it does not create a copy
of the image). That is why this method was implemented to provide the functionality.
Summary description for Util.
Clone image.
Source image.
Return clone of the source image.
The original Bitmap.Clone()
does not produce the desired result - it does not create an actual clone (it does not create a copy
of the image). That is why this method was implemented to provide the functionality.
Clone image.
Source image data.
Clones image from source image data. The message does not clone pallete in the
case if the source image has indexed pixel format.
Copy block of unmanaged memory.
Destination pointer.
Source pointer.
Memory block's length to copy.
Return's value of - pointer to destination.
This function is required because of the fact that .NET does
not provide any way to copy unmanaged blocks, but provides only methods to
copy from unmanaged memory to managed memory and vise versa.
The result of parsing the PDf file.
The total number of pages of the document.
The image data of current page.
The annotation data of the current page.
The index of current page.
PDF file version.
PDF file compression type.
Auto mode.
CCITT Group 4 fax encoding.
flate encoding.
JPEG encoding.
PDF Page Size
American Foolscap format
European Foolscap format
halfletter format
ISO 7810 ID-1 format (85.60 x 53.98 mm or 3.370 x 2.125 inch)
ISO 7810 ID-2 format (A7 rotated)
ISO 7810 ID-3 format (B7 rotated)
All the content in the target PDF file will converted in a set resolution in the mode.
With this mode, the PDF module will auto-detect the content of each page in the target PDF file.For a page that is itself an image
the add-on will load it directly with its original resolution.
40-bit RC4 encryption.
128-bit RC4 encryption.
128-bit AES encryption.
256-bit AES encryption.
Rotate text annotaion
TIFF file compression type.
Auto mode.
Dump mode.
CCITT modified Huffman RLE.
CCITT Group 3 fax encoding.
CCITT T.4 (TIFF 6 name).
CCITT Group 4 fax encoding.
CCITT T.6 (TIFF 6 name).
Lempel Ziv and Welch.
from license v1, change to unsigned int64
from license v1, change to unsigned short
from license v1, change to unsigned int64
from license v1, change to unsigned int
Defines the dynamsoft annotation class.
Returns or sets the annotation type. To use the property, the property MouseShape should be set to false.
When an error occurs, please check ImageCoreException.
| Allowed Values |
Annotation Types |
| enumNone(default) |
Select an area |
| enumPointer(Pointer) |
Select an existing annotation. Press "Ctrl" to multi-select annotations. |
| enumText(Text) |
Create a text.The annotation type will be set back to 1 once the annotation is completed. |
| enumLine(Line) |
Create a line.The annotation type will be set back to 1 once the annotation is completed. |
| enumRectangle(Rectangle) |
Create a rectangle.The annotation type will be set back to 1 once the annotation is completed. |
| enumEllipse(Ellipse) |
Create a ellipse.The annotation type will be set back to 1 once the annotation is completed. |
Returns or sets the name of the annotation.
When an error occurs, please check ImageCoreException.
Returns or sets the user name of the annotation.
When an error occurs, please check ImageCoreException.
Returns or sets the description of the annotation.
When an error occurs, please check ImageCoreException.
Returns or sets the time when the annotation is created.
When an error occurs, please check ImageCoreException.
Returns or sets the time when the annotation is last modified.
When an error occurs, please check ImageCoreException.
Return or sets the fill color and transparency for the area inside the annotation.
Return or sets the color of the pen for drawing the annotation rectanle/ellipse/line. This property is only valid when the annotation type is NOT 2(Text).
Returns or sets the width of the pen for drawing the annotation rectangle/ellipse/line. This property is only valid when the annotation type is NOT 2(Text).
When an error occurs, please check ImageCoreException.
By default, the color is width is 1.
Returns or sets the GUID of the annotation.
When an error occurs, please check ImageCoreException.
Returns the left-top coordinate of the annotation.
When an error occurs, please check ImageCoreException.
Returns or sets the size of the annotation.
When an error occurs, please check ImageCoreException.
Returns or sets the content of the annotation text.
When an error occurs, please check ImageCoreException.
Returns or sets the rotate angle of the annotation text.
When an error occurs, please check ImageCoreException.
'
| Allowed Values |
TextRotate Types |
| 0 |
Rotate0 |
| 1 |
Rotate90 |
| 2 |
Rotate180 |
| 3 |
Rotate270 |
Returns or sets if the annotation is selected.
When an error occurs, please check ImageCoreException.
Returns or sets the left-top coordinate of the annotation.
When an error occurs, please check ImageCoreException.
Returns or sets the right-bottom coordinate of the annotation.
When an error occurs, please check ImageCoreException.
Defines a class getting or setting the propeties of text annotation font type.
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 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.
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.
a not defined character in a custom PDF encoding
The font type.
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.
Creates new BaseFont
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
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 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 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 font resources.
@param key the name of the resource
@return the Stream to get the resource or
null if not found
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
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
Gets the encoding used to convert string into byte[].
@return the encoding name
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 postscript font name.
@return the postscript font name
Gets the code pages supported by the font. This has only meaning
with True Type fonts.
@return the code pages supported by the font
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
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
Acts like a StringBuilder but works with byte arrays.
floating point is converted to a format suitable to the PDF.
@author Paulo Soares (psoares@consiste.pt)
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 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.
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.
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.
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
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.
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.
Some PNG specific values.
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 (psoares@consiste.pt)
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. 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.
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.
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 bytes 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
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
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
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)
Removes a PdfObject and its key from the PdfDictionary.
@param key key of the entry (a PdfName)
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.
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
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
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 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)
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
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.
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.
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.
Base class for Color, serves as wrapper class for
to allow extension.
Constuctor for Color object.
The red component value for the new Color structure. Valid values are 0 through 255.
The green component value for the new Color structure. Valid values are 0 through 255.
The blue component value for the new Color structure. Valid values are 0 through 255.
Constuctor for Color object.
The red component value for the new Color structure. Valid values are 0 through 255.
The green component value for the new Color structure. Valid values are 0 through 255.
The blue component value for the new Color structure. Valid values are 0 through 255.
The transparency component value for the new Color structure. Valid values are 0 through 255.
Constructor for Color object
The red component value for the new Color structure. Valid values are 0 through 1.
The green component value for the new Color structure. Valid values are 0 through 1.
The blue component value for the new Color structure. Valid values are 0 through 1.
Constructor for Color object
The red component value for the new Color structure. Valid values are 0 through 1.
The green component value for the new Color structure. Valid values are 0 through 1.
The blue component value for the new Color structure. Valid values are 0 through 1.
The transparency component value for the new Color structure. Valid values are 0 through 1.
Constructor for Color object
a Color object
Has three overloads.
Gets the red component value of this structure.
The red component value of this structure.
Gets the green component value of this structure.
The green component value of this structure.
Gets the blue component value of this structure.
The blue component value of this structure.
Creates an AES Cipher with CBC and no padding.
@author Paulo Soares
Creates a new instance of AESCipher
Creates an AES Cipher with CBC and padding PKCS5/7.
@author Paulo Soares
Creates a new instance of AESCipher
Creates a new instance of ARCFOUREncryption
A wrapper class that allows block ciphers to be used to process data in
a piecemeal fashion. The BufferedBlockCipher outputs a block only when the
buffer is full and more data is being added, or on a doFinal.
Note: in the case where the underlying cipher is either a CFB cipher or an
OFB one the last block may not be a multiple of the block size.
Block cipher engines are expected to conform to this interface.
Initialise the cipher.
If true the cipher is initialised for encryption,
if false for decryption.
The key and other data required by the cipher.
Reset the cipher. After resetting the cipher is in the same state
as it was after the last init (if there was one).
The name of the algorithm this cipher implements.
constructor for subclasses
Create a buffered block cipher without padding.
@param cipher the underlying block cipher this buffering object wraps.
false otherwise.
initialise the cipher.
@param forEncryption if true the cipher is initialised for
encryption, if false for decryption.
@param param the key and other data required by the cipher.
@exception ArgumentException if the parameters argument is
inappropriate.
return the blocksize for the underlying cipher.
@return the blocksize for the underlying cipher.
return the size of the output buffer required for an update
an input of len bytes.
@param len the length of the input.
@return the space required to accommodate a call to update
with len bytes of input.
return the size of the output buffer required for an update plus a
doFinal with an input of len bytes.
@param len the length of the input.
@return the space required to accommodate a call to update and doFinal
with len bytes of input.
process a single byte, producing an output block if neccessary.
@param in the input byte.
@param out the space for any output that might be produced.
@param outOff the offset from which the output will be copied.
@return the number of output bytes copied to out.
@exception DataLengthException if there isn't enough space in out.
@exception InvalidOperationException if the cipher isn't initialised.
process an array of bytes, producing output if necessary.
@param in the input byte array.
@param inOff the offset at which the input data starts.
@param len the number of bytes to be copied out of the input array.
@param out the space for any output that might be produced.
@param outOff the offset from which the output will be copied.
@return the number of output bytes copied to out.
@exception DataLengthException if there isn't enough space in out.
@exception InvalidOperationException if the cipher isn't initialised.
Process the last block in the buffer.
@param out the array the block currently being held is copied into.
@param outOff the offset at which the copying starts.
@return the number of output bytes copied to out.
@exception DataLengthException if there is insufficient space in out for
the output, or the input is not block size aligned and should be.
@exception InvalidOperationException if the underlying cipher is not
initialised.
@exception InvalidCipherTextException if padding is expected and not found.
@exception DataLengthException if the input is not block size
aligned.
Reset the buffer and cipher. After resetting the object is in the same
state as it was after the last init (if there was one).
base implementation of MD4 family style digest as outlined in
"Handbook of Applied Cryptography", pages 344 - 347.
interface that a message digest conforms to.
return the size, in bytes, of the digest produced by this message digest.
@return the size, in bytes, of the digest produced by this message digest.
return the size, in bytes, of the internal buffer used by this digest.
@return the size, in bytes, of the internal buffer used by this digest.
update the message digest with a single byte.
@param inByte the input byte to be entered.
update the message digest with a block of bytes.
@param input the byte array containing the data.
@param inOff the offset into the byte array where the data starts.
@param len the length of the data.
Close the digest, producing the final digest value. The doFinal
call leaves the digest reset.
@param output the array the digest is to be copied into.
@param outOff the offset into the out array the digest is to start at.
reset the digest back to it's initial state.
return the algorithm name
@return the algorithm name
implementation of GOST R 34.11-94
Standard constructor
Constructor to allow use of a particular sbox with GOST28147
@see GOST28147Engine#getSBox(String)
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables to the IV values.
Base class for SHA-384 and SHA-512.
Constructor for variable length word
Copy constructor. We are using copy constructors in place
of the object.Clone() interface as this interface is not
supported by J2ME.
adjust the byte counts so that byteCount2 represents the
upper long (less 3 bits) word of the byte count.
implementation of MD2
as outlined in RFC1319 by B.Kaliski from RSA Laboratories April 1992
Close the digest, producing the final digest value. The doFinal
call leaves the digest reset.
@param out the array the digest is to be copied into.
@param outOff the offset into the out array the digest is to start at.
reset the digest back to it's initial state.
update the message digest with a single byte.
@param in the input byte to be entered.
update the message digest with a block of bytes.
@param in the byte array containing the data.
@param inOff the offset into the byte array where the data starts.
@param len the length of the data.
return the algorithm name
@return the algorithm name
implementation of MD4 as RFC 1320 by R. Rivest, MIT Laboratory for
Computer Science and RSA Data Security, Inc.
NOTE: This algorithm is only included for backwards compatibility
with legacy applications, it's not secure, don't use it for anything new!
Standard constructor
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables to the IV values.
implementation of MD5 as outlined in "Handbook of Applied Cryptography", pages 346 - 347.
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables to the IV values.
implementation of RipeMD128
Standard constructor
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables to the IV values.
implementation of RipeMD see,
http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html
Standard constructor
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables to the IV values.
Implementation of RipeMD256.
Note: this algorithm offers the same level of security as RipeMD128.
Standard constructor
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables to the IV values.
Implementation of RipeMD 320.
Note: this algorithm offers the same level of security as RipeMD160.
Standard constructor
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables to the IV values.
implementation of SHA-1 as outlined in "Handbook of Applied Cryptography", pages 346 - 349.
It is interesting to ponder why the, apart from the extra IV, the other difference here from MD5
is the "endianness" of the word processing!
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables
SHA-224 as described in RFC 3874
block word digest
SHA-1 512 32 160
SHA-224 512 32 224
SHA-256 512 32 256
SHA-384 1024 64 384
SHA-512 1024 64 512
Standard constructor
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables
Draft FIPS 180-2 implementation of SHA-256. Note: As this is
based on a draft this implementation is subject to change.
block word digest
SHA-1 512 32 160
SHA-256 512 32 256
SHA-384 1024 64 384
SHA-512 1024 64 512
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables
Draft FIPS 180-2 implementation of SHA-384. Note: As this is
based on a draft this implementation is subject to change.
block word digest
SHA-1 512 32 160
SHA-256 512 32 256
SHA-384 1024 64 384
SHA-512 1024 64 512
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables
Implementation of SHA-3 based on following KeccakNISTInterface.c from http://keccak.noekeon.org/
Following the naming conventions used in the C source code to enable easy review of the implementation.
Return the size of block that the compression function is applied to in bytes.
@return internal byte length of a block.
Draft FIPS 180-2 implementation of SHA-512. Note: As this is
based on a draft this implementation is subject to change.
block word digest
SHA-1 512 32 160
SHA-256 512 32 256
SHA-384 1024 64 384
SHA-512 1024 64 512
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables
FIPS 180-4 implementation of SHA-512/t
Standard constructor
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables
implementation of Tiger based on:
http://www.cs.technion.ac.il/~biham/Reports/Tiger
Standard constructor
Copy constructor. This will copy the state of the provided
message digest.
reset the chaining variables
Implementation of WhirlpoolDigest, based on Java source published by Barreto
and Rijmen.
Copy constructor. This will copy the state of the provided message
digest.
Reset the chaining variables
an implementation of the AES (Rijndael)), from FIPS-197.
For further details see: http://csrc.nist.gov/encryption/aes/.
This implementation is based on optimizations from Dr. Brian Gladman's paper and C code at
http://fp.gladman.plus.com/cryptography_technology/rijndael/
There are three levels of tradeoff of speed vs memory
Because java has no preprocessor), they are written as three separate classes from which to choose
The fastest uses 8Kbytes of static tables to precompute round calculations), 4 256 word tables for encryption
and 4 for decryption.
The middle performance version uses only one 256 word table for each), for a total of 2Kbytes),
adding 12 rotate operations per round to compute the values contained in the other tables from
the contents of the first
The slowest version uses no static tables at all and computes the values in each round
This file contains the fast version with 8Kbytes of static tables for round precomputation
Base interface for a symmetric key block cipher.
Initialise the cipher.
Initialise for encryption if true, for decryption if false.
The key or other data required by the cipher.
The block size for this cipher, in bytes.
Process a block.
The input buffer.
The offset into inBuf that the input block begins.
The output buffer.
The offset into outBuf to write the output block.
If input block is wrong size, or outBuf too small.
The number of bytes processed and produced.
Reset the cipher to the same state as it was after the last init (if there was one).
The name of the algorithm this cipher implements.
Indicates whether this cipher can handle partial blocks.
Calculate the necessary round keys
The number of calculations depends on key size and block size
AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits
This code is written assuming those are the only possible values
default constructor - 128 bit block size.
initialise an AES cipher.
@param forEncryption whether or not we are for encryption.
@param parameters the parameters required to set up the cipher.
@exception ArgumentException if the parameters argument is
inappropriate.
implementation of GOST 28147-89
standard constructor.
initialise an Gost28147 cipher.
@param forEncryption whether or not we are for encryption.
@param parameters the parameters required to set up the cipher.
@exception ArgumentException if the parameters argument is inappropriate.
Return the S-Box associated with SBoxName
@param sBoxName name of the S-Box
@return byte array representing the S-Box
all parameter classes implement this.
implements Cipher-Block-Chaining (CBC) mode on top of a simple cipher.
Basic constructor.
@param cipher the block cipher to be used as the basis of chaining.
return the underlying block cipher that we are wrapping.
@return the underlying block cipher that we are wrapping.
Initialise the cipher and, possibly, the initialisation vector (IV).
If an IV isn't passed as part of the parameter, the IV will be all zeros.
@param forEncryption if true the cipher is initialised for
encryption, if false for decryption.
@param param the key and other data required by the cipher.
@exception ArgumentException if the parameters argument is
inappropriate.
return the block size of the underlying cipher.
@return the block size of the underlying cipher.
Process one block of input from the array in and write it to
the out array.
@param in the array containing the input data.
@param inOff offset into the in array the data starts at.
@param out the array the output data will be copied into.
@param outOff the offset into the out array the output will start at.
@exception DataLengthException if there isn't enough data in in, or
space in out.
@exception InvalidOperationException if the cipher isn't initialised.
@return the number of bytes processed and produced.
reset the chaining vector back to the IV and reset the underlying
cipher.
Do the appropriate chaining step for CBC mode encryption.
@param in the array containing the data to be encrypted.
@param inOff offset into the in array the data starts at.
@param out the array the encrypted data will be copied into.
@param outOff the offset into the out array the output will start at.
@exception DataLengthException if there isn't enough data in in, or
space in out.
@exception InvalidOperationException if the cipher isn't initialised.
@return the number of bytes processed and produced.
Do the appropriate chaining step for CBC mode decryption.
@param in the array containing the data to be decrypted.
@param inOff offset into the in array the data starts at.
@param out the array the decrypted data will be copied into.
@param outOff the offset into the out array the output will start at.
@exception DataLengthException if there isn't enough data in in, or
space in out.
@exception InvalidOperationException if the cipher isn't initialised.
@return the number of bytes processed and produced.
return the algorithm name and mode.
@return the name of the underlying algorithm followed by "/CBC".
Block cipher padders are expected to conform to this interface
Initialise the padder.
@param param parameters, if any required.
add the pad bytes to the passed in block, returning the
number of bytes added.
return the number of pad bytes present in the block.
@exception InvalidCipherTextException if the padding is badly formed
or invalid.
Return the name of the algorithm the cipher implements.
@return the name of the algorithm the cipher implements.
A wrapper class that allows block ciphers to be used to process data in
a piecemeal fashion with padding. The PaddedBufferedBlockCipher
outputs a block only when the buffer is full and more data is being added,
or on a doFinal (unless the current block in the buffer is a pad block).
The default padding mechanism used is the one outlined in Pkcs5/Pkcs7.
Create a buffered block cipher with the desired padding.
@param cipher the underlying block cipher this buffering object wraps.
@param padding the padding type.
Create a buffered block cipher Pkcs7 padding
@param cipher the underlying block cipher this buffering object wraps.
initialise the cipher.
@param forEncryption if true the cipher is initialised for
encryption, if false for decryption.
@param param the key and other data required by the cipher.
@exception ArgumentException if the parameters argument is
inappropriate.
return the minimum size of the output buffer required for an update
plus a doFinal with an input of len bytes.
@param len the length of the input.
@return the space required to accommodate a call to update and doFinal
with len bytes of input.
return the size of the output buffer required for an update
an input of len bytes.
@param len the length of the input.
@return the space required to accommodate a call to update
with len bytes of input.
process a single byte, producing an output block if neccessary.
@param in the input byte.
@param out the space for any output that might be produced.
@param outOff the offset from which the output will be copied.
@return the number of output bytes copied to out.
@exception DataLengthException if there isn't enough space in out.
@exception InvalidOperationException if the cipher isn't initialised.
process an array of bytes, producing output if necessary.
@param in the input byte array.
@param inOff the offset at which the input data starts.
@param len the number of bytes to be copied out of the input array.
@param out the space for any output that might be produced.
@param outOff the offset from which the output will be copied.
@return the number of output bytes copied to out.
@exception DataLengthException if there isn't enough space in out.
@exception InvalidOperationException if the cipher isn't initialised.
Process the last block in the buffer. If the buffer is currently
full and padding needs to be added a call to doFinal will produce
2 * GetBlockSize() bytes.
@param out the array the block currently being held is copied into.
@param outOff the offset at which the copying starts.
@return the number of output bytes copied to out.
@exception DataLengthException if there is insufficient space in out for
the output or we are decrypting and the input is not block size aligned.
@exception InvalidOperationException if the underlying cipher is not
initialised.
@exception InvalidCipherTextException if padding is expected and not found.
A padder that adds Pkcs7/Pkcs5 padding to a block.
Initialise the padder.
@param random - a SecureRandom if available.
add the pad bytes to the passed in block, returning the
number of bytes added.
return the number of pad bytes present in the block.
Return the name of the algorithm the cipher implements.
@return the name of the algorithm the cipher implements.
Random generation based on the digest with counter. Calling AddSeedMaterial will
always increase the entropy of the hash.
Internal access to the digest is synchronized so a single one of these can be shared.
Generic interface for objects generating random bytes.
Add more seed material to the generator.
A byte array to be mixed into the generator's state.
Add more seed material to the generator.
A long value to be mixed into the generator's state.
Fill byte array with random values.
Array to be filled.
Fill byte array with random values.
Array to receive bytes.
Index to start filling at.
Length of segment to fill.
Takes bytes generated by an underling RandomGenerator and reverses the order in
each small window (of configurable size).
Access to internals is synchronized so a single one of these can be shared.
Add more seed material to the generator.
A byte array to be mixed into the generator's state.
Add more seed material to the generator.
A long value to be mixed into the generator's state.
Fill byte array with random values.
Array to be filled.
Fill byte array with random values.
Array to receive bytes.
Index to start filling at.
Length of segment to fill.
A thread based seed generator - one source of randomness.
Based on an idea from Marcus Lippert.
Generate seed bytes. Set fast to false for best quality.
If fast is set to true, the code should be round about 8 times faster when
generating a long sequence of random bytes. 20 bytes of random values using
the fast mode take less than half a second on a Nokia e70. If fast is set to false,
it takes round about 2500 ms.
@param numBytes the number of bytes to generate
@param fast true if fast mode should be used
General array utilities.
Are two arrays equal.
Left side.
Right side.
True if equal.
A constant time equals comparison - does not terminate early if
test will fail.
first array
second array
true if arrays equal, false otherwise.
Return the number of milliseconds since the Unix epoch (1 Jan., 1970 UTC) for a given DateTime value.
A UTC DateTime value not before epoch.
Number of whole milliseconds after epoch.
'dateTime' is before epoch.
Create a DateTime value from the number of milliseconds since the Unix epoch (1 Jan., 1970 UTC).
Number of milliseconds since the epoch.
A UTC DateTime value
Return the current number of milliseconds since the Unix epoch (1 Jan., 1970 UTC).
Signals an attempt to create an Element that hasn't got the right form.
Signals that an error has occurred in a Document.
Constructs a new DocumentException
Has two overloads.
Construct a new DocumentException
error message
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.
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
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
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 a NoPdfException.
@param message the reason why the document isn't a PDF document according to iText.
@author psoares
Creates a new instance of PdfXConformanceException.
Creates a new instance of PdfXConformanceException.
@param s
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.
@author Paulo Soares (psoares@consiste.pt)
Reads a PDF document.
@author Paulo Soares (psoares@consiste.pt)
@author Kazuya Ujihara
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.
Holds value of property appendable.
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 ownerPassword the password to read the document
@throws IOException on error
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
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 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 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. The pdf is left open but may be closed at any time with
PdfReader.Close(), reopen is automatic.
@param raf the document location
@param ownerPassword the password or null for no password
@throws IOException on error
Creates an independent duplicate.
@param reader the PdfReader to duplicate
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
@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
@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
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 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 contents of the page.
@param pageNum the page number. 1 is the first
@throws IOException on error
@return the content
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 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
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
@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.
Returns true if the PDF is encrypted.
@return true if the PDF is encrypted
Returns true if the PDF has a 128 bit key encryption.
@return true if the PDF has a 128 bit key encryption
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 all the local named links with the actual destinations.
Closes the reader
Removes all the unreachable objects.
@return the number of indirect objects removed
Adds a viewer preference
@param key a key for a viewer preference
@param value a value for the viewer preference
@see PdfViewerPreferences#addViewerPreference
Getter for property newXrefType.
@return Value of property newXrefType.
Getter for property hybridXref.
@return Value of property hybridXref.
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 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 content of the document information dictionary as a Hashtable
of String.
@return content of the document information dictionary
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
Gets the encryption permissions. It can be used directly in
PdfWriter.SetEncryption().
@return the encryption permissions
Gets the trailer dictionary
@return the trailer dictionary
Sets the viewer preferences as the sum of several constants.
@param preferences the viewer preferences
@see PdfViewerPreferences#setViewerPreferences
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 fileLength.
@return Value of property fileLength.
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
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
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 default {@link IFilterHandler}s used by iText
@return the default {@link IFilterHandler}s used by iText
The main interface for creating a new {@link IFilterHandler}
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
Translates a IANA encoding name to a Java encoding.
The object that maps IANA to Java encodings.
Classes implementing this interface can create custom encodings or
replace existing ones. It is used in the context of PdfEncoding.
@author Paulo Soares (psoares@consiste.pt)
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
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
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
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).
Stores the information concerning viewer preferences,
and contains the business logic that allows you to set viewer preferences.
The mask to decide if a ViewerPreferences dictionary is needed
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).
Returns the viewer preferences.
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
Returns the page layout and page mode value.
Sets the viewer preferences as the sum of several constants.
@param preferences
the viewer preferences
@see PdfWriter#setViewerPreferences
A key for an aspect that can be checked for PDF/X Conformance.
A key for an aspect that can be checked for PDF/X Conformance.
A key for an aspect that can be checked for PDF/X Conformance.
A key for an aspect that can be checked for PDF/X Conformance.
A key for an aspect that can be checked for PDF/X Conformance.
A key for an aspect that can be checked for PDF/X Conformance.
A key for an aspect that can be checked for PDF/X Conformance.
The value indicating if the PDF has to be in conformance with PDF/X.
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
Checks if the PDF has to be in conformance with PDFA1
@return true of the PDF has to be in conformance with PDFA1
Checks if the PDF has to be in conformance with PDFA1A
@return true of the PDF has to be in conformance with PDFA1A
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/X conformance that has to be checked
@param obj1 the object that is checked for conformance
@see com.lowagie.text.pdf.interfaces.PdfXConformance#setPDFXConformance(int)
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 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.
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.
Returns the number of elements contained in the hashtable.
Gets the object associated with the specified key in the
A RandomAccessSource that is based on an underlying byte array
@since 5.3.5
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
Closes this source. The underlying data structure or source (if any) will also be closed
@throws IOException
@return the length of this source
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}
Closes all of the underlying sources
{@inheritDoc}
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}
Does nothing - the underlying source is not closed
{@inheritDoc}
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}
Closes the underlying RandomAccessFile
{@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.
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
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}
{@inheritDoc}
Note that the length will be adjusted to read from the corrected location in the underlying source
A PdfAnnotation is a note that is associated with a page.
@see PdfDictionary
attributevalue
Holds value of property used.
Holds value of property placeInPage.
Constructs a new PdfAnnotation of subtype text.
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 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
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 PdfObjects 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 bytes
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 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 allready contains a certain PdfObject.
@param object PdfObject to check
@return true
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 an ArrayList containing PdfObjects.
@return an ArrayList
Returns the number of entries in the array.
@return the size of the ArrayList
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 PdfBorderDictionary define the appearance of a Border (Annotations).
@see PdfDictionary
Constructs a PdfBorderDictionary.
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
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 bytes
Returns the string value of the PdfString-object.
@return a string
Gets the encoding of this string.
@return a string
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
Supports fast encodings for winansi and PDFDocEncoding.
@author Paulo Soares (psoares@consiste.pt)
Checks is text only has PdfDocEncoding characters.
@param text the String to test
@return true if only PdfDocEncoding characters are present
Assumes that '\\n' and '\\r\\n' are the newline sequences. It may not work for
all CJK encodings. To be used with LoadCmap().
Clears the CJK cmaps from the cache. If name is the
empty string then all the cache is cleared. Calling this method
has no consequences other than the need to reload the cmap
if needed.
@param name the name of the cmap to clear or all the cmaps if the empty string
Loads a CJK cmap to the cache with the option of associating
sequences to the newline.
@param name the CJK cmap name
@param newline the sequences to be replaced bi a newline in the resulting CID. See CRLF_CID_NEWLINE
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
The graphic state dictionary.
@author Paulo Soares (psoares@consiste.pt)
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
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.
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.0.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 2.1.6
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
@since 2.1.6
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
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
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
@since 2.0.7
A name
A name
A name
A name.
@since 2.1.6
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.
@since 2.1.6
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
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
@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
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
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
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
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
@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.
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 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 2.1.6
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
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
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
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
@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.2
A name
A name
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
A name
@since 2.1.6 renamed from MIN
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 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
@since 2.1.6
A name
@since 2.1.6
A name
A name
A name
A name used with Document Structure
@since 2.1.5
a name used with Doucment 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
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 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 2.1.6
A name
A name
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.
@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
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
@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
@since 2.1.5 renamed from RELATIVECALORIMETRIC
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
@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
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
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.
@since 2.1.6
A name
A name.
@since 2.1.6
A name
A name
A name
@since 2.1.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
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
A name
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
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
A name
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
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 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
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
A name
A name.
@since 2.1.6
A name
A name.
@since 2.1.6
A name
A name
A name
A name
A name
A name.
@since 2.1.6
A name of an attribute.
A name of an attribute.
A name
@since 2.1.6
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
A name of an encoding
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 of a base 14 type 1 font
A name
A name
A name
A name
A name
A name
A name
A name
map strings to all known static names
@since 2.1.6
Use reflection to cache all the static public final 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 (psoares@consiste.pt)
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 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
Increments the value of the PdfNumber-object with 1.
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
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.
Constructs a PdfStream-object.
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()
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.
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
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
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
Utility class for creating IDigest objects from their names/Oids
Returns a ObjectIdentifier for a given digest mechanism.
A string representation of the digest meanism.
A DerObjectIdentifier, null if the Oid is not available.
Use the specified instance of IRandomGenerator as random source.
This constructor performs no seeding of either the IRandomGenerator or the
constructed SecureRandom. It is the responsibility of the client to provide
proper seed material as necessary/appropriate for the given IRandomGenerator
implementation.
The source to generate all random bytes from.
Creates a new instance of StandardDecryption
The Dimension class encapsulates the width and
height of a component (in int precision) in a single object.
The class is
associated with certain properties of components. Several methods
defined by the Component class and the
LayoutManager interface return a Dimension object.
Normally the values of width
and height are non-negative ints.
The constructors that allow you to create a dimension do
not prevent you from setting a negative value for these properties.
If the value of width or height is
negative, the behavior of some methods defined by other objects is
undefined.
The Dimension2D class is to encapsulate a width
and a height dimension.
This class is only the abstract baseclass for all objects that
store a 2D dimension.
The actual storage representation of the sizes is left to
the subclass.
This is an abstract class that cannot be instantiated directly.
Type-specific implementation subclasses are available for
instantiation and provide a number of formats for storing
the information necessary to satisfy the various accessor
methods below.
Sets the size of this Dimension object to the
specified width and height.
the new width for the Dimension
object
the new height for the Dimension
object
Creates a new object of the same class as this object.
a clone of this instance
Returns the width of this Dimension in double
precision.
the width
Returns the height of this Dimension in double
precision.
the height
Sets the size of this Dimension2D object to
match the specified size.
the size
The width dimension. Negative values can be used.
The height dimension. Negative values can be used.
Creates an instance of Dimension with a width
of zero and a height of zero.
Creates an instance of Dimension whose width
and height are the same as for the specified dimension.
the specified dimension for the
width and
height values.
Constructs a Dimension and initializes it to the specified width and
specified height.
the specified width dimension
the specified height dimension
Set the size of this Dimension object to the specified width
and height in double precision.
the new width for the Dimension object
the new height for the Dimension object
Set the size of this Dimension object
to the specified width and height.
the new width for this Dimension object.
the new height for this Dimension object.
Checks whether two dimension objects have equal values.
Returns the hash code for this Dimension.
a hash code
Returns a string representation of the values of this
Dimension object's height and
width fields.
This method is intended to be used only
for debugging purposes, and the content and format of the returned
string may vary between implementations. The returned string may be
empty but may not be null.
a string representation of this Dimension
object.
Returns the width of this dimension in double precision.
the width
Returns the height of this dimension in double precision.
the height
Get/set the size of this Dimension object.
the size
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
Determine order, walk the tree and push the nodes onto the stack
HasMoreElements
NextElement
MoveNext
For .NET compatibility
Key
Data
Key
Data
Color
Left
Right
Summary description for ListIterator.
Summary description for Properties.
Summary description for Util.
Summary description for DeflaterOutputStream.
Summary description for DeflaterOutputStream.
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();
A class that implements DocListener will perform some
actions when some actions are performed on a Document.
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.
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 to 0.
Sets the page number.
the new page number
This constant may only be changed by Paulo Soares and/or Bruno Lowagie.
@since 2.1.6
This constant may only be changed by Paulo Soares and/or Bruno Lowagie.
@since 2.1.6
This constant may only be changed by Paulo Soares and/or Bruno Lowagie.
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 allready 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.
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.
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.
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 the current date and time to a Document.
true if successful, false otherwise
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
Checks if the document is open.
true if the document is open
Gets the margin mirroring flag.
@return the margin mirroring flag
This are the page resources of the current Page.
Sets the page number.
an int
Returns the current page number.
an int
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.
Gets the pagesize.
the page size
Gets the product name.
This method may only be changed by Paulo Soares and/or Bruno Lowagie.
@return the product name
@since 2.1.6
Gets the release number.
This method may only be changed by Paulo Soares and/or Bruno Lowagie.
@return the product name
@since 2.1.6
Gets the iText version.
iText version
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
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.
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
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.
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.
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.
This is a possible type of Element.
This is a possible type of Element.
@since 2.1.2
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.
A class that contains all the possible tagnames and their attributes.
the root tag.
attribute of the root and annotation tag (also a special tag within a chapter or section)
attribute of the root tag
attribute of the root tag
attribute of the root tag
attribute of the root tag
attribute of the root tag
the chapter tag
the section tag
attribute of section/chapter tag
attribute of section/chapter tag
attribute of section/chapter tag
attribute of section/chapter tag
attribute of chapter/section/paragraph/table/cell tag
attribute of chapter/section/paragraph/table/cell tag
the phrase tag
the anchor tag
the list tag
the listitem tag
the paragraph tag
attribute of phrase/paragraph/cell tag
attribute of paragraph/image/table tag
attribute of paragraph
attribute of anchor tag
attribute of anchor tag
attribute of list tag
attribute of list tag
attribute of the list tag
attribute of list tag
attribute of list tag
attribute of list tag
attribute of list tag
the chunk tag
the chunk tag
the chunk tag
the chunk tag
attribute of the chunk tag
attribute of the chunk tag
attribute of the chunk/table/cell tag
attribute of the chunk/table/cell tag
attribute of the chunk/table/cell tag
attribute of the chunk/table/cell tag
the table tag
the cell tag
the cell tag
attribute of the table tag
attribute of the table tag
attribute of the table tag
attribute of the table tag
attribute of the table tag
attribute of the table tag
attribute of the table tag
attribute of the table tag
attribute of the table tag
attribute of the cell tag
attribute of the cell tag
attribute of the cell tag
attribute of the cell tag
attribute of the cell tag
attribute of the cell tag
attribute of the cell tag
attribute of the table/cell tag
attribute of the table/cell tag
attribute of the table/cell tag
attribute of the table/cell tag
attribute of the table/cell tag
attribute of the table/cell tag
attribute of the table/cell tag
attribute of the table/cell tag
attribute of the table/cell tag
attribute of the table/cell tag
the image tag
the image tag
attribute of the image and annotation tag
attribute of the image tag
attribute of the image tag
attribute of the image tag
attribute of the image tag
attribute of the image tag
attribute of the image tag
attribute of the image tag
attribute of the image tag
attribute of the image tag
attribute of the image tag
the newpage tag
the newpage tag
the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
attribute of the annotation tag
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
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
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
the possible value of an alignment attribute
the possible value of an alignment attribute
the possible value of a tag
the possible value of a tag
the possible value of a tag
a possible list attribute
a possible list attribute
a possible list attribute
a possible list attribute
@since 2.1.3
attribute of the image or iframe tag
@since 2.1.3
Translates the alignment value to a String value.
the alignment value
the translated value
Translates a String value to an alignment value.
(written by Norman Richards, integrated into iText by Bruno)
@param a String (one of the ALIGN_ constants of this class)
@param an alignment value (one of the ALIGN_ constants of the Element interface)
Summary description for ICC_Profile.
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
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 the content of the text element.
the content of the text element
Gets the type of the text element.
a type
Gets all the chunks in this element.
an ArrayList
An Image is the representation of a graphic element (JPEG, PNG or GIF)
that has to be inserted into the document
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 starting from the origin (0, 0).
upper right x
upper right y
Constructs a Rectangle-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
Processes the element by adding it (or the different parts) to an
IElementListener.
an IElementListener
true if the element was processed successfully
@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
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
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
Indicates if the table has borders.
a bool
Indicates if the table has a some type of border.
the type of border
a bool
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
Gets the type of the text element.
a type
Gets all the chunks in this element.
an ArrayList
Get/set the upper right y-coordinate.
a float
Get/set the border
a int
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 width of the rectangle.
a width
Returns the height of the rectangle.
a height
Get/set the borderwidth.
a float
Gets the color of the border.
@return a value
Get/set the color of the border.
a Color
Gets the backgroundcolor.
@return a value
Get/set the backgroundcolor.
a Color
Returns the rotation
a int
Sets a parameter indicating if the rectangle has variable borders
@param useVariableBorders
indication if the rectangle has variable borders
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 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.
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.
a byte array
an object of type Gif, Jpeg or Png
Converts a .NET image to a Native(PNG, JPG, GIF, WMF) image
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
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
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 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
Gets an instance of an Image in raw mode.
the width of the image in pixels
the height of the image in pixels
Sets the absolute position of 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 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
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
@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
generates new serial id
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.
Returns true if this Image is a mask.
true if this Image is a mask
Replaces CalRGB and CalGray colorspaces with DeviceRGB and DeviceGray.
Checks is the image has an ICC profile.
@return the ICC profile or null
Sets the rotation of the image in radians.
rotation in radians
Sets the rotation of the image in degrees.
rotation in degrees
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
Returns the absolute X position.
a position
Returns the absolute Y position.
a position
Returns the type.
a type
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 transparency.
the transparency
Gets the plain width of the image.
a value
Gets the plain height of the image.
a value
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
Get/set the explicit masking.
the explicit masking
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.
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
Tags this image with an ICC profile.
@param profile the profile
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
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
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,
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.
@param version the PDF name that will be used for the Version key in the catalog
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
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.
This is a type of marker.
This is a type of marker.
Acceptable Jpeg markers.
Unsupported Jpeg markers.
Jpeg markers without additional parameters.
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.
constants for md5
Represent digest with ABCD
helper class providing suporting function
Left rotates the input word
a value to be rotated
no of bits to be rotated
the rotated value
perform a ByteReversal on a number
value to be reversed
reversed value
Summary description for MD5.
lookup table 4294967296*sin(i)
X used to proces data in
512 bits chunks as 16 32 bit word
the finger print obtained.
the input bytes
Constructor
calculat md5 signature of the string in Input
Digest: the finger print of msg
perform transformatio using h(b^c^d)
perform transformatio using i (c^(b|~d))
Perform All the transformation on the data
A
B
C
D
Create Padded buffer for processing , buffer is padded with 0 along
with the size in the end
the padded buffer as byte array
Copies a 512 bit block into X as 16 32 bit words
source buffer
no of block to copy starting from 0
gets or sets as string
get/sets as byte array
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.
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
@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 name of the meta information.
name to match
a string
Gets the type of the text element.
a type
Gets all the chunks in this element.
an ArrayList
Returns the content of the meta information.
a string
Returns the name of the meta information.
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 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"
PdfContentByte is an object containing the user positioned
text and graphic contents of a page. It knows how to apply the proper
font encoding.
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
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
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
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). 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
Makes this PdfContentByte empty.
Calls reset( true )
Makes this PdfContentByte empty.
@param validateContent will call sanityCheck() if true.
@since 2.1.6
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
Check if we have a valid PdfWriter.
Gets the internal buffer.
@return the internal buffer
Gets the size of this content.
@return the size of the content
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
Gets a duplicate of this PdfContentByte. All
the members are copied by reference but the buffer stays different.
@return a copy of this PdfContentByte
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
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?
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
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.
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
Signals that the current leading has to be subtracted from a YMark object.
@since 2.1.2
This represents the current alignment of the PDF Elements.
Holds the type of the last element, that has been added to the document.
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
Makes a new page and sends it to the PdfWriter.
@return a bool
@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 to 0.
Signals that OnOpenDocument should be called.
some meta information about the Document.
Gets the PdfCatalog-object.
@param pages an indirect reference to this document pages
@return PdfCatalog
Contains the Viewer preferences of this PDF document.
@see com.lowagie.text.pdf.interfaces.PdfViewerPreferences#addViewerPreference(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject)
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.
This are the page resources of the current Page.
Holds value of property strictImageSequence.
This is the position where the image ends.
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
Getter for the current leading.
@return the current leading
@since 2.1.2
Sets the page number.
@param pageN the new page number
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
@see com.lowagie.text.pdf.interfaces.PdfViewerPreferences#setViewerPreferences(int)
Setter for property strictImageSequence.
@param strictImageSequence New value of property strictImageSequence.
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
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.
Signals that an unspecified problem while constructing a PDF document.
@see BadPdfFormatException
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
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
Writes eficiently to a stream
@param os the stream to write to
@throws IOException on write error
Returns a PdfIndirectReference to this PdfIndirectObject.
@return a PdfIndirectReference
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
Constructs a PdfPage.
@param mediaBox a value for the MediaBox key
@param resources an indirect reference to a PdfResources-object
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
Constructs a PdfPages-object.
Instance of PdfReader in each output document.
@author Paulo Soares (psoares@consiste.pt)
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
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, 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 high level version of this PdfRectangle
@return this PdfRectangle translated to class Rectangle
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 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
Constructs a PDF ResourcesDictionary.
Adds a PdfNumber to the PdfArray.
@param number displacement of the string
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 extensions dictionary.
@since 2.1.6
@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#setPdfVersion(char)
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
possible PDF version (header)
possible PDF version (header)
possible PDF version (header)
possible PDF version (header)
possible PDF version (header)
possible PDF version (header)
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
PDF/X level
PDF/X level
PDF/X level
PDFA-1A level.
PDFA-1B level.
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
Holds value of property fullCompression.
Constructs a PdfWriter.
the pdfdocument object.
The direct content in this document.
The direct content under in this document.
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
Holds value of property extraCatalog.
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
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
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#setAtLeastPdfVersion(char)
@see com.lowagie.text.pdf.interfaces.PdfVersion#setPdfVersion(com.lowagie.text.pdf.PdfName)
Returns the version information.
A number refering to the previous Cross-Reference Table.
Adds a viewer preference
@param preferences the viewer preferences
@see PdfViewerPreferences#addViewerPreference
Stores the PDF/X level.
@see com.lowagie.text.pdf.interfaces.PdfXConformance#isPdfX()
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
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
Holds value of property RGBTranparency.
The compression level of the content streams.
@since 2.1.3
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
Gets the 1.5 compression status.
@return true if the 1.5 compression is on
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 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
Gets a PdfIndirectReference for an object that
will be created in the future.
@return the PdfIndirectReference
Returns the outputStreamCounter.
@return the outputStreamCounter
Sets extra keys to the catalog.
@return the catalog to change
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 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
@see com.lowagie.text.pdf.interfaces.PdfVersion#setPdfVersion(char)
Sets the viewer preferences as the sum of several constants.
@param preferences the viewer preferences
@see PdfViewerPreferences#setViewerPreferences
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
Sets the PDFX conformance level. Allowed values are PDFX1A2001 and PDFX32002. It
must be called before opening the document.
@param pdfxConformance the conformance level
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
If you use SetPageEmpty(false), invoking NewPage() after a blank page will add a newPage.
@param pageEmpty the state
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
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
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
array containing the cross-reference table of the normal objects.
the current byteposition in the body.
Constructs a new PdfBody.
@param writer
Returns the CrossReferenceTable of the Body.
@param os
@param root
@param info
@param encryption
@param fileID
@param prevxref
@throws IOException
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
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)
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
XMP Metadata for the document.
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
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
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 starting from the origin (0, 0).
upper right x
upper right y
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
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 upper right y-coordinate.
a float
Get/set the border
a int
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 Color
Gets the backgroundcolor.
@return a value
Get/set the backgroundcolor.
a Color
Sets a parameter indicating if the rectangle has variable borders
@param useVariableBorders
indication if the rectangle has variable borders
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
A class of PDF Permission.
Specifies each permission for the PDF.
Specifies if can be printed.
Specifies if can be copied.
Specifies if can be changed.
Specifies if can add notes.
Specifies if can fill fields.
Specifies if can copy access.
Specifies if assemble.
Specifies if can print full.
When an error occurs, please check RasterizerException.
Returns or sets if the PDF can be printed.
When an error occurs, please check CameraException.
Returns or sets if the PDF can be copied.
When an error occurs, please check CameraException.
Returns or sets if the PDF can be changed.
When an error occurs, please check CameraException.
Returns or sets if notes can be added in the PDF.
When an error occurs, please check CameraException.
Returns or sets if the filelds can be filled in the PDF.
When an error occurs, please check CameraException.
Returns or sets if the copy access is valid in the PDF.
When an error occurs, please check CameraException.
Returns or sets if the PDF is assemble.
When an error occurs, please check CameraException.
Returns or sets if the PDF can be print full.
When an error occurs, please check CameraException.
Defines the error code of Dynamsoft.PDF.
Successful.
Invalid license.
Expired license.
System exception
Unknown error.
Failed to load rasterizer module.
Failed to get function.
Invalid value.
Failed to save image.
Invalid annotation license.
The interface is used by PDFRasterizer object to process the result of parsing the PDF file.
The interface is used by PDFCreator object to get information about the pictures that need to be saved.
The PDFCreator object call this API to get the count the saved images.
The PDFCreator object call this API to get the image.
The index of PDF page.
The PDFCreator object call this API to get the Annotation object.
The index of PDF page.
stores a set of four integers that represent the location and size of a rect.
Gets the x-coorindate of the upper-left corner of the rect.
Gets the y-coorindate of the upper-left corner of the rect.
Gets the y-coorindate of the bottom-right corner of the rect.
Gets the x-coorindate of the bottom-right corner of the rect.
Defines a class provides functions for converting PDF file to images.
Initialize the PDF Rasterizer component with features to convert PDF to images.
Specifies the license.
When an error occurs, please check RasterizerException.
Converts a local PDF file to image.
The name of the PDF to be converted. It should be the absolute path of the PDF on the local disk.
The password of the PDF.
Specifies the output image resolution.
The callback function.
When an error occurs, please check RasterizerException.
Converts a byte array of a PDF file to image.
The byte array of a PDF file to be converted.
The password of the PDF.
Specifies the output image resolution.
The callback function.
When an error occurs, please check RasterizerException.
Returns or sets the convert mode.
When an error occurs, please check CameraException.
Defines a class provides functions for saving images as PDF format.
Initialize the PDF Creator component with the features to create a PDF with permissions.
Specifies the license.
When an error occurs, please check RasterizerException.
Saves image(s) as a PDF file.
The interface with the image information.
String strFileName:the name of the Multi-Page PDF file to be saved. It should be a local path on the local disk.
When an error occurs, please check RasterizerException.
Saves image(s) as a Byte file.
The interface with the image information.
When an error occurs, please check RasterizerException.
Adds the specified security to the selected document.
Specifies the name of the PDF files as the result.
Specifies the name(s) of the existing PDF files on local disk to be merged.
Specifies the owner password of the new PDF file.
Specifies the user password of the new PDF file.
Specifies encryption of the new PDF file.
Specifies permission of the new PDF file.
When an error occurs, please check RasterizerException.
Returns or sets the name of the person who creates the PDF document.
When an error occurs, please check RasterizerException.
Returns or sets the name of the application that created the original document. It is used when the PDF document is converted from another form.
When an error occurs, please check RasterizerException.
Returns or sets the keywords associated with the PDF document.
When an error occurs, please check RasterizerException.
Returns or sets the date when the PDF document is last modified.
When an error occurs, please check RasterizerException.
The default value is current date.
Returns or sets the name of the application that converted the PDF document from its native.
When an error occurs, please check RasterizerException.
Returns or sets the subject of the PDF document.
When an error occurs, please check RasterizerException.
Returns or sets the title of the PDF document.
When an error occurs, please check RasterizerException.
Returns or sets the margin of the PDF document.
When an error occurs, please check RasterizerException.
Returns or sets the quality of the JPEG file.
When an error occurs, please check RasterizerException.
Create an instance of barcode generator exception.
A strongly-typed resource class, for looking up localized strings, etc.
Returns the cached ResourceManager instance used by this class.
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.