2022.2

Table Of Contents
Permissions
AllowstoverifyifaPDFispassword-protectedorhasrestrictionsforprinting.
Thisispartoftheinformationaboutanimagethatisreturnedbytheresource()function;see
"resource()"onpage821).
Note: IfaPDFthatdoesnotallowcontentcopying,ConnectcannothandlethePDFatallandwe
cannotdeterminethepermissions.InthatcasehasPasswordwillbetrue(evenifthepass-
wordisnotset)andprintingAllowedwillbeunknown.
Field Type Description
hasPassword
Boolean WillbetrueiftheresourceisapasswordprotectedPDF.
printingAllowed
String Willbeeither"highres"(fullpermissions),"lowres","none",or"unknown".
Example
ThefollowingscriptlogsthepermissionsforaPDF.
var pdf = resource("images/myPDF.pdf");
var willPrint = pdf.permissions.printingAllowed;
var hasPW = pdf.permissions.hasPassword;
logger.info('Printing restrictions: ' + willPrint);
logger.info('Password-protected: ' + hasPW);
section
Thesectionobjectcanbeusedtoqueryandmodifyhowthesection(andtherelatedcontext)willbe
outputted.ItisoneofthemostimportantobjectsinControlScripts(see"ControlScripts"onpage398
and"ControlScriptAPI"onpage815).
Retrievingasection
Asectioncanberetrievedusingmerge.template.contexts.ContextType.sections["sec-
tion name"],forexample:merge.template.contexts.PRINT.sections["Section EN"].
Asectioncanalsoberetrievedviamerge.context.sections['section name'].Remember,
however,thatwhenseveralcontextsneedtobemerged(forexample,whenthePrintcontextis
attachedtoanemail),thescriptneedstocheckifthecurrentcontextisofthetypethatcontainsthe
desiredsection(forexample:if (merge.context.type == ContextType.PRINT) {}).When
sectionsindifferentcontextshavethesamename,itissafertousemerge.tem-
plate.contexts.ContextType.sections["section name"].
Page 822