Package org.nuxeo.ecm.platform.pdf
Class PDFUtils
java.lang.Object
org.nuxeo.ecm.platform.pdf.PDFUtils
Grouping miscellaneous utilities in this class.
- Since:
- 8.10
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
checkXPath
(String inXPath) static void
closeSilently
(org.apache.pdfbox.pdmodel.PDDocument... inPdfDocs) static org.apache.pdfbox.pdmodel.font.PDType1Font
getStandardType1Font
(String name) Gets one of the Standard 14 Type 1 Fonts.static int[]
hex255ToRGB
(String inHex) static org.apache.pdfbox.pdmodel.PDDocument
This is just a shortcut.static FileBlob
saveInTempFile
(org.apache.pdfbox.pdmodel.PDDocument inPdfDoc) Create a temporary PDF file and return a FileBlob built from this file.static FileBlob
saveInTempFile
(org.apache.pdfbox.pdmodel.PDDocument inPdfDoc, String inFileName) static void
setInfos
(org.apache.pdfbox.pdmodel.PDDocument inPdfDoc, String inTitle, String inSubject, String inAuthor) Convenience method: If a parameter is null or "", it is not modified.
-
Field Details
-
DEFAULT_BLOB_XPATH
- See Also:
-
STANDARD_14
-
-
Constructor Details
-
PDFUtils
public PDFUtils()
-
-
Method Details
-
getStandardType1Font
Gets one of the Standard 14 Type 1 Fonts.- Since:
- 11.1
-
hex255ToRGB
-
load
public static org.apache.pdfbox.pdmodel.PDDocument load(Blob inBlob, String inPwd) throws NuxeoException This is just a shortcut. We often load() and openProtection().- Parameters:
inBlob
- Input Blob.inPwd
- Input password.- Throws:
NuxeoException
-
saveInTempFile
public static FileBlob saveInTempFile(org.apache.pdfbox.pdmodel.PDDocument inPdfDoc) throws IOException Create a temporary PDF file and return a FileBlob built from this file.Mainly a utility used just by this plug-in actually.
- Parameters:
inPdfDoc
- Input PDF document.- Returns:
- FileBlob
- Throws:
IOException
-
saveInTempFile
public static FileBlob saveInTempFile(org.apache.pdfbox.pdmodel.PDDocument inPdfDoc, String inFileName) throws IOException - Throws:
IOException
-
setInfos
public static void setInfos(org.apache.pdfbox.pdmodel.PDDocument inPdfDoc, String inTitle, String inSubject, String inAuthor) Convenience method: If a parameter is null or "", it is not modified.- Parameters:
inPdfDoc
- Input PDF document.inTitle
- Title of the PDF document.inSubject
- Subject of the PDF document.inAuthor
- Author of the PDF document.
-
checkXPath
-
closeSilently
public static void closeSilently(org.apache.pdfbox.pdmodel.PDDocument... inPdfDocs)
-