2022.2

Table Of Contents
Thedesiredpage.Countingstartsat1.Ifnopagenumberisgiven,informationaboutthefirstpagewill
beretrieved.
ThereturnedobjectisofthetypeImageInfo.Ithasthefollowingfields:
Field Type Description
height
float Theheightofthecurrentpage(inpoints).
page
Number Currentpagenumber(countingfrom1)withintheresource.
pages
Number Thetotalnumberofpagesintheresource.
permissions
"Permissions"below PDFonly.AllowstoverifyifaPDFispassword-protectedorhasrestrictionsforprinting.
width
float Thewidthofthecurrentpage(inpoints)
Examples
ThisscriptretrievesthesecondpageofaPDFthatispresentinthetemplate'sresources.
var pdf = resource("images/stamp.pdf", 2);
var height = pdf.height;
var width = pdf.width;
var numberOfPages = pdf.pages;
Inthefollowingscript,thefunctionisusedtocheckifafileexists.
if(resource("C:/paw.pdf")){
//exists
} else {
//oops
}
Permissions
AllowstoverifyifaPDFispassword-protectedorhasrestrictionsforprinting.
Thisispartoftheinformationaboutanimagethatisreturnedbytheresource()function;see
"resource()"onthepreviouspage).
Note: IfaPDFthatdoesnotallowcontentcopying,ConnectcannothandlethePDFatallandwe
cannotdeterminethepermissions.InthatcasehasPasswordwillbetrue(evenifthepass-
wordisnotset)andprintingAllowedwillbeunknown.
Page 1279