public class TaggedPdfReaderTool extends Object
Modifier and Type | Field and Description |
---|---|
(package private) PrintWriter |
out
The writer object to which the XML will be written
|
(package private) PdfReader |
reader
The reader object from which the content streams are read.
|
Constructor and Description |
---|
TaggedPdfReaderTool() |
Modifier and Type | Method and Description |
---|---|
void |
convertToXml(PdfReader reader,
OutputStream os)
Parses a string with structured content.
|
void |
convertToXml(PdfReader reader,
OutputStream os,
String charset)
Parses a string with structured content.
|
private static String |
fixTagName(String tag) |
void |
inspectChild(PdfObject k)
Inspects a child of a structured element.
|
void |
inspectChildArray(PdfArray k)
If the child of a structured element is an array, we need to loop over
the elements.
|
void |
inspectChildDictionary(PdfDictionary k)
If the child of a structured element is a dictionary, we inspect the
child; we may also draw a tag.
|
void |
parseTag(String tag,
PdfObject object,
PdfDictionary page)
Searches for a tag in a page.
|
PrintWriter out
public TaggedPdfReaderTool()
public void convertToXml(PdfReader reader, OutputStream os, String charset) throws IOException
reader
- the PdfReader that has access to the PDF fileos
- the OutputStream to which the resulting xml will be writtencharset
- the charset to encode the dataIOException
public void convertToXml(PdfReader reader, OutputStream os) throws IOException
reader
- the PdfReader that has access to the PDF fileos
- the OutputStream to which the resulting xml will be writtenIOException
public void inspectChild(PdfObject k) throws IOException
k
- the child to inspectIOException
public void inspectChildArray(PdfArray k) throws IOException
k
- the child array to inspectIOException
public void inspectChildDictionary(PdfDictionary k) throws IOException
k
- the child dictionary to inspectIOException
private static String fixTagName(String tag)
public void parseTag(String tag, PdfObject object, PdfDictionary page) throws IOException
tag
- the name of the tagobject
- an identifier to find the marked contentpage
- a page dictionaryIOException
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses