Child pages
  • pdf_output

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rev: 1377846354666
Wiki Markup
{div:style=display: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.\\		\\		Enter additional information related to this 'class' inside the \{div} macro with 'id=description'{div}
{div:id=description}{div}\\ 

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

{table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=addMetaData-byteArray_Object}{tr:id=name}{td}h6.addMetaData{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}addMetaData{span}{span}\(data, metaData){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} data -- the PDF
\{[Object]} metaData -- a JavaScript object (Scriptable) that contains the metadata as property/value pairs
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with metaData added{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=combinePDFDocuments-ObjectArray}{tr:id=name}{td}h6.combinePDFDocuments{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}combinePDFDocuments{span}{span}\(pdf_docs_bytearrays){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]\[]} pdf_docs_bytearrays -- the array of documents to combine
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
pdf_blob_column = combinePDFDocuments(new Array(pdf_blob1,pdf_blob2,pdf_blob3));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=combineProtectedPDFDocuments-ObjectArray_ObjectArray}{tr:id=name}{td}h6.combineProtectedPDFDocuments{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}combineProtectedPDFDocuments{span}{span}\(pdf_docs_bytearrays, pdf_docs_passwords){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]\[]} pdf_docs_bytearrays -- the array of documents to combine
\{[Object]\[]} pdf_docs_passwords -- an array of passwords to use
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
pdf_blob_column = combineProtectedPDFDocuments(new Array(pdf_blob1,pdf_blob2,pdf_blob3), new Array(pdf_blob1_pass,pdf_blob2_pass,pdf_blob3_pass));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=convertPDFFormToPDFDocument-byteArray_Object}{tr:id=name}{td}h6.convertPDFFormToPDFDocument{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}convertPDFFormToPDFDocument{span}{span}\(pdf_form, field_values){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} pdf_form -- the PDF Form to convert
\{[Object]} field_values -- the values to use
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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)
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=convertProtectedPDFFormToPDFDocument-byteArray_String_Object}{tr:id=name}{td}h6.convertProtectedPDFFormToPDFDocument{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}convertProtectedPDFFormToPDFDocument{span}{span}\(pdf_form, pdf_password, field_values){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} pdf_form -- the PDF Form to convert
\{[String]} pdf_password -- the password to use
\{[Object]} field_values -- the field values to use
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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)
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=encrypt-byteArray_String}{tr:id=name}{td}h6.encrypt{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}encrypt{span}{span}\(data, ownerPassword){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} data -- the PDF
\{[String]} ownerPassword -- the owner password
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the encrypted PDF{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=encrypt-byteArray_String_String}{tr:id=name}{td}h6.encrypt{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}encrypt{span}{span}\(data, ownerPassword, userPassword){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} data -- the PDF
\{[String]} ownerPassword -- the owner password
\{[String]} userPassword -- the user password
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the encrypted PDF{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean}{tr:id=name}{td}h6.encrypt{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}encrypt{span}{span}\(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{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
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the encrypted PDF{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean}{tr:id=name}{td}h6.encrypt{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}encrypt{span}{span}\(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{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
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the encrypted PDF{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object}{tr:id=name}{td}h6.encrypt{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}encrypt{span}{span}\(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit, metaData){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{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
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the encrypted PDF{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=endMetaPrintJob}{tr:id=name}{td}h6.endMetaPrintJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}endMetaPrintJob{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
//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()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPDFPrinter}{tr:id=name}{td}h6.getPDFPrinter{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[PrinterJob]{span}{span:style=font-weight: bold;}getPDFPrinter{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[PrinterJob]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
//to print current record without printdialog to pdf file in temp dir.
controller.print(true,false,plugins.pdf_output.getPDFPrinter());
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPDFPrinter-String}{tr:id=name}{td}h6.getPDFPrinter{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[PrinterJob]{span}{span:style=font-weight: bold;}getPDFPrinter{span}{span}\(filename){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} filename -- the file name
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[PrinterJob]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
//to print current record without printdialog to pdf file in temp dir.
controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf'));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPagesPrinted}{tr:id=name}{td}h6.getPagesPrinted{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getPagesPrinted{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
//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()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getTotalPagesPrinted}{tr:id=name}{td}h6.getTotalPagesPrinted{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getTotalPagesPrinted{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
//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()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=insertFontDirectory-String}{tr:id=name}{td}h6.insertFontDirectory{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}insertFontDirectory{span}{span}\(path){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} path -- the path to use
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
//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');
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=numberPages-byteArray}{tr:id=name}{td}h6.numberPages{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}numberPages{span}{span}\(data){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} data -- the PDF
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with numbered pages{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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');
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=numberPages-byteArray_Number_Number_Number_String_String}{tr:id=name}{td}h6.numberPages{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}numberPages{span}{span}\(data, fontSize, locationX, locationY, font, hexColor){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{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
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with numbered pages{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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');
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlay-byteArray_byteArray}{tr:id=name}{td}h6.overlay{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}overlay{span}{span}\(data, forOverlay){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} data -- the PDF
\{byte[]} forOverlay -- a PDF to use as overlay
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with added overlay{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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 );
	}
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlay-byteArray_byteArray_Boolean}{tr:id=name}{td}h6.overlay{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}overlay{span}{span}\(data, forOverlay, isOver){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} data -- the PDF
\{byte[]} forOverlay -- a PDF to use as overlay
\{[Boolean]} isOver -- whether the overlay will be put over the content
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with added overlay{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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 );
	}
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlay-byteArray_byteArray_Boolean_StringArray}{tr:id=name}{td}h6.overlay{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}overlay{span}{span}\(data, forOverlay, isOver, pages){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{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
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with added overlay{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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 );
	}
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlay-byteArray_byteArray_StringArray}{tr:id=name}{td}h6.overlay{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}overlay{span}{span}\(data, forOverlay, pages){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} data -- the PDF
\{byte[]} forOverlay -- a PDF to use as overlay
\{[String]\[]} pages -- an array of page numbers to put the overlay on
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with added overlay{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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 );
	}
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlayText-byteArray_String}{tr:id=name}{td}h6.overlayText{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}overlayText{span}{span}\(data, text){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} data -- the PDF
\{[String]} text -- the text to use for the overlay
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with added overlay{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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');
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlayText-byteArray_String_Number_Number_Boolean_Number_String_String}{tr:id=name}{td}h6.overlayText{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}overlayText{span}{span}\(data, text, locationX, locationY, isOver, fontSize, font, hexColor){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{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
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with added overlay{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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');
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=startMetaPrintJob}{tr:id=name}{td}h6.startMetaPrintJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}startMetaPrintJob{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
//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()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=startMetaPrintJob-String}{tr:id=name}{td}h6.startMetaPrintJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}startMetaPrintJob{span}{span}\(filename){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} filename -- the file name
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
//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()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=watermark-byteArray_String}{tr:id=name}{td}h6.watermark{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}watermark{span}{span}\(data, image){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{byte[]} data -- the PDF
\{[String]} image -- the path of an image to use
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with added watermak{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=watermark-byteArray_String_Number_Number_Boolean}{tr:id=name}{td}h6.watermark{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}watermark{span}{span}\(data, image, locationX, locationY, isOver){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{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
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with added watermak{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=watermark-byteArray_String_Number_Number_Boolean_StringArray}{tr:id=name}{td}h6.watermark{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}watermark{span}{span}\(data, image, locationX, locationY, isOver, pages){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{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
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[] -- the PDF with added watermak{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}