public class PDFPageExtractor extends Object
Constructor and Description |
---|
PDFPageExtractor(Blob inBlob) |
PDFPageExtractor(DocumentModel inDoc,
String inXPath)
Constructor with a
DocumentModel . |
Modifier and Type | Method and Description |
---|---|
Blob |
extract(int inStartPage,
int inEndPage) |
Blob |
extract(int inStartPage,
int inEndPage,
String inFileName,
String inTitle,
String inSubject,
String inAuthor)
Return a Blob built from page
inStartPage to inEndPage (inclusive). |
BlobList |
getPagesAsImages(String inFileName) |
void |
setPassword(String password) |
public PDFPageExtractor(Blob inBlob)
public PDFPageExtractor(DocumentModel inDoc, String inXPath)
DocumentModel
. Default value for inXPath
(if passed
null
or ""), is file:content
.inDoc
- Input DocumentModel.inXPath
- Input XPath.public Blob extract(int inStartPage, int inEndPage, String inFileName, String inTitle, String inSubject, String inAuthor) throws NuxeoException
inStartPage
to inEndPage
(inclusive).
If inEndPage
is greater than the number of pages in the source document, it will go to the end of
the document. If inStartPage
is less than 1, it'll start with page 1. If inStartPage
is
greater than inEndPage
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 +> 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.
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.NuxeoException
public BlobList getPagesAsImages(String inFileName) throws NuxeoException
NuxeoException
public void setPassword(String password)
Copyright © 2017 Nuxeo. All rights reserved.