Package de.xima.fc.pdf.loader
Class PdDocumentLoader
- java.lang.Object
 - 
- de.xima.fc.pdf.loader.PdDocumentLoader
 
 
- 
public final class PdDocumentLoader extends Object
Helper methods for loading aPDDocument.- Since:
 - 7.2.0
 - Author:
 - XIMA MEDIA GmbH
 
 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.pdfbox.pdmodel.PDDocumentload(byte[] pdf, String password)Loads a PDF file via PDFBox into aPDDocument.static org.apache.pdfbox.pdmodel.PDDocumentload(File pdf, String password)Loads a PDF file via PDFBox into aPDDocument.static org.apache.pdfbox.pdmodel.PDDocumentload(InputStream pdf, String password)Loads a PDF file via PDFBox into aPDDocument.static org.apache.pdfbox.pdmodel.PDDocumentload(Path pdf, String password)Loads a PDF file via PDFBox into aPDDocument. 
 - 
 
- 
- 
Method Detail
- 
load
public static org.apache.pdfbox.pdmodel.PDDocument load(byte[] pdf, String password) throws org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException, IOExceptionLoads a PDF file via PDFBox into aPDDocument. Make sure toclosethe document when done, prefer using a try-with-resources-statement.- Parameters:
 pdf- PDF file to open.password- Password when the PDF is encrypted. Can benullwhen not encrypted.- Returns:
 - The loaded PDF document.
 - Throws:
 org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException- When the PDF is encrypted and the password in invalid.IOException- When the PDF document could not be loaded.
 
- 
load
public static org.apache.pdfbox.pdmodel.PDDocument load(File pdf, String password) throws org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException, IOException
Loads a PDF file via PDFBox into aPDDocument. Make sure toclosethe document when done, prefer using a try-with-resources-statement.- Parameters:
 pdf- PDF file to open.password- Password when the PDF is encrypted. Can benullwhen not encrypted.- Returns:
 - The loaded PDF document.
 - Throws:
 org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException- When the PDF is encrypted and the password in invalid.IOException- When the PDF document could not be loaded.
 
- 
load
public static org.apache.pdfbox.pdmodel.PDDocument load(InputStream pdf, String password) throws org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException, IOException
Loads a PDF file via PDFBox into aPDDocument. Make sure toclosethe document when done, prefer using a try-with-resources-statement.- Parameters:
 pdf- PDF file to open.password- Password when the PDF is encrypted. Can benullwhen not encrypted.- Returns:
 - The loaded PDF document.
 - Throws:
 org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException- When the PDF is encrypted and the password in invalid.IOException- When the PDF document could not be loaded.
 
- 
load
public static org.apache.pdfbox.pdmodel.PDDocument load(Path pdf, String password) throws org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException, IOException
Loads a PDF file via PDFBox into aPDDocument. Make sure toclosethe document when done, prefer using a try-with-resources-statement.- Parameters:
 pdf- PDF file to open.password- Password when the PDF is encrypted. Can benullwhen not encrypted.- Returns:
 - The loaded PDF document.
 - Throws:
 org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException- When the PDF is encrypted and the password in invalid.IOException- When the PDF document could not be loaded.
 
 - 
 
 -