10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Querying custom properties. Custom properties can be queried as in the following example,where the property zipcode is queried from a block named b1 on page pagenum:zip = p.pcos_get_string(doc, "pages[" + pagenum + "]/blocks/b1/Custom/zipcode");If you don’t know which custom properties are actually present in a block, you can determinethe names at runtime. In order to find the name of the first custom property ina block named b1 use the following:propname = p.pcos_get_string(doc, "pages[" + pagenum + "]/blocks/b1/Custom[0].key");Use increasing indexes instead of 0 in order to determine the names of all custom properties.Use the length prefix to determine the number of custom properties.Non-existing block properties and default values. Use the type prefix to determinewhether a block or property is actually present. If the type for a path is 0 or null the respectiveobject is not present in the PDF document. Note that for standard propertiesthis means that the default value of the property will be used.Name space for custom properties. In order to avoid confusion when PDF documentsfrom different sources are exchanged, it is recommended to use an Internet domainname as a company-specific prefix in all custom property names, followed by a colon ’:’and the actual property name. For example, ACME corporation would use the followingproperty names:acme.com:digitsacme.com:refnumberSince standard and custom properties are stored differently in the block, standardPDFlib property names (as defined in Section 10.5, »Standard Properties for AutomatedProcessing«, page 240) will never conflict with custom property names.10.6 Querying Block Names and Properties with pCOS 249

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!