Package com.lowagie.rups.model
Class PdfFile
- java.lang.Object
-
- com.lowagie.rups.model.PdfFile
-
public class PdfFile extends java.lang.Object
Wrapper for both iText's PdfReader (referring to a PDF file to read) and SUN's PDFFile (referring to the same PDF file to render).
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.File
directory
The directory where the file can be found (if the PDF was passed as a file).protected java.lang.String
filename
The original filename.protected Permissions
permissions
The file permissionsprotected PdfReader
reader
The PdfReader object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfReader
getPdfReader()
Getter for iText's PdfReader object.protected void
readFile(RandomAccessFileOrArray pdf)
Does the actual reading of the file into PdfReader and PDFFile.
-
-
-
Field Detail
-
directory
protected java.io.File directory
The directory where the file can be found (if the PDF was passed as a file).
-
filename
protected java.lang.String filename
The original filename.
-
reader
protected PdfReader reader
The PdfReader object.
-
permissions
protected Permissions permissions
The file permissions
-
-
Constructor Detail
-
PdfFile
public PdfFile(java.io.File file) throws java.io.IOException, DocumentException
Constructs a PdfFile object.- Parameters:
file
- the File to read- Throws:
java.io.IOException
- thrown when an I/O operation failsDocumentException
- thrown when an error occurs with the Document
-
PdfFile
public PdfFile(byte[] file) throws java.io.IOException, DocumentException
Constructs a PdfFile object.- Parameters:
file
- the byte[] to read- Throws:
java.io.IOException
- thrown when an I/O operation failsDocumentException
- thrown when an error occurs with the Document
-
-
Method Detail
-
readFile
protected void readFile(RandomAccessFileOrArray pdf) throws java.io.IOException, DocumentException
Does the actual reading of the file into PdfReader and PDFFile.- Parameters:
pdf
- a Random Access File or Array- Throws:
java.io.IOException
- thrown when an I/O operation goes wrongDocumentException
- thrown when something goes wrong with a Document
-
getPdfReader
public PdfReader getPdfReader()
Getter for iText's PdfReader object.- Returns:
- a PdfReader object
-
-