Watermarks for PDF generation
Three macros are available to enable watermarks for PDF generation of Creo Elements/Direct Annotation drawings:
Awmc_set_watermark_file
Awmc_i_load_watermark_file
Awmc_i_delete_watermark
The macros as shipped are designed to cover the basic needs of most organizations. They may be customized as necessary to meet the specific needs of an organization.
Awmc_set_watermark_file
The macro
(oli::sd-execute-annotator-command :cmd "Awmc_set_watermark_file '<path>/<watermarkfile>'")
defines a basic watermark file for Creo Elements/Direct Modeling. The watermark file must be in .mi format.
The basic watermark file will be used on sheets that either do not have a frame, or have a frame that does not have a specific watermark file.
Awmc_i_load_watermark_file
The macro Awmc_i_load_watermark_file is called right before the PDF file is generated. The macro goes through all sheets in the drawing and checks each sheet for the current frame.
When a frame is found, it extracts the frame format and tries to load a file <path>/<NameWatermarkFile><FrameFormat><.mi> as a subpart called "watermark". The watermark file is loaded with the same offset as the frame.
If a frame is not found or there is not a special watermark file for the frame, the macro uses the basic watermark file.
For example, the basic watermark file could be named watermark.mi and the watermark file for A3 named watermarkA3.mi.
If a part named "watermark" already exists, the macro does not load the watermark file.
Awmc_i_delete_watermark
The macro Awmc_i_delete_watermark is called after the PDF file is generated. It deletes all watermark subparts that were added by Awmc_i_load_watermark_file.
Was this helpful?