pdf_output
(plugins.pdf_output)
Overview
The PDF Output
plugin allows for creating, manipulating, and enhancing PDF files. It includes functionalities such as combining multiple PDFs, adding overlays or watermarks, numbering pages, and encrypting documents with password protection and custom permissions. The plugin supports working with both regular and protected PDFs and provides options for customizing fonts, colors, and layout elements during PDF manipulations.
For further details on working with PDF files using this plugin, refer to the PDF Output Plugin Guide.
Methods Summarized
Combine multiple PDF docs into one.
Combine multiple protected PDF docs into one.
Convert a PDF form to a PDF document.
Convert a PDF form to a PDF document.
Convert a protected PDF form to a PDF document.
Convert a protected PDF form to a PDF document.
Add password protection and security options to the PDF
Add password protection and security options to the PDF
Add password protection and security options to the PDF
Add password protection and security options to the PDF
Add password protection and security options to the PDF
Returns the number of pages for pdf document.
Create a thumbnail from the provided PDF
Create a thumbnail from the provided PDF
Create a thumbnail from the provided PDF
Add pages numbers to a PDF
Add pages numbers to a PDF
Add some PDF based content over a PDF
Add some PDF based content over a PDF
Add some PDF based content over a PDF
Add some PDF based content over a PDF
Add text over every page at a 45 degree angle
Add text over every page at a 45 degree angle
Add text over every page at a 45 degree angle
Add an image as a watermark on every page, or the pages specified as a parameter
Add an image as a watermark on every page, or the pages specified as a parameter
Add an image as a watermark on every page, or the pages specified as a parameter
Methods Detailed
combinePDFDocuments(pdf_docs_bytearrays)
Combine multiple PDF docs into one. Note: this function may fail when creating large PDF files due to lack of available heap memory. To compensate, please configure the application server with more heap memory via -Xmx parameter.
Parameters
Array pdf_docs_bytearrays the array of documents to combine
Returns: Array
Sample
combineProtectedPDFDocuments(pdf_docs_bytearrays, pdf_docs_passwords)
Combine multiple protected PDF docs into one. Note: this function may fail when creating large PDF files due to lack of available heap memory. To compensate, please configure the application server with more heap memory via -Xmx parameter.
Parameters
Array pdf_docs_bytearrays the array of documents to combine
Array pdf_docs_passwords an array of passwords to use
Returns: Array
Sample
convertPDFFormToPDFDocument(pdf_form, field_values)
Convert a PDF form to a PDF document. By default, all fields of the pdf form will be flattened.
Parameters
Returns: Array
Sample
convertPDFFormToPDFDocument(pdf_form, field_values, partialFlattening)
Convert a PDF form to a PDF document. The PDF form can be have all the fields flattened or just the fields specified by values.
Parameters
Array pdf_form the PDF Form to convert
Object field_values the values to use. If partialFlattening is true, only these fields will be flattened.
Boolean partialFlattening if true, only flatten the fields set as values, the rest remain unchanged
Returns: Array
Sample
convertProtectedPDFFormToPDFDocument(pdf_form, pdf_password, field_values)
Convert a protected PDF form to a PDF document. By default, all fields of the pdf form will be flattened.
Parameters
Array pdf_form the PDF Form to convert
String pdf_password the password to use
Object field_values the field values to use
Returns: Array
Sample
convertProtectedPDFFormToPDFDocument(pdf_form, pdf_password, field_values, partialFlattening)
Convert a protected PDF form to a PDF document. Can specify if all fields or just specified fields will be flattened.
Parameters
Array pdf_form the PDF Form to convert
String pdf_password the password to use
Object field_values the field values to use. If partialFlattening is true, only these fields will be flattened.
Boolean partialFlattening if true, only flatten the fields set as values, the rest remain unchanged
Returns: Array
Sample
encrypt(data, ownerPassword)
Add password protection and security options to the PDF
Parameters
Returns: Array the encrypted PDF
Sample
encrypt(data, ownerPassword, userPassword)
Add password protection and security options to the PDF
Parameters
Returns: Array the encrypted PDF
Sample
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders)
Add password protection and security options to the PDF
Parameters
Array data the PDF
String ownerPassword the owner password
String userPassword the user password
Boolean allowAssembly whether to set the allow assembly permission
Boolean allowCopy whether to set the allow copy permission
Boolean allowDegradedPrinting whether to set the allow degraded printing permission
Boolean allowFillIn whether to set the allow fill in permission
Boolean allowModifyAnnotations whether to set the allow modify annotations permission
Boolean allowModifyContents whether to set the allow modify contents permission
Boolean allowPrinting whether to set the allow printing permission
Boolean allowScreenreaders whether to set the allow screen readers permission
Returns: Array the encrypted PDF
Sample
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit)
Add password protection and security options to the PDF
Parameters
Array data the PDF
String ownerPassword the owner password
String userPassword the user password
Boolean allowAssembly whether to set the allow assembly permission
Boolean allowCopy whether to set the allow copy permission
Boolean allowDegradedPrinting whether to set the allow degraded printing permission
Boolean allowFillIn whether to set the allow fill in permission
Boolean allowModifyAnnotations whether to set the allow modify annotations permission
Boolean allowModifyContents whether to set the allow modify contents permission
Boolean allowPrinting whether to set the allow printing permission
Boolean allowScreenreaders whether to set the allow screen readers permission
Boolean is128bit whether to use 128-bit encryption
Returns: Array the encrypted PDF
Sample
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit, metaData)
Add password protection and security options to the PDF
Parameters
Array data the PDF
String ownerPassword the owner password
String userPassword the user password
Boolean allowAssembly whether to set the allow assembly permission
Boolean allowCopy whether to set the allow copy permission
Boolean allowDegradedPrinting whether to set the allow degraded printing permission
Boolean allowFillIn whether to set the allow fill in permission
Boolean allowModifyAnnotations whether to set the allow modify annotations permission
Boolean allowModifyContents whether to set the allow modify contents permission
Boolean allowPrinting whether to set the allow printing permission
Boolean allowScreenreaders whether to set the allow screen readers permission
Boolean is128bit whether to use 128-bit encryption
Object metaData a JavaScript object (Scriptable) that contains the metadata as property/value pairs
Returns: Array the encrypted PDF
Sample
getNumberOfPages(data)
Returns the number of pages for pdf document.
Parameters
Array data the PDF
Returns: Number the number of pages of the PDF document
Sample
getThumbnailImage(data)
Create a thumbnail from the provided PDF
Parameters
Array data the PDF
Returns: Array the PDF thumbnail as PNG format
Sample
getThumbnailImage(data, pageNumber)
Create a thumbnail from the provided PDF
Parameters
Array data the PDF
Number pageNumber PDF page to get thumbnail of. This parameter is zero based index.
Returns: Array the PDF thumbnail as PNG format
Sample
getThumbnailImage(data, pageNumber, dpi)
Create a thumbnail from the provided PDF
Parameters
Array data the PDF
Number pageNumber PDF page to get thumbnail of. This parameter is zero based index.
Number dpi resolution used to render the thumbnail image
Returns: Array the PDF thumbnail as PNG format
Sample
numberPages(data)
Add pages numbers to a PDF
Parameters
Array data the PDF
Returns: Array the PDF with numbered pages
Sample
numberPages(data, fontSize, locationX, locationY, font, hexColor)
Add pages numbers to a PDF
Parameters
Array data the PDF
Number fontSize the font size to use
Number locationX the x location of the numbers
Number locationY the y location of the numbers
String font the font to use
String hexColor the font color to use
Returns: Array the PDF with numbered pages
Sample
overlay(data, forOverlay)
Add some PDF based content over a PDF
Parameters
Returns: Array the PDF with added overlay
Sample
overlay(data, forOverlay, isOver)
Add some PDF based content over a PDF
Parameters
Array data the PDF
Array forOverlay a PDF to use as overlay
Boolean isOver whether the overlay will be put over the content
Returns: Array the PDF with added overlay
Sample
overlay(data, forOverlay, isOver, pages)
Add some PDF based content over a PDF
Parameters
Array data the PDF
Array forOverlay a PDF to use as overlay
Boolean isOver whether the overlay will be put over the content
Array pages an array of page numbers to put the overlay on
Returns: Array the PDF with added overlay
Sample
overlay(data, forOverlay, pages)
Add some PDF based content over a PDF
Parameters
Array data the PDF
Array forOverlay a PDF to use as overlay
Array pages an array of page numbers to put the overlay on
Returns: Array the PDF with added overlay
Sample
overlayText(data, text)
Add text over every page at a 45 degree angle
Parameters
Returns: Array the PDF with added overlay
Sample
overlayText(data, text, locationX, locationY, isOver, fontSize, font, hexColor)
Add text over every page at a 45 degree angle
Parameters
Array data the PDF
String text the text to use for the overlay
Number locationX the x location of the overlay
Number locationY the y location of the overlay
Boolean isOver whether to put the overlay over the content
Number fontSize the font size to use
String font the font to use
String hexColor the font color to use
Returns: Array the PDF with added overlay
Sample
overlayText(data, text, locationX, locationY, isOver, fontSize, font, hexColor, angle)
Add text over every page at a 45 degree angle
Parameters
Array data the PDF
String text the text to use for the overlay
Number locationX the x location of the overlay
Number locationY the y location of the overlay
Boolean isOver whether to put the overlay over the content
Number fontSize the font size to use
String font the font to use
String hexColor the font color to use
Number angle the angle of the overlay
Returns: Array the PDF with added overlay
Sample
watermark(data, image)
Add an image as a watermark on every page, or the pages specified as a parameter
Parameters
Array data the PDF
Object image the path of an image to use or array of bytes containing actual image
Returns: Array the PDF with added watermak
Sample
watermark(data, image, locationX, locationY, isOver)
Add an image as a watermark on every page, or the pages specified as a parameter
Parameters
Array data the PDF
Object image the path of an image to use or array of bytes containing actual image
Number locationX the x location of the image
Number locationY the y location of the image
Boolean isOver whether to put over the content
Returns: Array the PDF with added watermak
watermark(data, image, locationX, locationY, isOver, pages)
Add an image as a watermark on every page, or the pages specified as a parameter
Parameters
Array data the PDF
Object image the path of an image to use or array of bytes containing actual image
Number locationX the x location of the image
Number locationY the y location of the image
Boolean isOver whether to put over the content
Array pages an array of pages where to apply the watermark
Returns: Array the PDF with added watermak
Last updated