Package com.lowagie.text.pdf
Class SimpleNamedDestination
- java.lang.Object
-
- com.lowagie.text.pdf.SimpleNamedDestination
-
- All Implemented Interfaces:
SimpleXMLDocHandler
public final class SimpleNamedDestination extends Object implements SimpleXMLDocHandler
- Author:
- Paulo Soares (psoares@consiste.pt)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidendDocument()Called after the document is parsed.voidendElement(String tag)Called when an end tag is found.static StringescapeBinaryString(String s)static voidexportToXML(HashMap names, OutputStream out, String encoding, boolean onlyASCII)Exports the destinations to XML.static voidexportToXML(HashMap names, Writer wrt, String encoding, boolean onlyASCII)Exports the destinations to XML.static HashMap<Object,Object>getNamedDestination(PdfReader reader, boolean fromNames)static HashMap<String,String>importFromXML(InputStream in)Import the names from XML.static HashMap<String,String>importFromXML(Reader in)Import the names from XML.static PdfDictionaryoutputNamedDestinationAsNames(HashMap names, PdfWriter writer)static PdfDictionaryoutputNamedDestinationAsStrings(Map<String,String> names, PdfWriter writer)voidstartDocument()Called when the document starts to be parsed.voidstartElement(String tag, HashMap h)Deprecated.voidstartElement(String tag, Map<String,String> h)Called when a start tag is found.voidtext(String str)Called when a text element is found.static StringunEscapeBinaryString(String s)
-
-
-
Method Detail
-
getNamedDestination
public static HashMap<Object,Object> getNamedDestination(PdfReader reader, boolean fromNames)
-
exportToXML
public static void exportToXML(HashMap names, OutputStream out, String encoding, boolean onlyASCII) throws IOException
Exports 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
-
exportToXML
public static void exportToXML(HashMap names, Writer wrt, String encoding, boolean onlyASCII) throws IOException
Exports 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
-
importFromXML
public static HashMap<String,String> importFromXML(InputStream in) throws IOException
Import the names from XML.- Parameters:
in- the XML source. The stream is not closed- Returns:
- the names
- Throws:
IOException- on error
-
importFromXML
public static HashMap<String,String> importFromXML(Reader in) throws IOException
Import the names from XML.- Parameters:
in- the XML source. The reader is not closed- Returns:
- the names
- Throws:
IOException- on error
-
outputNamedDestinationAsNames
public static PdfDictionary outputNamedDestinationAsNames(HashMap names, PdfWriter writer)
-
outputNamedDestinationAsStrings
public static PdfDictionary outputNamedDestinationAsStrings(Map<String,String> names, PdfWriter writer) throws IOException
- Throws:
IOException
-
endDocument
public void endDocument()
Description copied from interface:SimpleXMLDocHandlerCalled after the document is parsed.- Specified by:
endDocumentin interfaceSimpleXMLDocHandler
-
endElement
public void endElement(String tag)
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
@Deprecated public void startElement(String tag, HashMap h)
Deprecated.Description copied from interface:SimpleXMLDocHandlerCalled when a start tag is found.- Specified by:
startElementin interfaceSimpleXMLDocHandler- Parameters:
tag- the tag nameh- the tag's attributes
-
startElement
public void startElement(String tag, Map<String,String> h)
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
public void text(String str)
Description copied from interface:SimpleXMLDocHandlerCalled when a text element is found.- Specified by:
textin interfaceSimpleXMLDocHandler- Parameters:
str- the text element, probably a fragment.
-
-