Add metadata to the PDF, like Author |
|
Combine 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 PDF |
|
Add password protection and security options to the PDF |
|
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders) |
Add password protection and security options to the PDF |
|
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit) |
Add password protection and security options to the PDF |
|
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit, metaData) |
Add password protection and security options to the PDF |
|
Ends 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 PDF |
|
Create a thumbnail from the provided PDF |
|
Create a thumbnail from the provided PDF |
|
Returns 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 PDF |
|
Add pages numbers to a PDF |
|
Add some PDF based content over a PDF |
|
Add some PDF based content over a PDF |
|
Add some PDF based content over a PDF |
|
Add some PDF based content over a PDF |
|
Add text over every page at a 45 degree angle |
|
Add text over every page at a 45 degree angle |
|
Used 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 parameter |
|
Add an image as a watermark on every page, or the pages specified as a parameter |
|
Add an image as a watermark on every page, or the pages specified as a parameter |
|
|
addMetaData(data, metaData) |
|
Add metadata to the PDF, like Author |
|
|
Parameters a JavaScript object (Scriptable) that contains the metadata as property/value pairs |
|
|
|
|
Sample // 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 = %%elementName%%.addMetaData(data, metaData);
} |
|
|
|
|
combinePDFDocuments(pdf_docs_bytearrays) |
|
Combine multiple PDF docs into one.
Note: this function may fail when creating large PDF files due to lack of available heap memory. To compensate, please configure the application server with more heap memory via -Xmx parameter. |
|
|
Parameters the array of documents to combine |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample pdf_blob_column = combinePDFDocuments(new Array(pdf_blob1,pdf_blob2,pdf_blob3)); |
|
|
|
|
combineProtectedPDFDocuments(pdf_docs_bytearrays, pdf_docs_passwords) |
|
Combine multiple protected PDF docs into one.
Note: this function may fail when creating large PDF files due to lack of available heap memory. To compensate, please configure the application server with more heap memory via -Xmx parameter. |
|
|
Parameters the array of documents to combine |
|
an array of passwords to use |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample pdf_blob_column = combineProtectedPDFDocuments(new Array(pdf_blob1,pdf_blob2,pdf_blob3), new Array(pdf_blob1_pass,pdf_blob2_pass,pdf_blob3_pass)); |
|
|
|
|
convertPDFFormToPDFDocument(pdf_form, field_values) |
|
Convert a PDF form to a PDF document. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample 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)
} |
|
|
|
|
convertProtectedPDFFormToPDFDocument(pdf_form, pdf_password, field_values) |
|
Convert a protected PDF form to a PDF document. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample 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)
} |
|
|
|
|
encrypt(data, ownerPassword) |
|
Add password protection and security options to the PDF |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.encrypt(data, 'secretPassword', 'secretUserPassword', false, false, false, false, false, false, false, false, true);
} |
|
|
|
|
encrypt(data, ownerPassword, userPassword) |
|
Add password protection and security options to the PDF |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.encrypt(data, 'secretPassword', 'secretUserPassword', false, false, false, false, false, false, false, false, true);
} |
|
|
|
|
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders) |
|
Add password protection and security options to the PDF |
|
|
Parameters whether to set the allow assembly permission |
|
whether to set the allow copy permission |
|
whether to set the allow degraded printing permission |
|
whether to set the allow fill in permission |
|
whether to set the allow modify annotations permission |
|
whether to set the allow modify contents permission |
|
whether to set the allow printing permission |
|
whether to set the allow screen readers permission |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.encrypt(data, 'secretPassword', 'secretUserPassword', false, false, false, false, false, false, false, false, true);
} |
|
|
|
|
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit) |
|
Add password protection and security options to the PDF |
|
|
Parameters whether to set the allow assembly permission |
|
whether to set the allow copy permission |
|
whether to set the allow degraded printing permission |
|
whether to set the allow fill in permission |
|
whether to set the allow modify annotations permission |
|
whether to set the allow modify contents permission |
|
whether to set the allow printing permission |
|
whether to set the allow screen readers permission |
|
whether to use 128-bit encryption |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.encrypt(data, 'secretPassword', 'secretUserPassword', false, false, false, false, false, false, false, false, true);
} |
|
|
|
|
encrypt(data, ownerPassword, userPassword, allowAssembly, allowCopy, allowDegradedPrinting, allowFillIn, allowModifyAnnotations, allowModifyContents, allowPrinting, allowScreenreaders, is128bit, metaData) |
|
Add password protection and security options to the PDF |
|
|
Parameters whether to set the allow assembly permission |
|
whether to set the allow copy permission |
|
whether to set the allow degraded printing permission |
|
whether to set the allow fill in permission |
|
whether to set the allow modify annotations permission |
|
whether to set the allow modify contents permission |
|
whether to set the allow printing permission |
|
whether to set the allow screen readers permission |
|
whether to use 128-bit encryption |
|
a JavaScript object (Scriptable) that contains the metadata as property/value pairs |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.encrypt(data, 'secretPassword', 'secretUserPassword', false, false, false, false, false, false, false, false, true);
} |
|
|
|
|
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. |
|
|
Sample //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() |
|
|
|
|
Returns a PDF printer that can be used in print calls. Returns the last started meta print job. |
|
|
Sample //to print current record without printdialog to pdf file in temp dir.
controller.print(true,false,plugins.pdf_output.getPDFPrinter()); |
|
|
|
|
Returns a PDF printer that can be used in print calls. The PDF printer that generates a PDF into the specified file is returned. |
|
|
Sample //to print current record without printdialog to pdf file in temp dir.
controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf')); |
|
|
|
|
Returns the number of pages printed by the last print call done in the context of a meta print job. |
|
|
Sample //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() |
|
|
|
|
Create a thumbnail from the provided PDF |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //read PDF file data
var pdf = plugins.file.readFile();
//get the thumbnail (default the first page is rendered with 72 dpi resolution)
var pngImg = plugins.pdf_output.getThumbnailImage(pdf);
//save PNG image to file
var thumbnailFile = plugins.file.convertToJSFile()
plugins.file.writeFile(thumbnailFile, pngImg); |
|
|
|
|
getThumbnailImage(data, pageNumber) |
|
Create a thumbnail from the provided PDF |
|
|
Parameters PDF page to get thumbnail of. This parameter is zero based index. |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //read PDF file data
var pdf = plugins.file.readFile();
//get the thumbnail (default the first page is rendered with 72 dpi resolution)
var pngImg = plugins.pdf_output.getThumbnailImage(pdf);
//save PNG image to file
var thumbnailFile = plugins.file.convertToJSFile()
plugins.file.writeFile(thumbnailFile, pngImg); |
|
|
|
|
getThumbnailImage(data, pageNumber, dpi) |
|
Create a thumbnail from the provided PDF |
|
|
Parameters PDF page to get thumbnail of. This parameter is zero based index. |
|
resolution used to render the thumbnail image |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //read PDF file data
var pdf = plugins.file.readFile();
//get the thumbnail (default the first page is rendered with 72 dpi resolution)
var pngImg = plugins.pdf_output.getThumbnailImage(pdf);
//save PNG image to file
var thumbnailFile = plugins.file.convertToJSFile()
plugins.file.writeFile(thumbnailFile, pngImg); |
|
|
|
|
Returns the total number of pages printed in the context of a meta print job. Call this method before ending the meta print job. |
|
|
Sample //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() |
|
|
|
|
insertFontDirectory(path) |
|
Add a directory that should be searched for fonts. Call this only in the context of an active meta print job. |
|
|
Sample //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'); |
|
|
|
|
Add pages numbers to a PDF |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // Add pages numbers to a PDF
var unNumberedFile = plugins.file.showFileOpenDialog();
if (unNumberedFile) {
var data = plugins.file.readFile(unNumberedFile);
pageNumberedPdf = %%elementName%%.numberPages(data, 12, 520, 30, 'Courier', '#ff0033');
} |
|
|
|
|
numberPages(data, fontSize, locationX, locationY, font, hexColor) |
|
Add pages numbers to a PDF |
|
|
Parameters the x location of the numbers |
|
the y location of the numbers |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // Add pages numbers to a PDF
var unNumberedFile = plugins.file.showFileOpenDialog();
if (unNumberedFile) {
var data = plugins.file.readFile(unNumberedFile);
pageNumberedPdf = %%elementName%%.numberPages(data, 12, 520, 30, 'Courier', '#ff0033');
} |
|
|
|
|
overlay(data, forOverlay) |
|
Add some PDF based content over a PDF |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.overlay( data, data2, false, pages );
//overlayedPdf = %%elementName%%.overlay( data, data2 );
//overlayedPdf = %%elementName%%.overlay( data, data2, false, null );
//overlayedPdf = %%elementName%%.overlay( data, data2, pages );
}
} |
|
|
|
|
overlay(data, forOverlay, isOver) |
|
Add some PDF based content over a PDF |
|
|
Parameters whether the overlay will be put over the content |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.overlay( data, data2, false, pages );
//overlayedPdf = %%elementName%%.overlay( data, data2 );
//overlayedPdf = %%elementName%%.overlay( data, data2, false, null );
//overlayedPdf = %%elementName%%.overlay( data, data2, pages );
}
} |
|
|
|
|
overlay(data, forOverlay, isOver, pages) |
|
Add some PDF based content over a PDF |
|
|
Parameters whether the overlay will be put over the content |
|
an array of page numbers to put the overlay on |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.overlay( data, data2, false, pages );
//overlayedPdf = %%elementName%%.overlay( data, data2 );
//overlayedPdf = %%elementName%%.overlay( data, data2, false, null );
//overlayedPdf = %%elementName%%.overlay( data, data2, pages );
}
} |
|
|
|
|
overlay(data, forOverlay, pages) |
|
Add some PDF based content over a PDF |
|
|
Parameters an array of page numbers to put the overlay on |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.overlay( data, data2, false, pages );
//overlayedPdf = %%elementName%%.overlay( data, data2 );
//overlayedPdf = %%elementName%%.overlay( data, data2, false, null );
//overlayedPdf = %%elementName%%.overlay( data, data2, pages );
}
} |
|
|
|
|
Add text over every page at a 45 degree angle |
|
|
Parameters the text to use for the overlay |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.overlayText(data, 'DRAFT', 230, 430, true, 32, 'Helvetica', '#33ff33');
} |
|
|
|
|
overlayText(data, text, locationX, locationY, isOver, fontSize, font, hexColor) |
|
Add text over every page at a 45 degree angle |
|
|
Parameters the text to use for the overlay |
|
the x location of the overlay |
|
the y location of the overlay |
|
whether to put the overlay over the content |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.overlayText(data, 'DRAFT', 230, 430, true, 32, 'Helvetica', '#33ff33');
} |
|
|
|
|
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. |
|
|
Sample //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() |
|
|
|
|
startMetaPrintJob(filename) |
|
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. |
|
|
Sample //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() |
|
|
|
|
Add an image as a watermark on every page, or the pages specified as a parameter |
|
|
Parameters the path of an image to use or array of bytes containing actual image |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // 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 = %%elementName%%.watermark(data, image);
} |
|
|
|
|
watermark(data, image, locationX, locationY, isOver) |
|
Add an image as a watermark on every page, or the pages specified as a parameter |
|
|
Parameters the path of an image to use or array of bytes containing actual image |
|
the x location of the image |
|
the y location of the image |
|
whether to put over the content |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
|
watermark(data, image, locationX, locationY, isOver, pages) |
|
Add an image as a watermark on every page, or the pages specified as a parameter |
|
|
Parameters the path of an image to use or array of bytes containing actual image |
|
the x location of the image |
|
the y location of the image |
|
whether to put over the content |
|
an array of pages where to apply the watermark |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
|
|
|