com.lowagie.text.pdf.parser

Class PdfContentReaderTool

public class PdfContentReaderTool extends Object

Tool that parses the content of a PDF document.

Since: 2.1.4

Method Summary
static StringgetDictionaryDetail(PdfDictionary dic)
Shows the detail of a dictionary.
static StringgetDictionaryDetail(PdfDictionary dic, int depth)
Shows the detail of a dictionary.
static voidlistContentStream(File pdfFile, PrintWriter out)
Writes information about each page in a PDF file to the specified output stream.
static voidlistContentStream(File pdfFile, int pageNum, PrintWriter out)
Writes information about the specified page in a PDF file to the specified output stream.
static voidlistContentStreamForPage(PdfReader reader, int pageNum, PrintWriter out)
Writes information about a specific page from PdfReader to the specified output stream.
static voidmain(String[] args)
Writes information about each page in a PDF file to the specified file, or System.out.

Method Detail

getDictionaryDetail

public static String getDictionaryDetail(PdfDictionary dic)
Shows the detail of a dictionary. This is similar to the PdfLister functionality.

Parameters: dic the dictionary of which you want the detail

Returns: a String representation of the dictionary

getDictionaryDetail

public static String getDictionaryDetail(PdfDictionary dic, int depth)
Shows the detail of a dictionary.

Parameters: dic the dictionary of which you want the detail depth the depth of the current dictionary (for nested dictionaries)

Returns: a String representation of the dictionary

listContentStream

public static void listContentStream(File pdfFile, PrintWriter out)
Writes information about each page in a PDF file to the specified output stream.

Parameters: pdfFile a File instance referring to a PDF file out the output stream to send the content to

Throws: IOException

Since: 2.1.5

listContentStream

public static void listContentStream(File pdfFile, int pageNum, PrintWriter out)
Writes information about the specified page in a PDF file to the specified output stream.

Parameters: pdfFile a File instance referring to a PDF file pageNum the page number to read out the output stream to send the content to

Throws: IOException

Since: 2.1.5

listContentStreamForPage

public static void listContentStreamForPage(PdfReader reader, int pageNum, PrintWriter out)
Writes information about a specific page from PdfReader to the specified output stream.

Parameters: reader the PdfReader to read the page content from pageNum the page number to read out the output stream to send the content to

Throws: IOException

Since: 2.1.5

main

public static void main(String[] args)
Writes information about each page in a PDF file to the specified file, or System.out.

Parameters: args