Class PdfContentReaderTool
java.lang.Object
com.itextpdf.text.pdf.parser.PdfContentReaderTool
Tool that parses the content of a PDF document.
- Since:
- 2.1.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringShows the detail of a dictionary.static StringgetDictionaryDetail(PdfDictionary dic, int depth) Shows the detail of a dictionary.static StringgetXObjectDetail(PdfDictionary resourceDic) Displays a summary of the entries in the XObject dictionary for the streamstatic voidlistContentStream(File pdfFile, int pageNum, PrintWriter out) Writes information about the specified page in a PDF file to the specified output stream.static voidlistContentStream(File pdfFile, PrintWriter out) Writes information about each 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 voidWrites information about each page in a PDF file to the specified file, or System.out.
-
Constructor Details
-
PdfContentReaderTool
public PdfContentReaderTool()
-
-
Method Details
-
getDictionaryDetail
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
Shows the detail of a dictionary.- Parameters:
dic- the dictionary of which you want the detaildepth- the depth of the current dictionary (for nested dictionaries)- Returns:
- a String representation of the dictionary
-
getXObjectDetail
Displays a summary of the entries in the XObject dictionary for the stream- Parameters:
resourceDic- the resource dictionary for the stream- Returns:
- a string with the summary of the entries
- Throws:
IOException- Since:
- 5.0.2
-
listContentStreamForPage
public static void listContentStreamForPage(PdfReader reader, int pageNum, PrintWriter out) throws IOException Writes information about a specific page from PdfReader to the specified output stream.- Parameters:
reader- the PdfReader to read the page content frompageNum- the page number to readout- the output stream to send the content to- Throws:
IOException- Since:
- 2.1.5
-
listContentStream
Writes information about each page in a PDF file to the specified output stream.- Parameters:
pdfFile- a File instance referring to a PDF fileout- the output stream to send the content to- Throws:
IOException- Since:
- 2.1.5
-
listContentStream
Writes information about the specified page in a PDF file to the specified output stream.- Parameters:
pdfFile- a File instance referring to a PDF filepageNum- the page number to readout- the output stream to send the content to- Throws:
IOException- Since:
- 2.1.5
-
main
Writes information about each page in a PDF file to the specified file, or System.out.- Parameters:
args-
-