Skip to main content

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​

ParametersExplanationDefault
gEntityA Dataprovider-Entity to use for dataqueries (see Data Provider)
Available in default-library: data_provider, generic.
data_provider
gNodeTypeType 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
gAttributeKeyThe 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)
gStringIdFromWhere 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--
gQrCodeTypeType of the QR-code (supports special functions).
Available types (see also QR-Code library):
1 TEXT
2 EMAIL
3 HYPERLINK
4 SMS
5 VCARD
6 GEO
7 WIFI
8 VCAL
1
gErrorCorrectionLevel of Error correction. Available levels:
Q Quality - 30%
H High - 20%
M Medium - 15%
L Low - 7%
Q
gStrictShould 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
gIncludeTextShould the QR-code content be displayed below the QR-code? (for example for debugging)
0: No, 1: Yes
0
gColorColor of barcode in rgb(0-255) or cmyk(0.0-1.0)
gColorBGColor of background in rgb(0-255) or cmyk(0.0-1.0)
gColorStrokeColor 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.

ParametersExplanationDefault
gImageNameRelative 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.
gAlphaTransparencyWheter or not to apply the first alpha-transparency-layer (index 0)yes
gReplacementImageRelative 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.

ParametersExplanationDefault
gEntityA Dataprovider-Entity to use for dataqueries (see Data Provider)
Available in default-library: data_provider, generic.
data_provider
gNodeTypeType 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
gAttributeKeyThe 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)
gStringIdFromWhere 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.
gIndexGet the Nth occurrance of the found values in the datafile. A numeric, 0-based index.0
gAlphaTransparencyWheter or not to apply the first alpha-transparency-layer (index 0)yes
gFileLocationSpecify 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--
gReplacementImageRelative 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.
gURLNameflagA nameflag to modify the filename when downloading an image. Usually to automatically shorten filenames to avoid errors.
Available nameflags (see Comet-docu for explanation):
kOnlyHash
kEllipsizeStart
kEllipsizeMiddle
kEllipsizeEnd
kNoHashkEllipsizeEnd
kNoHash
None
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.

ParametersExplanationDefault
gEntityA Dataprovider-Entity to use for dataqueries (see Data Provider)
Available in default-library: data_provider, generic.
data_provider
gNodeTypeType 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
gAttributeKeyThe 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)
gStringIdFromWhere 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.
gIndexGet the Nth occurrance of the found values in the datafile. A numeric, 0-based index.0
gPDFPageIndexIndex of the page in the PDF-document, that should be placed in this frame.0
gPDFPagesHow 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
gPDFCropThe 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):
kDefault
kContent
kArt
kCrop
kTrim
kBleed
kMedia
kContentAllLayers
kDefault
gPDFTransparentShould the background be transparent?
0: No, 1: Yes
1
gPDFLayersCommaseparated 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.
gFileLocationSpecify 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--
gReplacementImageRelative 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.
gURLNameflagA nameflag to modify the filename when downloading an image. Usually to automatically shorten filenames to avoid errors.
Available nameflags (see Comet-docu for explanation):
kOnlyHash
kEllipsizeStart
kEllipsizeMiddle
kEllipsizeEnd
kNoHashkEllipsizeEnd
kNoHash
None
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])

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)