1.4
Table Of Contents
- Table of Contents
- Welcome to PlanetPress Connect 1.4.2
- Setup And Configuration
- DataMapper Module
- The Designer
- Mark Position Options
- Additional Text Settings
- Additional Image Settings
- Barcode Options
- Codabar Settings
- Code 128 Settings
- Code 39 Settings
- Additional Datamatrix Settings
- Additional EAN 128 Settings
- Additional EAN 13 Settings
- Additional EAN 8 Settings
- Additional Interleave 2 of 5 Settings
- Additional PDF417 Settings
- Additional QR Code Settings
- Additional UPC A Settings
- Additional UPC E Settings
- Additional OMR Mark Settings
- Keystore
- PDF Signature
- Copyright Information
- Legal Notices and Acknowledgements
l merge.section is only defined when when the output channel is Web. To make sure
that it is defined, use the following if statement: if (merge.channel ==
Channel.WEB && merge.context.type == ContextType.WEB) {... }.
l When using merge.context.sections keep in mind that for example 'Section X'
might only exist in your Print context, so using merge.context.sections
['Section X'] without enclosing it in the if statement if
(merge.context.type == ContextType.PRINT) {} will yield an error when
the script runs for other contexts. Instead of enclosing it in an if statement, you can use
the template object to access a specific context:
merge.template.contexts.PRINT.sections['Section X'] .
Sample scripts
Conditionally skipping or printing Print sections
var printSections = merge.template.contexts.PRINT.sections;
printSections['Section EN'].enabled = false;
printSections['Section FR'].enabled = false;
if(record.fields.Language === 'FR'){
printSections['Section FR'].enabled = true;
} else {
printSections['Section EN'].enabled = true;
}
Selecting different sections for Print output and Email PDF attachment
var printSections = merge.template.contexts.PRINT.sections;
if(merge.channel === Channel.EMAIL){
printSections['Section 1'].enabled = false;
printSections['Section 2'].enabled = true;
}
if(merge.channel === Channel.PRINT){
printSections['Section 1'].enabled = true;
printSections['Section 2'].enabled = false;
}
Setting the name of Email PDF attachments
var section = merge.template.contexts.PRINT.sections['Section 1'];
section.part = 'Invoice ' + record.fields['InvoiceNo'];
Page 216