HiraokaHyperTools.iTextSharp-LGPL
0.2.5
|
Public Member Functions | |
void | EndDocument () |
void | EndElement (String tag) |
void | StartDocument () |
void | StartElement (String tag, Hashtable h) |
void | Text (String str) |
Static Public Member Functions | |
static ArrayList | GetBookmark (PdfReader reader) |
static void | EliminatePages (ArrayList list, int[] pageRange) |
static void | ShiftPageNumbers (ArrayList list, int pageShift, int[] pageRange) |
static Object[] | IterateOutlines (PdfWriter writer, PdfIndirectReference parent, ArrayList kids, bool namedAsNames) |
static void | ExportToXMLNode (ArrayList list, TextWriter outp, int indent, bool onlyASCII) |
static void | ExportToXML (ArrayList list, Stream outp, String encoding, bool onlyASCII) |
static void | ExportToXML (ArrayList list, TextWriter wrt, String encoding, bool onlyASCII) |
static ArrayList | ImportFromXML (Stream inp) |
static ArrayList | ImportFromXML (TextReader inp) |
static String | EscapeBinaryString (String s) |
static String | UnEscapeBinaryString (String s) |
Bookmark processing in a simple way. It has some limitations, mainly the only action types supported are GoTo, GoToR, URI and Launch.
The list structure is composed by a number of Hashtable, keyed by strings, one Hashtable for each bookmark. The element values are all strings with the exception of the key "Kids" that has another list for the child bookmarks.
All the bookmarks have a "Title" with the bookmark title and optionally a "Style" that can be "bold", "italic" or a combination of both. They can also have a "Color" key with a value of three floats separated by spaces. The key "Open" can have the values "true" or "false" and signals the open status of the children. It's "true" by default.
The actions and the parameters can be:
|
static |
Removes the bookmark entries for a number of page ranges. The page ranges consists of a number of pairs with the start/end page range. The page numbers are inclusive.
list | the bookmarks |
pageRange | the page ranges, always in pairs. |
void iTextSharp.text.pdf.SimpleBookmark.EndDocument | ( | ) |
Called after the document is parsed.
Implements iTextSharp.text.xml.simpleparser.ISimpleXMLDocHandler.
void iTextSharp.text.pdf.SimpleBookmark.EndElement | ( | String | tag | ) |
Called when an end tag is found.
tag | the tag name |
Implements iTextSharp.text.xml.simpleparser.ISimpleXMLDocHandler.
|
static |
|
static |
Exports the bookmarks to XML. The DTD for this XML is:
<?xml version='1.0' encoding='UTF-8'?> <!ELEMENT Title (#PCDATA|Title)*> <!ATTLIST Title Action CDATA #IMPLIED Open CDATA #IMPLIED Page CDATA #IMPLIED URI CDATA #IMPLIED File CDATA #IMPLIED Named CDATA #IMPLIED NamedN CDATA #IMPLIED NewWindow CDATA #IMPLIED Style CDATA #IMPLIED Color CDATA #IMPLIED > <!ELEMENT Bookmark (Title)*>
list | the bookmarks |
out | the export destination. The stream is not closed |
encoding | the encoding according to IANA conventions |
onlyASCII | codes above 127 will always be escaped with &#nn; if true , whatever the encoding |
IOException | on error |
|
static |
Exports the bookmarks to XML.
list | the bookmarks |
wrt | the export destination. The writer is not closed |
encoding | the encoding according to IANA conventions |
onlyASCII | codes above 127 will always be escaped with &#nn; if true , whatever the encoding |
IOException | on error |
|
static |
Exports the bookmarks to XML. Only of use if the generation is to be include in some other XML document.
list | the bookmarks |
out | the export destination. The writer is not closed |
indent | the indentation level. Pretty printing significant only |
onlyASCII | codes above 127 will always be escaped with &#nn; if true , whatever the encoding |
IOException | on error |
|
static |
|
static |
Import the bookmarks from XML.
in | the XML source. The stream is not closed |
IOException | on error |
|
static |
Import the bookmarks from XML.
in | the XML source. The reader is not closed |
IOException | on error |
|
static |
|
static |
For the pages in range add the pageShift
to the page number. The page ranges consists of a number of pairs with the start/end page range. The page numbers are inclusive.
list | the bookmarks |
pageShift | the number to add to the pages in range |
pageRange | the page ranges, always in pairs. It can be null to include all the pages |
void iTextSharp.text.pdf.SimpleBookmark.StartDocument | ( | ) |
Called when the document starts to be parsed.
Implements iTextSharp.text.xml.simpleparser.ISimpleXMLDocHandler.
void iTextSharp.text.pdf.SimpleBookmark.StartElement | ( | String | tag, |
Hashtable | h | ||
) |
Called when a start tag is found.
tag | the tag name |
h | the tag's attributes |
Implements iTextSharp.text.xml.simpleparser.ISimpleXMLDocHandler.
void iTextSharp.text.pdf.SimpleBookmark.Text | ( | String | str | ) |
Called when a text element is found.
str | the text element, probably a fragment. |
Implements iTextSharp.text.xml.simpleparser.ISimpleXMLDocHandler.
|
static |