{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:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}byte[]{td}{td}[#combinePDFDocuments]\(array)
Combine muliple PDF docs into one.{td}{tr}{tbody}{tbody}{tr}{td}byte[]{td}{td}[#combineProtectedPDFDocuments]\(array, passwords)
Combine muliple protected PDF docs into one.{td}{tr}{tbody}{tbody}{tr}{td}byte[]{td}{td}[#convertPDFFormToPDFDocument]\(pdf_form, name_value_array)
Convert a PDF form to a PDF document.{td}{tr}{tbody}{tbody}{tr}{td}byte[]{td}{td}[#convertProtectedPDFFormToPDFDocument]\(pdf_form, pdf_password, name_value_array)
Convert a protected PDF form to a PDF document.{td}{tr}{tbody}{tbody}{tr}{td}byte[]{td}{td}[#endMetaPrintJob]\()
Ends a previously started meta print job.{td}{tr}{tbody}{tbody}{tr}{td}{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]\()
Add a directory that should be searched for fonts.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#startMetaPrintJob]\()
Used for printing multiple things into the same PDF document.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=58293E4F-B585-44F5-81B4-C4431B4DE9E6}{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;}\(array){span}{td}{tr}{tr:id=des}{td}{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_des|text=|trigger=button}{sub-section}{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_des|trigger=none|class=sIndent}Combine muliple PDF docs into one.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_prs|trigger=none}array
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_ret|text=|trigger=button}{sub-section}{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_see|text=|trigger=button}{sub-section}{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_see|text=|trigger=button}{sub-section}{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_sam|text=|trigger=button}{sub-section}{sub-section:58293E4F-B585-44F5-81B4-C4431B4DE9E6_sam|class=sIndent|trigger=none}{code:language=javascript}
//combine muliple pdf docs into one.
pdf_blob_column = combinePDFDocuments(new Array(pdf_blob1,pdf_blob2,pdf_blob3));
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A2E6B081-C446-4DC5-A7D8-1175DDBB1598}{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;}\(array, passwords){span}{td}{tr}{tr:id=des}{td}{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_des|text=|trigger=button}{sub-section}{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_des|trigger=none|class=sIndent}Combine muliple protected PDF docs into one.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_prs|trigger=none}array
passwords
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_ret|text=|trigger=button}{sub-section}{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_see|text=|trigger=button}{sub-section}{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_see|text=|trigger=button}{sub-section}{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_sam|text=|trigger=button}{sub-section}{sub-section:A2E6B081-C446-4DC5-A7D8-1175DDBB1598_sam|class=sIndent|trigger=none}{code:language=javascript}
//combine muliple protected pdf docs into one.
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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=97C9CD14-6DD9-4563-B062-44C8CF723701}{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, name_value_array){span}{td}{tr}{tr:id=des}{td}{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_des|text=|trigger=button}{sub-section}{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_des|trigger=none|class=sIndent}Convert a PDF form to a PDF document.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_prs|trigger=none}pdf_form
name_value_array
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_ret|text=|trigger=button}{sub-section}{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_see|text=|trigger=button}{sub-section}{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_see|text=|trigger=button}{sub-section}{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_sam|text=|trigger=button}{sub-section}{sub-section:97C9CD14-6DD9-4563-B062-44C8CF723701_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6}{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, name_value_array){span}{td}{tr}{tr:id=des}{td}{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_des|text=|trigger=button}{sub-section}{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_des|trigger=none|class=sIndent}Convert a protected PDF form to a PDF document.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_prs|trigger=none}pdf_form
pdf_password
name_value_array
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_ret|text=|trigger=button}{sub-section}{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_see|text=|trigger=button}{sub-section}{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_see|text=|trigger=button}{sub-section}{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_sam|text=|trigger=button}{sub-section}{sub-section:05A4ACE5-8443-4A4D-B0D2-1A6DA9FE28F6_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E}{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:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_des|text=|trigger=button}{sub-section}{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_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=prs}{td}*Parameters*\\{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_ret|text=|trigger=button}{sub-section}{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_see|text=|trigger=button}{sub-section}{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_see|text=|trigger=button}{sub-section}{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_sam|text=|trigger=button}{sub-section}{sub-section:FBE1A5CC-45DB-4E41-99D4-FD79EF20B41E_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=9153E089-A05B-470E-860C-75FA10465449}{tr:id=name}{td}h6.getPDFPrinter{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}{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:9153E089-A05B-470E-860C-75FA10465449_des|text=|trigger=button}{sub-section}{sub-section:9153E089-A05B-470E-860C-75FA10465449_des|trigger=none|class=sIndent}Returns a PDF printer that can be used in print calls. If a file name is provided, then a PDF printer that generates a PDF into the specified file is returned. If no argument is provided, then the PDF printer corresponding to the last started meta print job is returned.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:9153E089-A05B-470E-860C-75FA10465449_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9153E089-A05B-470E-860C-75FA10465449_prs|trigger=none}filename
{sub-section}{div}{td}{tr}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:9153E089-A05B-470E-860C-75FA10465449_ret|text=|trigger=button}{sub-section}{sub-section:9153E089-A05B-470E-860C-75FA10465449_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9153E089-A05B-470E-860C-75FA10465449_see|text=|trigger=button}{sub-section}{sub-section:9153E089-A05B-470E-860C-75FA10465449_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9153E089-A05B-470E-860C-75FA10465449_see|text=|trigger=button}{sub-section}{sub-section:9153E089-A05B-470E-860C-75FA10465449_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9153E089-A05B-470E-860C-75FA10465449_sam|text=|trigger=button}{sub-section}{sub-section:9153E089-A05B-470E-860C-75FA10465449_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=19850770-CC8B-4253-A208-3AD23FCBB06E}{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:19850770-CC8B-4253-A208-3AD23FCBB06E_des|text=|trigger=button}{sub-section}{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_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=prs}{td}*Parameters*\\{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_ret|text=|trigger=button}{sub-section}{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_see|text=|trigger=button}{sub-section}{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_see|text=|trigger=button}{sub-section}{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_sam|text=|trigger=button}{sub-section}{sub-section:19850770-CC8B-4253-A208-3AD23FCBB06E_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=78A470EA-B9AF-45AD-B67D-9B01ECDD4E43}{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:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_des|text=|trigger=button}{sub-section}{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_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=prs}{td}*Parameters*\\{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_ret|text=|trigger=button}{sub-section}{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_see|text=|trigger=button}{sub-section}{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_see|text=|trigger=button}{sub-section}{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_sam|text=|trigger=button}{sub-section}{sub-section:78A470EA-B9AF-45AD-B67D-9B01ECDD4E43_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=80CF982A-4130-43FD-9147-0E1736A5CB5D}{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;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_des|text=|trigger=button}{sub-section}{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_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=prs}{td}*Parameters*\\{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_ret|text=|trigger=button}{sub-section}{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_see|text=|trigger=button}{sub-section}{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_see|text=|trigger=button}{sub-section}{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_sam|text=|trigger=button}{sub-section}{sub-section:80CF982A-4130-43FD-9147-0E1736A5CB5D_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7F0935C6-5C61-4F98-A0F6-5F4DC89B2878}{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:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_des|text=|trigger=button}{sub-section}{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_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. If a file name is specified, then the PDF document is generated into that file. If no argument is specified, then the PDF document is stored in memory and can be retrieved when ending the meta print job and can be saved into a dataprovider, for example.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_ret|text=|trigger=button}{sub-section}{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_see|text=|trigger=button}{sub-section}{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_see|text=|trigger=button}{sub-section}{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_sam|text=|trigger=button}{sub-section}{sub-section:7F0935C6-5C61-4F98-A0F6-5F4DC89B2878_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Cache
index
true
refresh
100d
showRefresh
true
id
doc
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientservoy sSummary12%30%58%height: 30px;3Methods SummaryAdd metadata to the PDF, like AuthorCombine multiple PDF docs into one.Combine multiple protected PDF docs into one.Convert a PDF form to a PDF document.Convert a protected PDF form to a PDF document.Add password protection and security options to the PDFAdd password protection and security options to the PDFAdd password protection and security options to the PDFAdd password protection and security options to the PDFAdd password protection and security options to the PDFEnds a previously started meta print job.Returns a PDF printer that can be used in print calls.Returns a PDF printer that can be used in print calls.Returns the number of pages printed by the last print call done in the context of a meta print job.Create a thumbnail from the provided PDFCreate a thumbnail from the provided PDFCreate a thumbnail from the provided PDFReturns the total number of pages printed in the context of a meta print job.Add a directory that should be searched for fonts.Add pages numbers to a PDFAdd pages numbers to a PDFAdd some PDF based content over a PDFAdd some PDF based content over a PDFAdd some PDF based content over a PDFAdd some PDF based content over a PDFAdd text over every page at a 45 degree angleAdd text over every page at a 45 degree angleUsed for printing multiple things into the same PDF document.Used for printing multiple things into the same PDF document.Add an image as a watermark on every page, or the pages specified as a parameterAdd an image as a watermark on every page, or the pages specified as a parameterAdd an image as a watermark on every page, or the pages specified as a parameterfunctionservoy sDetail2100%height:30px2Methods DetailsaddMetaDataname
addMetaData(data, metaData)
dessIndent
Add metadata to the PDF, like Author
prs
Parameters
sIndentdatathe PDFmetaDataa JavaScript object (Scriptable) that contains the metadata as property/value pairsret
Combine multiple PDF docs into one.
Note: this function may fail when creating large PDF files due to lack of available heap memory. To compensate, please configure the application server with more heap memory via -Xmx parameter.
prs
Parameters
sIndentpdf_docs_bytearraysthe array of documents to combineret
Combine multiple protected PDF docs into one.
Note: this function may fail when creating large PDF files due to lack of available heap memory. To compensate, please configure the application server with more heap memory via -Xmx parameter.
prs
Parameters
sIndentpdf_docs_bytearraysthe array of documents to combinepdf_docs_passwordsan array of passwords to useret
Add password protection and security options to the PDF
prs
Parameters
sIndentdatathe PDFownerPasswordthe owner passworduserPasswordthe user passwordallowAssemblywhether to set the allow assembly permissionallowCopywhether to set the allow copy permissionallowDegradedPrintingwhether to set the allow degraded printing permissionallowFillInwhether to set the allow fill in permissionallowModifyAnnotationswhether to set the allow modify annotations permissionallowModifyContentswhether to set the allow modify contents permissionallowPrintingwhether to set the allow printing permissionallowScreenreaderswhether to set the allow screen readers permissionret
Add password protection and security options to the PDF
prs
Parameters
sIndentdatathe PDFownerPasswordthe owner passworduserPasswordthe user passwordallowAssemblywhether to set the allow assembly permissionallowCopywhether to set the allow copy permissionallowDegradedPrintingwhether to set the allow degraded printing permissionallowFillInwhether to set the allow fill in permissionallowModifyAnnotationswhether to set the allow modify annotations permissionallowModifyContentswhether to set the allow modify contents permissionallowPrintingwhether to set the allow printing permissionallowScreenreaderswhether to set the allow screen readers permissionis128bitwhether to use 128-bit encryptionret
Add password protection and security options to the PDF
prs
Parameters
sIndentdatathe PDFownerPasswordthe owner passworduserPasswordthe user passwordallowAssemblywhether to set the allow assembly permissionallowCopywhether to set the allow copy permissionallowDegradedPrintingwhether to set the allow degraded printing permissionallowFillInwhether to set the allow fill in permissionallowModifyAnnotationswhether to set the allow modify annotations permissionallowModifyContentswhether to set the allow modify contents permissionallowPrintingwhether to set the allow printing permissionallowScreenreaderswhether to set the allow screen readers permissionis128bitwhether to use 128-bit encryptionmetaDataa JavaScript object (Scriptable) that contains the metadata as property/value pairsret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowendMetaPrintJobname
endMetaPrintJob()
dessIndent
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.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClientsam
Sample
sIdentjavascriptlastDetailRowgetPDFPrintername
getPDFPrinter()
dessIndent
Returns a PDF printer that can be used in print calls. Returns the last started meta print job.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClientsam
Sample
sIdentjavascriptlastDetailRowgetPDFPrintername
getPDFPrinter(filename)
dessIndent
Returns a PDF printer that can be used in print calls. The PDF printer that generates a PDF into the specified file is returned.
prs
Parameters
sIndentfilenamethe file nameret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClientsam
Sample
sIdentjavascriptlastDetailRowgetPagesPrintedname
getPagesPrinted()
dessIndent
Returns the number of pages printed by the last print call done in the context of a meta print job.
sIndentdatathe PDFfontSizethe font size to uselocationXthe x location of the numberslocationYthe y location of the numbersfontthe font to usehexColorthe font color to useret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowoverlayname
overlay(data, forOverlay)
dessIndent
Add some PDF based content over a PDF
prs
Parameters
sIndentdatathe PDFforOverlaya PDF to use as overlayret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowoverlayname
overlay(data, forOverlay, isOver)
dessIndent
Add some PDF based content over a PDF
prs
Parameters
sIndentdatathe PDFforOverlaya PDF to use as overlayisOverwhether the overlay will be put over the contentret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowoverlayname
overlay(data, forOverlay, isOver, pages)
dessIndent
Add some PDF based content over a PDF
prs
Parameters
sIndentdatathe PDFforOverlaya PDF to use as overlayisOverwhether the overlay will be put over the contentpagesan array of page numbers to put the overlay onret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowoverlayname
overlay(data, forOverlay, pages)
dessIndent
Add some PDF based content over a PDF
prs
Parameters
sIndentdatathe PDFforOverlaya PDF to use as overlaypagesan array of page numbers to put the overlay onret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowoverlayTextname
overlayText(data, text)
dessIndent
Add text over every page at a 45 degree angle
prs
Parameters
sIndentdatathe PDFtextthe text to use for the overlayret
sIndentdatathe PDFtextthe text to use for the overlaylocationXthe x location of the overlaylocationYthe y location of the overlayisOverwhether to put the overlay over the contentfontSizethe font size to usefontthe font to usehexColorthe font color to useret
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.
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.
prs
Parameters
sIndentfilenamethe file nameret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClientsam
Sample
sIdentjavascriptlastDetailRowwatermarkname
watermark(data, image)
dessIndent
Add an image as a watermark on every page, or the pages specified as a parameter
prs
Parameters
sIndentdatathe PDFimagethe path of an image to use or array of bytes containing actual imageret
Add an image as a watermark on every page, or the pages specified as a parameter
prs
Parameters
sIndentdatathe PDFimagethe path of an image to use or array of bytes containing actual imagelocationXthe x location of the imagelocationYthe y location of the imageisOverwhether to put over the contentret
Add an image as a watermark on every page, or the pages specified as a parameter
prs
Parameters
sIndentdatathe PDFimagethe path of an image to use or array of bytes containing actual imagelocationXthe x location of the imagelocationYthe y location of the imageisOverwhether to put over the contentpagesan array of pages where to apply the watermarkret