Child pages
  • pdf_output

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px|width=80px}{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}java.awt.print.PrinterJob[PrinterJob]{td}{td}[#getPDFPrinter]\()
Returns a PDF printer that can be used in print calls.{td}{tr}{tbody}{tbody}{tr}{td}java.awt.print.PrinterJob[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|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=addMetaData|class=node}{tr:id=name}{td}h6.addMetaData{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}addMetaData{span}{span:id=iets|style=float: left;}\(data, metaData){span}{td}{tr}{tr:id=des}{td}{sub-section:addMetaData_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:addMetaData_des|trigger=none|class=sIndent}Add metadata to the PDF, like Author{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMetaData_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:addMetaData_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMetaData_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:addMetaData_prs|trigger=none|class=sIndent}\{byte[]} data -- the PDF
\{[Object]} metaData -- a JavaScript object (Scriptable) that contains the metadata as property/value pairs
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMetaData_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:addMetaData_ret|trigger=none|class=sIndent}byte[] -- the PDF with metaData added{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMetaData_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:addMetaData_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMetaData_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:addMetaData_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMetaData_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:addMetaData_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=combinePDFDocuments|class=node}{tr:id=name}{td}h6.combinePDFDocuments{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}combinePDFDocuments{span}{span:id=iets|style=float: left;}\(pdf_docs_bytearrays){span}{td}{tr}{tr:id=des}{td}{sub-section:combinePDFDocuments_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:combinePDFDocuments_des|trigger=none|class=sIndent}Combine multiple PDF docs into one.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:combinePDFDocuments_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:combinePDFDocuments_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:combinePDFDocuments_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:combinePDFDocuments_prs|trigger=none|class=sIndent}\{[Object]\[]} pdf_docs_bytearrays -- the array of documents to combine
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:combinePDFDocuments_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:combinePDFDocuments_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:combinePDFDocuments_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:combinePDFDocuments_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:combinePDFDocuments_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:combinePDFDocuments_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:combinePDFDocuments_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:combinePDFDocuments_sam|trigger=none}{code:language=javascript}
pdf_blob_column = combinePDFDocuments(new Array(pdf_blob1,pdf_blob2,pdf_blob3));
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=combineProtectedPDFDocuments|class=node}{tr:id=name}{td}h6.combineProtectedPDFDocuments{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}combineProtectedPDFDocuments{span}{span:id=iets|style=float: left;}\(pdf_docs_bytearrays, pdf_docs_passwords){span}{td}{tr}{tr:id=des}{td}{sub-section:combineProtectedPDFDocuments_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:combineProtectedPDFDocuments_des|trigger=none|class=sIndent}Combine multiple protected PDF docs into one.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:combineProtectedPDFDocuments_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:combineProtectedPDFDocuments_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:combineProtectedPDFDocuments_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:combineProtectedPDFDocuments_prs|trigger=none|class=sIndent}\{[Object]\[]} pdf_docs_bytearrays -- the array of documents to combine
\{[Object]\[]} pdf_docs_passwords -- an array of passwords to use
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:combineProtectedPDFDocuments_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:combineProtectedPDFDocuments_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:combineProtectedPDFDocuments_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:combineProtectedPDFDocuments_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:combineProtectedPDFDocuments_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:combineProtectedPDFDocuments_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:combineProtectedPDFDocuments_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:combineProtectedPDFDocuments_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=convertPDFFormToPDFDocument|class=node}{tr:id=name}{td}h6.convertPDFFormToPDFDocument{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}convertPDFFormToPDFDocument{span}{span:id=iets|style=float: left;}\(pdf_form, field_values){span}{td}{tr}{tr:id=des}{td}{sub-section:convertPDFFormToPDFDocument_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:convertPDFFormToPDFDocument_des|trigger=none|class=sIndent}Convert a PDF form to a PDF document.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:convertPDFFormToPDFDocument_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:convertPDFFormToPDFDocument_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:convertPDFFormToPDFDocument_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:convertPDFFormToPDFDocument_prs|trigger=none|class=sIndent}\{byte[]} pdf_form -- the PDF Form to convert
\{[Object]} field_values -- the values to use
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:convertPDFFormToPDFDocument_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:convertPDFFormToPDFDocument_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:convertPDFFormToPDFDocument_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:convertPDFFormToPDFDocument_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:convertPDFFormToPDFDocument_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:convertPDFFormToPDFDocument_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:convertPDFFormToPDFDocument_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:convertPDFFormToPDFDocument_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=convertProtectedPDFFormToPDFDocument|class=node}{tr:id=name}{td}h6.convertProtectedPDFFormToPDFDocument{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}convertProtectedPDFFormToPDFDocument{span}{span:id=iets|style=float: left;}\(pdf_form, pdf_password, field_values){span}{td}{tr}{tr:id=des}{td}{sub-section:convertProtectedPDFFormToPDFDocument_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:convertProtectedPDFFormToPDFDocument_des|trigger=none|class=sIndent}Convert a protected PDF form to a PDF document.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:convertProtectedPDFFormToPDFDocument_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:convertProtectedPDFFormToPDFDocument_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:convertProtectedPDFFormToPDFDocument_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:convertProtectedPDFFormToPDFDocument_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:convertProtectedPDFFormToPDFDocument_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:convertProtectedPDFFormToPDFDocument_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:convertProtectedPDFFormToPDFDocument_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:convertProtectedPDFFormToPDFDocument_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:convertProtectedPDFFormToPDFDocument_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:convertProtectedPDFFormToPDFDocument_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:convertProtectedPDFFormToPDFDocument_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:convertProtectedPDFFormToPDFDocument_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=encrypt-byteArray_String|class=node}{tr:id=name}{td}h6.encrypt{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}encrypt{span}{span:id=iets|style=float: left;}\(data, ownerPassword){span}{td}{tr}{tr:id=des}{td}{sub-section:encrypt-byteArray_String_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_des|trigger=none|class=sIndent}Add password protection and security options to the PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:encrypt-byteArray_String_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:encrypt-byteArray_String_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_prs|trigger=none|class=sIndent}\{byte[]} data -- the PDF
\{[String]} ownerPassword -- the owner password
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:encrypt-byteArray_String_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_ret|trigger=none|class=sIndent}byte[] -- the encrypted PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:encrypt-byteArray_String_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:encrypt-byteArray_String_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:encrypt-byteArray_String_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=encrypt-byteArray_String_String|class=node}{tr:id=name}{td}h6.encrypt{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}encrypt{span}{span:id=iets|style=float: left;}\(data, ownerPassword, userPassword){span}{td}{tr}{tr:id=des}{td}{sub-section:encrypt-byteArray_String_String_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_des|trigger=none|class=sIndent}Add password protection and security options to the PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:encrypt-byteArray_String_String_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:encrypt-byteArray_String_String_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_prs|trigger=none|class=sIndent}\{byte[]} data -- the PDF
\{[String]} ownerPassword -- the owner password
\{[String]} userPassword -- the user password
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:encrypt-byteArray_String_String_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_ret|trigger=none|class=sIndent}byte[] -- the encrypted PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:encrypt-byteArray_String_String_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:encrypt-byteArray_String_String_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:encrypt-byteArray_String_String_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean|class=node}{tr:id=name}{td}h6.encrypt{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}encrypt{span}{span:id=iets|style=float: left;}\(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders){span}{td}{tr}{tr:id=des}{td}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_des|trigger=none|class=sIndent}Add password protection and security options to the PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_ret|trigger=none|class=sIndent}byte[] -- the encrypted PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_sam|trigger=none}{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}{sub-section}{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|class=node}{tr:id=name}{td}h6.encrypt{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}encrypt{span}{span:id=iets|style=float: left;}\(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit){span}{td}{tr}{tr:id=des}{td}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_des|trigger=none|class=sIndent}Add password protection and security options to the PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_ret|trigger=none|class=sIndent}byte[] -- the encrypted PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_sam|trigger=none}{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}{sub-section}{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|class=node}{tr:id=name}{td}h6.encrypt{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}encrypt{span}{span:id=iets|style=float: left;}\(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit, metaData){span}{td}{tr}{tr:id=des}{td}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_des|trigger=none|class=sIndent}Add password protection and security options to the PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_ret|trigger=none|class=sIndent}byte[] -- the encrypted PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:encrypt-byteArray_String_String_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Boolean_Object_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=endMetaPrintJob|class=node}{tr:id=name}{td}h6.endMetaPrintJob{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}endMetaPrintJob{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:endMetaPrintJob_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:endMetaPrintJob_des|trigger=none|class=sIndent}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.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:endMetaPrintJob_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:endMetaPrintJob_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:endMetaPrintJob_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:endMetaPrintJob_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:endMetaPrintJob_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:endMetaPrintJob_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:endMetaPrintJob_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:endMetaPrintJob_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:endMetaPrintJob_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:endMetaPrintJob_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:endMetaPrintJob_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:endMetaPrintJob_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPDFPrinter|class=node}{tr:id=name}{td}h6.getPDFPrinter{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}java.awt.print.PrinterJob[PrinterJob]{span}{span:id=iets|style=float: left; font-weight: bold;}getPDFPrinter{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getPDFPrinter_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPDFPrinter_des|trigger=none|class=sIndent}Returns a PDF printer that can be used in print calls. Returns the last started meta print job.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getPDFPrinter_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPDFPrinter_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getPDFPrinter_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPDFPrinter_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getPDFPrinter_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPDFPrinter_ret|trigger=none|class=sIndent}java.awt.print.PrinterJob[PrinterJob]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getPDFPrinter_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getPDFPrinter_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getPDFPrinter_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getPDFPrinter_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getPDFPrinter_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getPDFPrinter_sam|trigger=none}{code:language=javascript}
//to print current record without printdialog to pdf file in temp dir.
controller.print(true,false,plugins.pdf_output.getPDFPrinter());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPDFPrinter-String|class=node}{tr:id=name}{td}h6.getPDFPrinter{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}java.awt.print.PrinterJob[PrinterJob]{span}{span:id=iets|style=float: left; font-weight: bold;}getPDFPrinter{span}{span:id=iets|style=float: left;}\(filename){span}{td}{tr}{tr:id=des}{td}{sub-section:getPDFPrinter-String_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPDFPrinter-String_des|trigger=none|class=sIndent}Returns a PDF printer that can be used in print calls. The PDF printer that generates a PDF into the specified file is returned.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getPDFPrinter-String_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPDFPrinter-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getPDFPrinter-String_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPDFPrinter-String_prs|trigger=none|class=sIndent}\{[String]} filename -- the file name
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getPDFPrinter-String_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPDFPrinter-String_ret|trigger=none|class=sIndent}java.awt.print.PrinterJob[PrinterJob]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getPDFPrinter-String_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getPDFPrinter-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getPDFPrinter-String_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getPDFPrinter-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getPDFPrinter-String_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getPDFPrinter-String_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPagesPrinted|class=node}{tr:id=name}{td}h6.getPagesPrinted{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getPagesPrinted{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getPagesPrinted_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPagesPrinted_des|trigger=none|class=sIndent}Returns the number of pages printed by the last print call done in the context of a meta print job.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getPagesPrinted_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPagesPrinted_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getPagesPrinted_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPagesPrinted_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getPagesPrinted_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:getPagesPrinted_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getPagesPrinted_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getPagesPrinted_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getPagesPrinted_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getPagesPrinted_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getPagesPrinted_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getPagesPrinted_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getTotalPagesPrinted|class=node}{tr:id=name}{td}h6.getTotalPagesPrinted{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getTotalPagesPrinted{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getTotalPagesPrinted_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:getTotalPagesPrinted_des|trigger=none|class=sIndent}Returns the total number of pages printed in the context of a meta print job. Call this method before ending the meta print job.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getTotalPagesPrinted_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:getTotalPagesPrinted_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getTotalPagesPrinted_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:getTotalPagesPrinted_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getTotalPagesPrinted_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:getTotalPagesPrinted_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getTotalPagesPrinted_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getTotalPagesPrinted_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getTotalPagesPrinted_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getTotalPagesPrinted_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getTotalPagesPrinted_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:getTotalPagesPrinted_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=insertFontDirectory|class=node}{tr:id=name}{td}h6.insertFontDirectory{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}insertFontDirectory{span}{span:id=iets|style=float: left;}\(path){span}{td}{tr}{tr:id=des}{td}{sub-section:insertFontDirectory_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:insertFontDirectory_des|trigger=none|class=sIndent}Add a directory that should be searched for fonts. Call this only in the context of an active meta print job.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:insertFontDirectory_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:insertFontDirectory_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:insertFontDirectory_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:insertFontDirectory_prs|trigger=none|class=sIndent}\{[String]} path -- the path to use
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:insertFontDirectory_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:insertFontDirectory_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:insertFontDirectory_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:insertFontDirectory_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:insertFontDirectory_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:insertFontDirectory_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:insertFontDirectory_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:insertFontDirectory_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=numberPages-byteArray|class=node}{tr:id=name}{td}h6.numberPages{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}numberPages{span}{span:id=iets|style=float: left;}\(data){span}{td}{tr}{tr:id=des}{td}{sub-section:numberPages-byteArray_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:numberPages-byteArray_des|trigger=none|class=sIndent}Add pages numbers to a PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:numberPages-byteArray_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:numberPages-byteArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:numberPages-byteArray_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:numberPages-byteArray_prs|trigger=none|class=sIndent}\{byte[]} data -- the PDF
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:numberPages-byteArray_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:numberPages-byteArray_ret|trigger=none|class=sIndent}byte[] -- the PDF with numbered pages{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:numberPages-byteArray_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:numberPages-byteArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:numberPages-byteArray_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:numberPages-byteArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:numberPages-byteArray_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:numberPages-byteArray_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=numberPages-byteArray_Number_Number_Number_String_String|class=node}{tr:id=name}{td}h6.numberPages{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}numberPages{span}{span:id=iets|style=float: left;}\(data, fontSize, locationX, locationY, font, hexColor){span}{td}{tr}{tr:id=des}{td}{sub-section:numberPages-byteArray_Number_Number_Number_String_String_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:numberPages-byteArray_Number_Number_Number_String_String_des|trigger=none|class=sIndent}Add pages numbers to a PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:numberPages-byteArray_Number_Number_Number_String_String_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:numberPages-byteArray_Number_Number_Number_String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:numberPages-byteArray_Number_Number_Number_String_String_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:numberPages-byteArray_Number_Number_Number_String_String_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:numberPages-byteArray_Number_Number_Number_String_String_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:numberPages-byteArray_Number_Number_Number_String_String_ret|trigger=none|class=sIndent}byte[] -- the PDF with numbered pages{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:numberPages-byteArray_Number_Number_Number_String_String_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:numberPages-byteArray_Number_Number_Number_String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:numberPages-byteArray_Number_Number_Number_String_String_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:numberPages-byteArray_Number_Number_Number_String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:numberPages-byteArray_Number_Number_Number_String_String_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:numberPages-byteArray_Number_Number_Number_String_String_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlay-byteArray_byteArray|class=node}{tr:id=name}{td}h6.overlay{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}overlay{span}{span:id=iets|style=float: left;}\(data, forOverlay){span}{td}{tr}{tr:id=des}{td}{sub-section:overlay-byteArray_byteArray_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_des|trigger=none|class=sIndent}Add some PDF based content over a PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:overlay-byteArray_byteArray_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:overlay-byteArray_byteArray_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_prs|trigger=none|class=sIndent}\{byte[]} data -- the PDF
\{byte[]} forOverlay -- a PDF to use as overlay
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:overlay-byteArray_byteArray_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_ret|trigger=none|class=sIndent}byte[] -- the PDF with added overlay{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:overlay-byteArray_byteArray_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:overlay-byteArray_byteArray_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:overlay-byteArray_byteArray_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlay-byteArray_byteArray_Boolean|class=node}{tr:id=name}{td}h6.overlay{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}overlay{span}{span:id=iets|style=float: left;}\(data, forOverlay, isOver){span}{td}{tr}{tr:id=des}{td}{sub-section:overlay-byteArray_byteArray_Boolean_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_Boolean_des|trigger=none|class=sIndent}Add some PDF based content over a PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:overlay-byteArray_byteArray_Boolean_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:overlay-byteArray_byteArray_Boolean_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_Boolean_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:overlay-byteArray_byteArray_Boolean_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_Boolean_ret|trigger=none|class=sIndent}byte[] -- the PDF with added overlay{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:overlay-byteArray_byteArray_Boolean_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:overlay-byteArray_byteArray_Boolean_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:overlay-byteArray_byteArray_Boolean_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_Boolean_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlay-byteArray_byteArray_Boolean_StringArray|class=node}{tr:id=name}{td}h6.overlay{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}overlay{span}{span:id=iets|style=float: left;}\(data, forOverlay, isOver, pages){span}{td}{tr}{tr:id=des}{td}{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_des|trigger=none|class=sIndent}Add some PDF based content over a PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_prs|text=|trigger=button|text=}{sub-section}{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_ret|trigger=none|class=sIndent}byte[] -- the PDF with added overlay{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_Boolean_StringArray_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlay-byteArray_byteArray_StringArray|class=node}{tr:id=name}{td}h6.overlay{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}overlay{span}{span:id=iets|style=float: left;}\(data, forOverlay, pages){span}{td}{tr}{tr:id=des}{td}{sub-section:overlay-byteArray_byteArray_StringArray_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_StringArray_des|trigger=none|class=sIndent}Add some PDF based content over a PDF{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:overlay-byteArray_byteArray_StringArray_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_StringArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:overlay-byteArray_byteArray_StringArray_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_StringArray_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:overlay-byteArray_byteArray_StringArray_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlay-byteArray_byteArray_StringArray_ret|trigger=none|class=sIndent}byte[] -- the PDF with added overlay{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:overlay-byteArray_byteArray_StringArray_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_StringArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:overlay-byteArray_byteArray_StringArray_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_StringArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:overlay-byteArray_byteArray_StringArray_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlay-byteArray_byteArray_StringArray_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlayText-byteArray_String|class=node}{tr:id=name}{td}h6.overlayText{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}overlayText{span}{span:id=iets|style=float: left;}\(data, text){span}{td}{tr}{tr:id=des}{td}{sub-section:overlayText-byteArray_String_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlayText-byteArray_String_des|trigger=none|class=sIndent}Add text over every page at a 45 degree angle{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:overlayText-byteArray_String_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlayText-byteArray_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:overlayText-byteArray_String_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlayText-byteArray_String_prs|trigger=none|class=sIndent}\{byte[]} data -- the PDF
\{[String]} text -- the text to use for the overlay
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:overlayText-byteArray_String_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlayText-byteArray_String_ret|trigger=none|class=sIndent}byte[] -- the PDF with added overlay{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:overlayText-byteArray_String_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlayText-byteArray_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:overlayText-byteArray_String_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlayText-byteArray_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:overlayText-byteArray_String_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlayText-byteArray_String_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=overlayText-byteArray_String_Number_Number_Boolean_Number_String_String|class=node}{tr:id=name}{td}h6.overlayText{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}overlayText{span}{span:id=iets|style=float: left;}\(data, text, locationX, locationY, isOver, fontSize, font, hexColor){span}{td}{tr}{tr:id=des}{td}{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_des|trigger=none|class=sIndent}Add text over every page at a 45 degree angle{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_ret|trigger=none|class=sIndent}byte[] -- the PDF with added overlay{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:overlayText-byteArray_String_Number_Number_Boolean_Number_String_String_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=startMetaPrintJob|class=node}{tr:id=name}{td}h6.startMetaPrintJob{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}startMetaPrintJob{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:startMetaPrintJob_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:startMetaPrintJob_des|trigger=none|class=sIndent}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.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:startMetaPrintJob_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:startMetaPrintJob_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:startMetaPrintJob_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:startMetaPrintJob_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:startMetaPrintJob_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:startMetaPrintJob_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:startMetaPrintJob_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:startMetaPrintJob_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:startMetaPrintJob_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:startMetaPrintJob_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:startMetaPrintJob_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:startMetaPrintJob_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=startMetaPrintJob-String|class=node}{tr:id=name}{td}h6.startMetaPrintJob{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}startMetaPrintJob{span}{span:id=iets|style=float: left;}\(filename){span}{td}{tr}{tr:id=des}{td}{sub-section:startMetaPrintJob-String_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:startMetaPrintJob-String_des|trigger=none|class=sIndent}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.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:startMetaPrintJob-String_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:startMetaPrintJob-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:startMetaPrintJob-String_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:startMetaPrintJob-String_prs|trigger=none|class=sIndent}\{[String]} filename -- the file name
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:startMetaPrintJob-String_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:startMetaPrintJob-String_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:startMetaPrintJob-String_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:startMetaPrintJob-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:startMetaPrintJob-String_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:startMetaPrintJob-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:startMetaPrintJob-String_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:startMetaPrintJob-String_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=watermark-byteArray_String|class=node}{tr:id=name}{td}h6.watermark{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}watermark{span}{span:id=iets|style=float: left;}\(data, image){span}{td}{tr}{tr:id=des}{td}{sub-section:watermark-byteArray_String_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_des|trigger=none|class=sIndent}Add an image as a watermark on every page, or the pages specified as a parameter{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:watermark-byteArray_String_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:watermark-byteArray_String_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_prs|trigger=none|class=sIndent}\{byte[]} data -- the PDF
\{[String]} image -- the path of an image to use
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:watermark-byteArray_String_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_ret|trigger=none|class=sIndent}byte[] -- the PDF with added watermak{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:watermark-byteArray_String_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:watermark-byteArray_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:watermark-byteArray_String_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:watermark-byteArray_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:watermark-byteArray_String_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:watermark-byteArray_String_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=watermark-byteArray_String_Number_Number_Boolean|class=node}{tr:id=name}{td}h6.watermark{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}watermark{span}{span:id=iets|style=float: left;}\(data, image, locationX, locationY, isOver){span}{td}{tr}{tr:id=des}{td}{sub-section:watermark-byteArray_String_Number_Number_Boolean_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_Number_Number_Boolean_des|trigger=none|class=sIndent}Add an image as a watermark on every page, or the pages specified as a parameter{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_Number_Number_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_Number_Number_Boolean_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_Number_Number_Boolean_ret|trigger=none|class=sIndent}byte[] -- the PDF with added watermak{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:watermark-byteArray_String_Number_Number_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:watermark-byteArray_String_Number_Number_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:watermark-byteArray_String_Number_Number_Boolean_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=watermark-byteArray_String_Number_Number_Boolean_StringArray|class=node}{tr:id=name}{td}h6.watermark{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}watermark{span}{span:id=iets|style=float: left;}\(data, image, locationX, locationY, isOver, pages){span}{td}{tr}{tr:id=des}{td}{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_des|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_des|trigger=none|class=sIndent}Add an image as a watermark on every page, or the pages specified as a parameter{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_snc|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_prs|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_prs|trigger=none|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
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_ret|texttrigger=button|triggertext=button}{sub-section}{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_ret|trigger=none|class=sIndent}byte[] -- the PDF with added watermak{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_see|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_link|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_sam|texttrigger=button|triggertext=button}{sub-section}{div:class=sIndent}{sub-section:watermark-byteArray_String_Number_Number_Boolean_StringArray_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}