Child pages
  • pdf_output

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Div
styledisplay:none

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.

Div
iddescription



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
addMetaData(data, metaData)
Add metadata to the PDF, like Author
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
combinePDFDocuments(pdf_docs_bytearrays)
Combine multiple PDF docs into one.
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
combineProtectedPDFDocuments(pdf_docs_bytearrays, pdf_docs_passwords)
Combine multiple protected PDF docs into one.
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
convertPDFFormToPDFDocument(pdf_form, field_values)
Convert a PDF form to a PDF document.
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
convertProtectedPDFFormToPDFDocument(pdf_form, pdf_password, field_values)
Convert a protected PDF form to a PDF document.
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
encrypt(data, ownerPassword)
Add password protection and security options to the PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
encrypt(data, ownerPassword, userPassword)
Add password protection and security options to the PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders)
Add password protection and security options to the PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit)
Add password protection and security options to the PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit, metaData)
Add password protection and security options to the PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
endMetaPrintJob()
Ends a previously started meta print job.
Table Row (tr)
Table Cell (td)
PrinterJob
Table Cell (td)
getPDFPrinter()
Returns a PDF printer that can be used in print calls.
Table Row (tr)
Table Cell (td)
PrinterJob
Table Cell (td)
getPDFPrinter(filename)
Returns a PDF printer that can be used in print calls.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
getPagesPrinted()
Returns the number of pages printed by the last print call done in the context of a meta print job.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
getTotalPagesPrinted()
Returns the total number of pages printed in the context of a meta print job.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
insertFontDirectory(path)
Add a directory that should be searched for fonts.
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
numberPages(data)
Add pages numbers to a PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
numberPages(data, fontSize, locationX, locationY, font, hexColor)
Add pages numbers to a PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
overlay(data, forOverlay)
Add some PDF based content over a PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
overlay(data, forOverlay, isOver)
Add some PDF based content over a PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
overlay(data, forOverlay, isOver, pages)
Add some PDF based content over a PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
overlay(data, forOverlay, pages)
Add some PDF based content over a PDF
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
overlayText(data, text)
Add text over every page at a 45 degree angle
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
overlayText(data, text, locationX, locationY, isOver, fontSize, font, hexColor)
Add text over every page at a 45 degree angle
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
startMetaPrintJob()
Used for printing multiple things into the same PDF document.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
startMetaPrintJob(filename)
Used for printing multiple things into the same PDF document.
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
watermark(data, image)
Add an image as a watermark on every page, or the pages specified as a parameter
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
watermark(data, image, locationX, locationY, isOver)
Add an image as a watermark on every page, or the pages specified as a parameter
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
watermark(data, image, locationX, locationY, isOver, pages)
Add an image as a watermark on every page, or the pages specified as a parameter



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idaddMetaData-byteArray_Object
Table Row (tr)
idname
Table Cell (td)

addMetaData

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
addMetaData
Span
(data, metaData)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add metadata to the PDF, like Author
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{Object} metaData - a JavaScript object (Scriptable) that contains the metadata as property/value pairs
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with metaData added
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add metadata to the PDF, like Author
var pdf = plugins.file.showFileOpenDialog();
if (pdf) {
	var data = plugins.file.readFile(pdf);
	var metaData = { Author: 'Servoy' };
	pdfResult = elements.customer_id.addMetaData(data, metaData);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idcombinePDFDocuments-ObjectArray
Table Row (tr)
idname
Table Cell (td)

combinePDFDocuments

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
combinePDFDocuments
Span
(pdf_docs_bytearrays)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Combine multiple PDF docs into one.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object[]} pdf_docs_bytearrays - the array of documents to combine
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
pdf_blob_column = combinePDFDocuments(new Array(pdf_blob1,pdf_blob2,pdf_blob3));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idcombineProtectedPDFDocuments-ObjectArray_ObjectArray
Table Row (tr)
idname
Table Cell (td)

combineProtectedPDFDocuments

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
combineProtectedPDFDocuments
Span
(pdf_docs_bytearrays, pdf_docs_passwords)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Combine multiple protected PDF docs into one.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object[]} pdf_docs_bytearrays - the array of documents to combine
{Object[]} pdf_docs_passwords - an array of passwords to use
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
pdf_blob_column = combineProtectedPDFDocuments(new Array(pdf_blob1,pdf_blob2,pdf_blob3), new Array(pdf_blob1_pass,pdf_blob2_pass,pdf_blob3_pass));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idconvertPDFFormToPDFDocument-byteArray_Object
Table Row (tr)
idname
Table Cell (td)

convertPDFFormToPDFDocument

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
convertPDFFormToPDFDocument
Span
(pdf_form, field_values)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a PDF form to a PDF document.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} pdf_form - the PDF Form to convert
{Object} field_values - the values to use
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var pdfform = plugins.file.readFile('c:/temp/1040a-form.pdf');
//var field_values = plugins.file.readFile('c:/temp/1040a-data.fdf');//read adobe fdf values or
var field_values = new Array()//construct field values
field_values[0] = 'f1-1=John C.J.'
field_values[1] = 'f1-2=Longlasting'
var result_pdf_doc = plugins.pdf_output.convertPDFFormToPDFDocument(pdfform, field_values)
if (result_pdf_doc != null)
{
	plugins.file.writeFile('c:/temp/1040a-flatten.pdf', result_pdf_doc)
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idconvertProtectedPDFFormToPDFDocument-byteArray_String_Object
Table Row (tr)
idname
Table Cell (td)

convertProtectedPDFFormToPDFDocument

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
convertProtectedPDFFormToPDFDocument
Span
(pdf_form, pdf_password, field_values)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a protected PDF form to a PDF document.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} pdf_form - the PDF Form to convert
{String} pdf_password - the password to use
{Object} field_values - the field values to use
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var pdfform = plugins.file.readFile('c:/temp/1040a-form.pdf');
//var field_values = plugins.file.readFile('c:/temp/1040a-data.fdf');//read adobe fdf values or
var field_values = new Array()//construct field values
field_values[0] = 'f1-1=John C.J.'
field_values[1] = 'f1-2=Longlasting'
var result_pdf_doc = plugins.pdf_output.convertProtectedPDFFormToPDFDocument(pdfform, 'pdf_password', field_values)
if (result_pdf_doc != null)
{
	plugins.file.writeFile('c:/temp/1040a-flatten.pdf', result_pdf_doc)
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idencrypt-byteArray_String
Table Row (tr)
idname
Table Cell (td)

encrypt

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
encrypt
Span
(data, ownerPassword)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add password protection and security options to the PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{String} ownerPassword - the owner password
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the encrypted PDF
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add password protection and security options to the PDF
// NOTE: Passwords are case sensitive
var unEncryptedFile = plugins.file.showFileOpenDialog();
if (unEncryptedFile) {
	var data = plugins.file.readFile(unEncryptedFile);
	encryptedResult = elements.customer_id.encrypt(data, 'secretPassword', 'secretUserPassword', false, false, false, false, false, false, false, false, true);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idencrypt-byteArray_String_String
Table Row (tr)
idname
Table Cell (td)

encrypt

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
encrypt
Span
(data, ownerPassword, userPassword)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add password protection and security options to the PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{String} ownerPassword - the owner password
{String} userPassword - the user password
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the encrypted PDF
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add password protection and security options to the PDF
// NOTE: Passwords are case sensitive
var unEncryptedFile = plugins.file.showFileOpenDialog();
if (unEncryptedFile) {
	var data = plugins.file.readFile(unEncryptedFile);
	encryptedResult = elements.customer_id.encrypt(data, 'secretPassword', 'secretUserPassword', false, false, false, false, false, false, false, false, true);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idencrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)

encrypt

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
encrypt
Span
(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add password protection and security options to the PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} 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
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the encrypted PDF
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add password protection and security options to the PDF
// NOTE: Passwords are case sensitive
var unEncryptedFile = plugins.file.showFileOpenDialog();
if (unEncryptedFile) {
	var data = plugins.file.readFile(unEncryptedFile);
	encryptedResult = elements.customer_id.encrypt(data, 'secretPassword', 'secretUserPassword', false, false, false, false, false, false, false, false, true);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idencrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)

encrypt

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
encrypt
Span
(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add password protection and security options to the PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} 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
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the encrypted PDF
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add password protection and security options to the PDF
// NOTE: Passwords are case sensitive
var unEncryptedFile = plugins.file.showFileOpenDialog();
if (unEncryptedFile) {
	var data = plugins.file.readFile(unEncryptedFile);
	encryptedResult = elements.customer_id.encrypt(data, 'secretPassword', 'secretUserPassword', false, false, false, false, false, false, false, false, true);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idencrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object
Table Row (tr)
idname
Table Cell (td)

encrypt

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
encrypt
Span
(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit, metaData)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add password protection and security options to the PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} 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
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the encrypted PDF
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add password protection and security options to the PDF
// NOTE: Passwords are case sensitive
var unEncryptedFile = plugins.file.showFileOpenDialog();
if (unEncryptedFile) {
	var data = plugins.file.readFile(unEncryptedFile);
	encryptedResult = elements.customer_id.encrypt(data, 'secretPassword', 'secretUserPassword', false, false, false, false, false, false, false, false, true);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idendMetaPrintJob
Table Row (tr)
idname
Table Cell (td)

endMetaPrintJob

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
endMetaPrintJob
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Ends a previously started meta print job. For meta print jobs that were stored in memory, not in a file on disk, also returns the content of the generated PDF document.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//to print multiple forms to one pdf document (on file system).
var success = plugins.pdf_output.startMetaPrintJob('c:/temp/out.pdf')
if (success)
{
	forms.form_one.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form one printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
	forms.form_two.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form two printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
}
application.output('total printed pages: ' + plugins.pdf_output.getTotalPagesPrinted());
plugins.pdf_output.endMetaPrintJob()

//to print multiple forms to one pdf document (to store in dataprovider).
var success = plugins.pdf_output.startMetaPrintJob()
if (success)
{
	forms.form_one.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form one printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
	forms.form_two.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form two printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
}
application.output('total printed pages: ' + plugins.pdf_output.getTotalPagesPrinted());
mediaDataProvider = plugins.pdf_output.endMetaPrintJob()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetPDFPrinter
Table Row (tr)
idname
Table Cell (td)

getPDFPrinter

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
PrinterJob
Span
stylefont-weight: bold;
getPDFPrinter
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a PDF printer that can be used in print calls. Returns the last started meta print job.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
PrinterJob
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//to print current record without printdialog to pdf file in temp dir.
controller.print(true,false,plugins.pdf_output.getPDFPrinter());
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetPDFPrinter-String
Table Row (tr)
idname
Table Cell (td)

getPDFPrinter

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
PrinterJob
Span
stylefont-weight: bold;
getPDFPrinter
Span
(filename)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a PDF printer that can be used in print calls. The PDF printer that generates a PDF into the specified file is returned.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} filename - the file name
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
PrinterJob
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//to print current record without printdialog to pdf file in temp dir.
controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf'));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetPagesPrinted
Table Row (tr)
idname
Table Cell (td)

getPagesPrinted

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getPagesPrinted
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the number of pages printed by the last print call done in the context of a meta print job.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//to print multiple forms to one pdf document (on file system).
var success = plugins.pdf_output.startMetaPrintJob('c:/temp/out.pdf')
if (success)
{
	forms.form_one.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form one printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
	forms.form_two.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form two printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
}
application.output('total printed pages: ' + plugins.pdf_output.getTotalPagesPrinted());
plugins.pdf_output.endMetaPrintJob()

//to print multiple forms to one pdf document (to store in dataprovider).
var success = plugins.pdf_output.startMetaPrintJob()
if (success)
{
	forms.form_one.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form one printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
	forms.form_two.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form two printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
}
application.output('total printed pages: ' + plugins.pdf_output.getTotalPagesPrinted());
mediaDataProvider = plugins.pdf_output.endMetaPrintJob()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetTotalPagesPrinted
Table Row (tr)
idname
Table Cell (td)

getTotalPagesPrinted

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getTotalPagesPrinted
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the total number of pages printed in the context of a meta print job. Call this method before ending the meta print job.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//to print multiple forms to one pdf document (on file system).
var success = plugins.pdf_output.startMetaPrintJob('c:/temp/out.pdf')
if (success)
{
	forms.form_one.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form one printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
	forms.form_two.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form two printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
}
application.output('total printed pages: ' + plugins.pdf_output.getTotalPagesPrinted());
plugins.pdf_output.endMetaPrintJob()

//to print multiple forms to one pdf document (to store in dataprovider).
var success = plugins.pdf_output.startMetaPrintJob()
if (success)
{
	forms.form_one.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form one printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
	forms.form_two.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form two printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
}
application.output('total printed pages: ' + plugins.pdf_output.getTotalPagesPrinted());
mediaDataProvider = plugins.pdf_output.endMetaPrintJob()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idinsertFontDirectory-String
Table Row (tr)
idname
Table Cell (td)

insertFontDirectory

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
insertFontDirectory
Span
(path)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add a directory that should be searched for fonts. Call this only in the context of an active meta print job.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} path - the path to use
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//Insert font directories for font embedding.
//You must create an MetaPrintJob before using it.
plugins.pdf_output.insertFontDirectory('c:/Windows/Fonts');
plugins.pdf_output.insertFontDirectory('c:/WinNT/Fonts');
plugins.pdf_output.insertFontDirectory('/Library/Fonts');
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnumberPages-byteArray
Table Row (tr)
idname
Table Cell (td)

numberPages

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
numberPages
Span
(data)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add pages numbers to a PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with numbered pages
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add pages numbers to a PDF
var unNumberedFile = plugins.file.showFileOpenDialog();
if (unNumberedFile) {
	var data = plugins.file.readFile(unNumberedFile);
	pageNumberedPdf = elements.customer_id.numberPages(data, 12, 520, 30, 'Courier', '#ff0033');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnumberPages-byteArray_Number_Number_Number_String_String
Table Row (tr)
idname
Table Cell (td)

numberPages

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
numberPages
Span
(data, fontSize, locationX, locationY, font, hexColor)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add pages numbers to a PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} 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
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with numbered pages
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add pages numbers to a PDF
var unNumberedFile = plugins.file.showFileOpenDialog();
if (unNumberedFile) {
	var data = plugins.file.readFile(unNumberedFile);
	pageNumberedPdf = elements.customer_id.numberPages(data, 12, 520, 30, 'Courier', '#ff0033');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idoverlay-byteArray_byteArray
Table Row (tr)
idname
Table Cell (td)

overlay

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
overlay
Span
(data, forOverlay)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add some PDF based content over a PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{byte[]} forOverlay - a PDF to use as overlay
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with added overlay
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add some PDF based content over a PDF
var pages = new Array();
pages[0] = '1';
pages[1] = '3';
pages[2] = '5';
var input1 = plugins.file.showFileOpenDialog(1,null,false,'pdf',null,'Select source file');
if (input1) {
	var data = plugins.file.readFile(input1);
	var input2 = plugins.file.showFileOpenDialog(1,null,false,'pdf',null,'Select file for overlay');
	if (input2) {
		var data2 = plugins.file.readFile(input2);
		overlayedPdf = elements.customer_id.overlay( data, data2, false, pages );
		//overlayedPdf = elements.customer_id.overlay( data, data2 );
		//overlayedPdf = elements.customer_id.overlay( data, data2, false, null );
		//overlayedPdf = elements.customer_id.overlay( data, data2, pages );
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idoverlay-byteArray_byteArray_Boolean
Table Row (tr)
idname
Table Cell (td)

overlay

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
overlay
Span
(data, forOverlay, isOver)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add some PDF based content over a PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{byte[]} forOverlay - a PDF to use as overlay
{Boolean} isOver - whether the overlay will be put over the content
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with added overlay
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add some PDF based content over a PDF
var pages = new Array();
pages[0] = '1';
pages[1] = '3';
pages[2] = '5';
var input1 = plugins.file.showFileOpenDialog(1,null,false,'pdf',null,'Select source file');
if (input1) {
	var data = plugins.file.readFile(input1);
	var input2 = plugins.file.showFileOpenDialog(1,null,false,'pdf',null,'Select file for overlay');
	if (input2) {
		var data2 = plugins.file.readFile(input2);
		overlayedPdf = elements.customer_id.overlay( data, data2, false, pages );
		//overlayedPdf = elements.customer_id.overlay( data, data2 );
		//overlayedPdf = elements.customer_id.overlay( data, data2, false, null );
		//overlayedPdf = elements.customer_id.overlay( data, data2, pages );
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idoverlay-byteArray_byteArray_Boolean_StringArray
Table Row (tr)
idname
Table Cell (td)

overlay

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
overlay
Span
(data, forOverlay, isOver, pages)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add some PDF based content over a PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{byte[]} forOverlay - a PDF to use as overlay
{Boolean} isOver - whether the overlay will be put over the content
{String[]} pages - an array of page numbers to put the overlay on
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with added overlay
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add some PDF based content over a PDF
var pages = new Array();
pages[0] = '1';
pages[1] = '3';
pages[2] = '5';
var input1 = plugins.file.showFileOpenDialog(1,null,false,'pdf',null,'Select source file');
if (input1) {
	var data = plugins.file.readFile(input1);
	var input2 = plugins.file.showFileOpenDialog(1,null,false,'pdf',null,'Select file for overlay');
	if (input2) {
		var data2 = plugins.file.readFile(input2);
		overlayedPdf = elements.customer_id.overlay( data, data2, false, pages );
		//overlayedPdf = elements.customer_id.overlay( data, data2 );
		//overlayedPdf = elements.customer_id.overlay( data, data2, false, null );
		//overlayedPdf = elements.customer_id.overlay( data, data2, pages );
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idoverlay-byteArray_byteArray_StringArray
Table Row (tr)
idname
Table Cell (td)

overlay

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
overlay
Span
(data, forOverlay, pages)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add some PDF based content over a PDF
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{byte[]} forOverlay - a PDF to use as overlay
{String[]} pages - an array of page numbers to put the overlay on
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with added overlay
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add some PDF based content over a PDF
var pages = new Array();
pages[0] = '1';
pages[1] = '3';
pages[2] = '5';
var input1 = plugins.file.showFileOpenDialog(1,null,false,'pdf',null,'Select source file');
if (input1) {
	var data = plugins.file.readFile(input1);
	var input2 = plugins.file.showFileOpenDialog(1,null,false,'pdf',null,'Select file for overlay');
	if (input2) {
		var data2 = plugins.file.readFile(input2);
		overlayedPdf = elements.customer_id.overlay( data, data2, false, pages );
		//overlayedPdf = elements.customer_id.overlay( data, data2 );
		//overlayedPdf = elements.customer_id.overlay( data, data2, false, null );
		//overlayedPdf = elements.customer_id.overlay( data, data2, pages );
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idoverlayText-byteArray_String
Table Row (tr)
idname
Table Cell (td)

overlayText

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
overlayText
Span
(data, text)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add text over every page at a 45 degree angle
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{String} text - the text to use for the overlay
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with added overlay
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add text over every page at a 45 degree angle\m
var pdf = plugins.file.showFileOpenDialog();
if (pdf) {
	var data = plugins.file.readFile(pdf);
	modifiedPdf = elements.customer_id.overlayText(data, 'DRAFT', 230, 430, true, 32, 'Helvetica', '#33ff33');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idoverlayText-byteArray_String_Number_Number_Boolean_Number_String_String
Table Row (tr)
idname
Table Cell (td)

overlayText

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
overlayText
Span
(data, text, locationX, locationY, isOver, fontSize, font, hexColor)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add text over every page at a 45 degree angle
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} 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
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with added overlay
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add text over every page at a 45 degree angle\m
var pdf = plugins.file.showFileOpenDialog();
if (pdf) {
	var data = plugins.file.readFile(pdf);
	modifiedPdf = elements.customer_id.overlayText(data, 'DRAFT', 230, 430, true, 32, 'Helvetica', '#33ff33');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idstartMetaPrintJob
Table Row (tr)
idname
Table Cell (td)

startMetaPrintJob

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
startMetaPrintJob
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Used for printing multiple things into the same PDF document. Starts a meta print job and all print calls made before ending the meta print job will be done into the same PDF document. The PDF document is stored in memory and can be retrieved when ending the meta print job and can be saved, for example, into a dataprovider.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//to print multiple forms to one pdf document (on file system).
var success = plugins.pdf_output.startMetaPrintJob('c:/temp/out.pdf')
if (success)
{
	forms.form_one.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form one printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
	forms.form_two.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form two printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
}
application.output('total printed pages: ' + plugins.pdf_output.getTotalPagesPrinted());
plugins.pdf_output.endMetaPrintJob()

//to print multiple forms to one pdf document (to store in dataprovider).
var success = plugins.pdf_output.startMetaPrintJob()
if (success)
{
	forms.form_one.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form one printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
	forms.form_two.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form two printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
}
application.output('total printed pages: ' + plugins.pdf_output.getTotalPagesPrinted());
mediaDataProvider = plugins.pdf_output.endMetaPrintJob()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idstartMetaPrintJob-String
Table Row (tr)
idname
Table Cell (td)

startMetaPrintJob

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
startMetaPrintJob
Span
(filename)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Used for printing multiple things into the same PDF document. Starts a meta print job and all print calls made before ending the meta print job will be done into the same PDF document. The PDF document is generated in a File specified by the filename.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} filename - the file name
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//to print multiple forms to one pdf document (on file system).
var success = plugins.pdf_output.startMetaPrintJob('c:/temp/out.pdf')
if (success)
{
	forms.form_one.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form one printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
	forms.form_two.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form two printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
}
application.output('total printed pages: ' + plugins.pdf_output.getTotalPagesPrinted());
plugins.pdf_output.endMetaPrintJob()

//to print multiple forms to one pdf document (to store in dataprovider).
var success = plugins.pdf_output.startMetaPrintJob()
if (success)
{
	forms.form_one.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form one printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
	forms.form_two.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
	application.output('form two printed ' + plugins.pdf_output.getPagesPrinted() + ' pages.');
}
application.output('total printed pages: ' + plugins.pdf_output.getTotalPagesPrinted());
mediaDataProvider = plugins.pdf_output.endMetaPrintJob()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idwatermark-byteArray_String
Table Row (tr)
idname
Table Cell (td)

watermark

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
watermark
Span
(data, image)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add an image as a watermark on every page, or the pages specified as a parameter
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{String} image - the path of an image to use
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with added watermak
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add an image as a watermark on every page, or the pages specified as a parameter.
var pdf = plugins.file.showFileOpenDialog();
if (pdf) {
	var data = plugins.file.readFile(pdf);
	var image = plugins.file.showFileOpenDialog();
	modifiedPdf = elements.customer_id.watermark(data, image);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idwatermark-byteArray_String_Number_Number_Boolean
Table Row (tr)
idname
Table Cell (td)

watermark

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
watermark
Span
(data, image, locationX, locationY, isOver)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add an image as a watermark on every page, or the pages specified as a parameter
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{String} image - the path of an image to use
{Number} locationX - the x location of the image
{Number} locationY - the y location of the image
{Boolean} isOver - whether to put over the content
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with added watermak
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add an image as a watermark on every page, or the pages specified as a parameter.
var pdf = plugins.file.showFileOpenDialog();
if (pdf) {
	var data = plugins.file.readFile(pdf);
	var image = plugins.file.showFileOpenDialog();
	modifiedPdf = elements.customer_id.watermark(data, image);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idwatermark-byteArray_String_Number_Number_Boolean_StringArray
Table Row (tr)
idname
Table Cell (td)

watermark

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
watermark
Span
(data, image, locationX, locationY, isOver, pages)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add an image as a watermark on every page, or the pages specified as a parameter
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{byte[]} data - the PDF
{String} image - the path of an image to use
{Number} locationX - the x location of the image
{Number} locationY - the y location of the image
{Boolean} isOver - whether to put over the content
{String[]} pages - an array of pages where to apply the watermark
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[] - the PDF with added watermak
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Add an image as a watermark on every page, or the pages specified as a parameter.
var pdf = plugins.file.showFileOpenDialog();
if (pdf) {
	var data = plugins.file.readFile(pdf);
	var image = plugins.file.showFileOpenDialog();
	modifiedPdf = elements.customer_id.watermark(data, image);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)