Package org.nuxeo.ecm.platform.pdf
Class PDFPageExtractor
java.lang.Object
org.nuxeo.ecm.platform.pdf.PDFPageExtractor
Extract pages from a PDF.
- Since:
- 8.10
-
Constructor Summary
ConstructorDescriptionPDFPageExtractor
(Blob inBlob) PDFPageExtractor
(DocumentModel inDoc, String inXPath) Constructor with aDocumentModel
. -
Method Summary
Modifier and TypeMethodDescriptionextract
(int inStartPage, int inEndPage) extract
(int inStartPage, int inEndPage, String inFileName, String inTitle, String inSubject, String inAuthor) Return a Blob built from pageinStartPage
toinEndPage
(inclusive).getPagesAsImages
(String inFileName) void
setPassword
(String password)
-
Constructor Details
-
PDFPageExtractor
-
PDFPageExtractor
Constructor with aDocumentModel
. Default value forinXPath
(if passednull
or ""), isfile:content
.- Parameters:
inDoc
- Input DocumentModel.inXPath
- Input XPath.
-
-
Method Details
-
extract
-
extract
public Blob extract(int inStartPage, int inEndPage, String inFileName, String inTitle, String inSubject, String inAuthor) throws NuxeoException Return a Blob built from pageinStartPage
toinEndPage
(inclusive).If
inEndPage
is greater than the number of pages in the source document, it will go to the end of the document. IfinStartPage
is less than 1, it'll start with page 1. IfinStartPage
is greater thaninEndPage
or 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
- Throws:
NuxeoException
-
setPassword
-