Package org.nuxeo.ecm.platform.pdf
Class PDFPageExtractor
- java.lang.Object
-
- org.nuxeo.ecm.platform.pdf.PDFPageExtractor
-
public class PDFPageExtractor extends Object
Extract pages from a PDF.- Since:
- 8.10
-
-
Constructor Summary
Constructors Constructor Description PDFPageExtractor(Blob inBlob)PDFPageExtractor(DocumentModel inDoc, String inXPath)Constructor with aDocumentModel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Blobextract(int inStartPage, int inEndPage)Blobextract(int inStartPage, int inEndPage, String inFileName, String inTitle, String inSubject, String inAuthor)Return a Blob built from pageinStartPagetoinEndPage(inclusive).BlobListgetPagesAsImages(String inFileName)voidsetPassword(String password)
-
-
-
Constructor Detail
-
PDFPageExtractor
public PDFPageExtractor(Blob inBlob)
-
PDFPageExtractor
public PDFPageExtractor(DocumentModel inDoc, String inXPath)
Constructor with aDocumentModel. Default value forinXPath(if passednullor ""), isfile:content.- Parameters:
inDoc- Input DocumentModel.inXPath- Input XPath.
-
-
Method Detail
-
extract
public Blob extract(int inStartPage, int inEndPage)
-
extract
public Blob extract(int inStartPage, int inEndPage, String inFileName, String inTitle, String inSubject, String inAuthor) throws NuxeoException
Return a Blob built from pageinStartPagetoinEndPage(inclusive).If
inEndPageis greater than the number of pages in the source document, it will go to the end of the document. IfinStartPageis less than 1, it'll start with page 1. IfinStartPageis greater thaninEndPageor greater than the number of pages in the source document, a blank document will be returned.If fileName is null or "", if is set to the original name + the page range: mydoc.pdf and pages 10-75 +@gt; mydoc-10-75.pdf.
The mimetype is always set to "application/pdf".
Can set the title, subject and author of the resulting PDF. Notice: If the value is null or "", it is just ignored.
- Parameters:
inStartPage- Number of first page to be included.inEndPage- Number of the last page to be included.inFileName- Name of the resulting PDF.inTitle- Title of the resulting PDF.inSubject- Subject of the resulting PDF.inAuthor- Author of the resulting PDF.- Returns:
- FileBlob
- Throws:
NuxeoException
-
getPagesAsImages
public BlobList getPagesAsImages(String inFileName) throws NuxeoException
- Throws:
NuxeoException
-
setPassword
public void setPassword(String password)
-
-