2022.2

Table Of Contents
Field Description
CENTERED
CentersthePDFonthepage,verticallyandhorizontally.
FIT_TO_MEDIA
StretchesthePDFtofitthepagesize.
Examples
Thisscriptappliesabsolute positioningtothebackgroundofaPrintsection.
var activeSection = merge.template.contexts.PRINT.sections['Section 1'];
activeSection.background.source = BackgroundResource.RESOURCE_PDF;
activeSection.background.position = MediaPosition.ABSOLUTE;
activeSection.background.left = "10mm";
activeSection.background.top = "10mm";
activeSection.background.url = "images/somepage.pdf";
ThenextscriptscalesthebackgroundofaPrintsectiontothesizeoftheMedia.
var activeSection = merge.template.contexts.PRINT.sections['Section 1'];
activeSection.background.source = BackgroundResource.RESOURCE_PDF;
activeSection.background.position = MediaPosition.FIT_TO_MEDIA;
activeSection.background.url = "images/somepage.pdf";
Post Pagination Script API
ThetablebelowliststhefunctionsandobjectsthatareonlyavailableinPostPaginationScripts.Click
throughtotheobjecttofindadescriptionandsamplescripts.
See"PostPaginationScripts"onpage410forinformationaboutthiskindofscripts,howtoinsertthem
andwhatyoucandowiththem.
Note: PostPaginationScriptsonlyapplytothePrintcontext.Thesefunctionsandobjectscannot
beusedwithothercontexts.
Tip: ItispossibletodefineafunctioninaControlScriptwhichcallsthesefunctions,aslongas
thatfunctionisonlyinvokedfromaPostPaginationScript.
Object or func-
tion
Usage
merge.context."query(selector)"
onpage843
Callmerge.context.query(selector)torunaqueryacrossallsectionsinthePrintcontext.
merge.section."paginate()"on
page855
Acalltomerge.section.paginate()triggerspaginationofthecurrentsection.Note:sectionisassumedtorefer
toavariablethatholdsaSectionobject(see"Retrievingasection"onpage848).
Page 839