Package com.itextpdf.text.pdf
Class SimpleNamedDestination
java.lang.Object
com.itextpdf.text.pdf.SimpleNamedDestination
- All Implemented Interfaces:
SimpleXMLDocHandler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static PdfArraycreateDestinationArray(String value, PdfWriter writer) voidCalled after the document is parsed.voidendElement(String tag) Called when an end tag is found.static Stringstatic voidexportToXML(HashMap<String, String> names, OutputStream out, String encoding, boolean onlyASCII) Exports the destinations to XML.static voidExports the destinations to XML.getNamedDestination(PdfReader reader, boolean fromNames) Import the names from XML.importFromXML(Reader in) Import the names from XML.static PdfDictionaryoutputNamedDestinationAsNames(HashMap<String, String> names, PdfWriter writer) static PdfDictionaryoutputNamedDestinationAsStrings(HashMap<String, String> names, PdfWriter writer) voidCalled when the document starts to be parsed.voidstartElement(String tag, Map<String, String> h) Called when a start tag is found.voidCalled when a text element is found.static String
-
Field Details
-
xmlNames
-
xmlLast
-
-
Constructor Details
-
SimpleNamedDestination
private SimpleNamedDestination()
-
-
Method Details
-
getNamedDestination
-
exportToXML
public static void exportToXML(HashMap<String, String> names, OutputStream out, String encoding, boolean onlyASCII) throws IOExceptionExports the destinations to XML. The DTD for this XML is:<?xml version='1.0' encoding='UTF-8'?> <!ELEMENT Name (#PCDATA)> <!ATTLIST Name Page CDATA #IMPLIED > <!ELEMENT Destination (Name)*>- Parameters:
names- the namesout- the export destination. The stream is not closedencoding- the encoding according to IANA conventionsonlyASCII- codes above 127 will always be escaped with &#nn; iftrue, whatever the encoding- Throws:
IOException- on error- Since:
- 5.0.1 (generic type in signature)
-
exportToXML
public static void exportToXML(HashMap<String, String> names, Writer wrt, String encoding, boolean onlyASCII) throws IOExceptionExports the destinations to XML.- Parameters:
names- the nameswrt- the export destination. The writer is not closedencoding- the encoding according to IANA conventionsonlyASCII- codes above 127 will always be escaped with &#nn; iftrue, whatever the encoding- Throws:
IOException- on error- Since:
- 5.0.1 (generic type in signature)
-
importFromXML
Import the names from XML.- Parameters:
in- the XML source. The stream is not closed- Returns:
- the names
- Throws:
IOException- on error
-
importFromXML
Import the names from XML.- Parameters:
in- the XML source. The reader is not closed- Returns:
- the names
- Throws:
IOException- on error
-
createDestinationArray
-
outputNamedDestinationAsNames
public static PdfDictionary outputNamedDestinationAsNames(HashMap<String, String> names, PdfWriter writer) -
outputNamedDestinationAsStrings
public static PdfDictionary outputNamedDestinationAsStrings(HashMap<String, String> names, PdfWriter writer) throws IOException- Throws:
IOException
-
escapeBinaryString
-
unEscapeBinaryString
-
endDocument
public void endDocument()Description copied from interface:SimpleXMLDocHandlerCalled after the document is parsed.- Specified by:
endDocumentin interfaceSimpleXMLDocHandler
-
endElement
Description copied from interface:SimpleXMLDocHandlerCalled when an end tag is found.- Specified by:
endElementin interfaceSimpleXMLDocHandler- Parameters:
tag- the tag name
-
startDocument
public void startDocument()Description copied from interface:SimpleXMLDocHandlerCalled when the document starts to be parsed.- Specified by:
startDocumentin interfaceSimpleXMLDocHandler
-
startElement
Description copied from interface:SimpleXMLDocHandlerCalled when a start tag is found.- Specified by:
startElementin interfaceSimpleXMLDocHandler- Parameters:
tag- the tag nameh- the tag's attributes
-
text
Description copied from interface:SimpleXMLDocHandlerCalled when a text element is found.- Specified by:
textin interfaceSimpleXMLDocHandler- Parameters:
str- the text element, probably a fragment.
-