Imageframe
DUMMY
Id: 100
This is a dummy-placeholder that can be used as trigger to link a record to the frame, without any real placeholder-logic. Can be useful to enable the execution of layoutrules on frames that don't have any dynamic content, but require manipulation through a layout-rule.
QR CODE
Id: 101
| Parameters | Explanation | Default |
|---|---|---|
| gEntity | A Dataprovider-Entity to use for dataqueries (see Data Provider) Available in default-library: data_provider, generic. | data_provider |
| gNodeType | Type of nodes in the XML-file, below which the attribute is located. Available in default-library: product, sku, asset, attribute_group_definitions, attribute_group | product |
| gAttributeKey | The key of the attribute, where the barcode-number is located. Can be a custom string or specified in parts of the gRecordStringID--roottable-id-- from gRecordStringID1 (RootTableID)--col-id-- from gRecordStringID2 (ColumnID)--row-id-- from gRecordStringID3 (RowID) | |
| gStringIdFrom | Where should the string-id for the dataprovider-queries come from. If no value is given, the gRecordStringId is used. Other options: --string-id-- from gRecordStringID--roottable-id-- from gRecordStringID1 (RootTableID)--col-id-- from gRecordStringID2 (ColumnID)--row-id-- from gRecordStringID3 (RowID) | --string-id-- |
| gQrCodeType | Type of the QR-code (supports special functions). Available types (see also QR-Code library): 1 TEXT2 EMAIL3 HYPERLINK4 SMS5 VCARD6 GEO7 WIFI8 VCAL | 1 |
| gErrorCorrection | Level of Error correction. Available levels:Q Quality - 30%H High - 20%M Medium - 15%L Low - 7% | Q |
| gStrict | Should the QR-code be created, when input is valid? If No is selected, content might be cut off, if it is invalid. 0: No, 1: Yes | 1 |
| gIncludeText | Should the QR-code content be displayed below the QR-code? (for example for debugging)0: No, 1: Yes | 0 |
| gColor | Color of barcode in rgb(0-255) or cmyk(0.0-1.0) | |
| gColorBG | Color of background in rgb(0-255) or cmyk(0.0-1.0) | |
| gColorStroke | Color of stroke in rgb(0-255) or cmyk(0.0-1.0) |
IMAGE STATIC
Id: 102
Place an image from the project's folder in the imageframe.
| Parameters | Explanation | Default |
|---|---|---|
| gImageName | Relative path to the image-file in the project's folder below renderpdf/comet/images. Has to be a filetype that is supported by Comet-PDF-Renderer. | |
| gAlphaTransparency | Wheter or not to apply the first alpha-transparency-layer (index 0) | yes |
| gReplacementImage | Relative filepath to a an image-file below renderpdf/comet/images that is used, if the path in gImageName does not lead to an existing file. Select None to not use a fallback-image. | _missing-image.jpg |
IMAGE ATTRIBUTE
Id: 103
Load an attribute-value and try to download a webimage using that value as url. Alternatively, the value can be a relative path to a file in a zip-payload of the renderpdf-request.
| Parameters | Explanation | Default |
|---|---|---|
| gEntity | A Dataprovider-Entity to use for dataqueries (see Data Provider) Available in default-library: data_provider, generic. | data_provider |
| gNodeType | Type of nodes in the XML-file, below which the attribute is located. Available in default-library: product, sku, asset, attribute_group_definitions, attribute_group | product |
| gAttributeKey | The key of the attribute, where the webimage-url is located. Can be a custom string or specified in parts of the gRecordStringID--roottable-id-- from gRecordStringID1 (RootTableID)--col-id-- from gRecordStringID2 (ColumnID)--row-id-- from gRecordStringID3 (RowID) | |
| gStringIdFrom | Where should the string-id for the dataprovider-queries come from. If no value is given, the gRecordStringId is used. Other options: --string-id-- from gRecordStringID--roottable-id-- from gRecordStringID1 (RootTableID)--col-id-- from gRecordStringID2 (ColumnID)--row-id-- from gRecordStringID3 (RowID)--child-record-- from Child-Record | --string-id-- |
| gParentNodeType | (Optional, only applies, if --child-record--is selected in gStringIDFrom.)Type of node in the XML-file, below which the current record is located. | |
| gParentStringIdFrom | (Optional, only applies, if --child-record--is selected in gStringIDFrom.)Where should the string-id for the dataprovider-queries come from. Options: None --string-id-- from gRecordStringID--roottable-id-- from gRecordStringID1 (RootTableID)--col-id-- from gRecordStringID2 (ColumnID)--row-id-- from gRecordStringID3 (RowID) | |
| gChildReferenceType | (Optional, only applies, if --child-record--is selected in gStringIDFrom.)The reference-type by which the found child-records are filtered by. | |
| gChildIndex | (Optional, only applies, if --child-record--is selected in gStringIDFrom.)The index of the found childrecords. | |
| gIndex | Get the Nth occurrance of the found values in the datafile. A numeric, 0-based index. | 0 |
| gAlphaTransparency | Wheter or not to apply the first alpha-transparency-layer (index 0) | yes |
| gFileLocation | Specify whether the attribute-values for gAttributeKey are:--web--: URLs that point to a webimage--zip--: Relative paths to files in the ticket-folder, thus being part of a zip-payload of the renderpdf-request--local--: Relative paths that point to files in the folder for static images renderpdf/comet/images | --web-- |
| gReplacementImage | Relative filepath to a an image-file below renderpdf/comet/images that is used, if the found attribute-value does not lead to an existing file (download fails, not part of zip-payload, etc.). Select None to not use a fallback-image. | |
| gURLNameflag | A nameflag to modify the filename when downloading an image. Usually to automatically shorten filenames to avoid errors. Available nameflags (see Comet-docu for explanation): kOnlyHashkEllipsizeStartkEllipsizeMiddlekEllipsizeEndkNoHashkEllipsizeEndkNoHashNone | kOnlyHash |
ASSET ATTRIBUTE (PDF)
Id: 104
Like IMAGE ATTRIBUTE, but used for PDF-files using custom placment-options, like which page of the PDF should be placed and how should it be cropped.
| Parameters | Explanation | Default |
|---|---|---|
| gEntity | A Dataprovider-Entity to use for dataqueries (see Data Provider) Available in default-library: data_provider, generic. | data_provider |
| gNodeType | Type of nodes in the XML-file, below which the attribute is located. Available in default-library: product, sku, asset, attribute_group_definitions, attribute_group | product |
| gAttributeKey | The key of the attribute, where the barcode-number is located. Can be a custom string or specified in parts of the gRecordStringID--roottable-id-- from gRecordStringID1 (RootTableID)--col-id-- from gRecordStringID2 (ColumnID)--row-id-- from gRecordStringID3 (RowID) | |
| gStringIdFrom | Where should the string-id for the dataprovider-queries come from. If no value is given, the gRecordStringId is used. Other options: --string-id-- from gRecordStringID--roottable-id-- from gRecordStringID1 (RootTableID)--col-id-- from gRecordStringID2 (ColumnID)--row-id-- from gRecordStringID3 (RowID)--child-record-- from Child-Record | --string-id-- |
| gParentNodeType | (Optional, only applies, if --child-record--is selected in gStringIDFrom.)Type of node in the XML-file, below which the current record is located. | |
| gParentStringIdFrom | (Optional, only applies, if --child-record--is selected in gStringIDFrom.)Where should the string-id for the dataprovider-queries come from. Options: None --string-id-- from gRecordStringID--roottable-id-- from gRecordStringID1 (RootTableID)--col-id-- from gRecordStringID2 (ColumnID)--row-id-- from gRecordStringID3 (RowID) | |
| gChildReferenceType | (Optional, only applies, if --child-record--is selected in gStringIDFrom.)The reference-type by which the found child-records are filtered by. | |
| gChildIndex | (Optional, only applies, if --child-record--is selected in gStringIDFrom.)The index of the found childrecords. | |
| gIndex | Get the Nth occurrance of the found values in the datafile. A numeric, 0-based index. | 0 |
| gPDFPageIndex | Index of the page in the PDF-document, that should be placed in this frame. | 0 |
| gPDFPages | How many total pages of the PDF-document should be placed in following frames? 1 to only place the PDF-document's page into the current frame; no following frames are created. Selecting a value > 1 / 'all' requires to specify the Build Support Script on the current template. The build support script creates new frames based on the first frame's geometry. Placement starts at the initial page-index and counts up to the specifed amount. | all |
| gPDFCrop | The PDF's cropbox to use when placing. If the specified cropbox is not used by the PDF-file results may vary from the expected result. Available crop-options (also see Comet-docu of setImage):kDefaultkContentkArtkCropkTrimkBleedkMediakContentAllLayers | kDefault |
| gPDFTransparent | Should the background be transparent?0: No, 1: Yes | 1 |
| gPDFLayers | Commaseparated list of layernames. All specified layers of the PDF file will be made visible, all others invisible. If the list is empty, the layer visibility settings of the PDF file will be used. | |
| gFileLocation | Specify whether the attribute-values for gAttributeKey are:--web--: URLs that point to a webimage--zip--: Relative paths to files in the ticket-folder, thus being part of a zip-payload of the renderpdf-request--local--: Relative paths that point to files in the folder for static images renderpdf/comet/images | --web-- |
| gReplacementImage | Relative filepath to a an image-file below renderpdf/comet/images that is used, if the found attribute-value does not lead to an existing file (download fails, not part of zip-payload, etc.). Select None to not use a fallback-image. | |
| gURLNameflag | A nameflag to modify the filename when downloading an image. Usually to automatically shorten filenames to avoid errors. Available nameflags (see Comet-docu for explanation): kOnlyHashkEllipsizeStartkEllipsizeMiddlekEllipsizeEndkNoHashkEllipsizeEndkNoHashNone | kOnlyHash |
TOC Record Breadcrumb
Id: 200
Set this placeholder on a frame in the template of records you want to list in a table of contents. The frame can be any frame, that doesn't already have a frame-placeholder; can be a dummy frame as well. Using the library table_of_contents.py, you can find records in the document by giving the placeholder's ID
(...)
comet.product.establish(productlist, PAGE_TEMPLATE_ID, TEMPLATE_ID, page)
toc_lib = comet.pyImport("[xml]/library/table_of_contents.py")
toc = toc_lib.TableOfContents({"type":"product","base_attributes":["label","id"]}, page_range, placeholder_range=[200])
TOC Set Pagelink
Id: 202
Set this placeholder in templates that are established in a table of contents, on a frame that should link to a page of a toc-record. First, the table of contents-templates and regular templates need to be established. Then, using the library table_of_contents.py you can generate a toc-object by searching the document for records and trigger the page-hyperlinking.
(...)
comet.product.establish(toc_productlist, PAGE_TEMPLATE_ID, TEMPLATE_ID, page)
page_range_toc = comet.gDocument.getPages()
last_toc_page_index = page_range_toc[-1].getIndex()
(...)
comet.product.establish(productlist, PAGE_TEMPLATE_ID, TEMPLATE_ID, page_range_toc[-1])
page_range = comet.gDocument.getPages()[last_toc_page_index:]
toc_lib = comet.pyImport("[xml]/library/table_of_contents.py")
toc = toc_lib.TableOfContents({"type":"product","base_attributes":["label","id"]}, page_range, placeholder_range=[200])
toc.generate_page_hyperlinks(placeholder_id=202, page_range=page_range_toc, hyperlink_type=comet.CTextModel)