draw-crop-marks
- Last updated on February 29, 2024
- •
- 4 minutes to read
This task adds crop marks to a PDF file based on the required crop mark size and the BleedBox and TrimBox described in the file. It supports only one input and one output artifact description (input
/ input*
and output
/ output*
).
Let's look at the PDF page boxes.
Here, Printer's marks are the crop marks. First, a wider white strip is drawn to eliminate the background. Then, a narrower black strip is drawn as the crop mark.
The area between the CropBox and BleedBox is the Slug zone.
Parameters
drawCropMarkCropSizeHorizontal
(number) - (mandatory) The size of the Slug zone in the horizontal direction, which is the length of horizontal crop lines.drawCropMarkCropSizeVertical
(number) - (mandatory) The size of the Slug zone in the vertical direction, which is the length of vertical crop lines.drawCropMarkWhiteCropLineWidth
(number) - The width of the white Printer Mark strip. The default value is5
.drawCropMarkWhiteCropLineColor
(string) - The color of the white crop mark strip. The default value is"cmyk(0,0,0,0)"
.drawCropMarkBlackCropLineWidth
(number) - The width of the black Printer's Mark strip. The default value is3
.drawCropMarkBlackCropLineColor
(string) - The color of the black crop mark strip. The default value is"cmyk(0,0,0,1)"
.drawCropMarkText
- (mandatory) Text to be drawn in the Slug.drawCropMarkTextFontName
(string) - The PostScript font name of the text. The default value is"Roboto-Regular"
.drawCropMarkTextFontSize
(number) - The font size of the text. The default value is8
.drawCropMarkTextColor
(string) - The color of the text. The default value is"cmyk(0,0,0,1)"
.drawCropMarkTextHorizontalMargin
(number) - Percentage of the Slug area's width between vertical crop marks to limit the text zone. For vertical text, it refers to the height of the area between crop marks. The default value is10
(i.e., 10%).drawCropMarkTextVerticalMargin
(number) - Percentage of the Slug area's height between CropBox and BleedBox to limit the text zone. For vertical text, it refers to the width of this area. The default value is10
(i.e., 10%).drawCropMarkPdfCompressionQuality
(number) - Compression quality when the PDF compression type is set toJPEG
. The default value is90
.drawCropMarkPdfCompression
(string) - The resulting file compression type. This value should match the output file format. For more details, see the reference.DrawCropMarkOutputPdfTextMode
(string) - IfText
, saves text elements as text. By default, this property isOutlines
, and text is rendered as a set of vector paths.drawCropMarkOutputArchiveType
(string) - If specified, the rendering result will be packed into an archive. Possible values areZip
|SevenZip
. By default, this value is not specified.drawCropMarkOutputArchiveCompressionType
(string) - An archive compression type. Possible values areNone
|Copy
|Default
|Deflate
|Deflate64
|Lzma
|Lzma2
. The default value isDefault
.
Changing the BleedBox
If, for some reason, the PDF file does not have the bleed zone properly configured, this task allows you to define it. The BleedBox size will be taken from the old TrimBox, and the new TrimBox will be obtained by reducing the old one by the following values:
drawCropMarkOverrideBleedSizeVertical
(number) - A vertical offset of the new TrimBox relative to the old one.drawCropMarkOverrideBleedSizeHorizontal
(number) - A horizontal offset of the new TrimBox relative to the old one.
Debugging the result
Parameters for the debug mode allow you to test the result by drawing different PDF boxes and text boxes. If both color and width parameters are set, the drawing will be performed according to these values. If only a color is set, the default line width 1
will be applied. If only a width is set, the default color "cmyk(0%, 100%, 100%, 0%, 100%)"
will be applied.
drawCropMarkDebugArtBoxColor
(string) - The color of the ArtBox lines.drawCropMarkDebugArtBoxWidth
(number) - The width of the ArtBox lines.drawCropMarkDebugBleedBoxColor
(string) - The color of the BleedBox lines.drawCropMarkDebugBleedBoxWidth
(number) - The width of the BleedBox lines.drawCropMarkDebugCropBoxColor
(string) - The color of the CropBox lines.drawCropMarkDebugCropBoxWidth
(number) - The width of the CropBox lines.drawCropMarkDebugTextBoxColor
(string) - The color of the text zones configured bydrawCropMarkTextHorizontalMargin
anddrawCropMarkTextVerticalMargin
.drawCropMarkDebugTextBoxWidth
(number) - The width of text zones configured bydrawCropMarkTextHorizontalMargin
anddrawCropMarkTextVerticalMargin
.drawCropMarkDebugTrimBoxColor
(string) - The color of the TrimBox lines.drawCropMarkDebugTrimBoxWidth
(number) - The width of the TrimBox lines.
Note
Colors can be specified using the DesignAtoms format, for example:
"cmyk(10%, 20%, 30%, 40%, 100%)"
"rgb(0.1, 0.2, 0.3)"
"pink"
(in this case, the RGB color space is used).
If a single artifact (
result
) is expected as the output, all generated files will be packed into one archive.If a collection of artifacts (
result*
) is expected as the output, each generated file will be packed into a separate archive.
Example
{
"description": "Draw cropmarks",
"name": "draw-crop-marks",
"type": "draw-crop-marks",
"inputArtifacts": [
"vdpresult*"
],
"parameters": {
"drawCropMarkCropSizeHorizontal": 20,
"drawCropMarkCropSizeVertical": 20,
"drawCropMarkCropWhiteLineWidth": 5,
"drawCropMarkCropBlackLineWidth": 1,
"drawCropMarkText": "Hello there!",
"drawCropMarkTextFontName": "ArialMT",
"drawCropMarkTextFontSize": 12,
"drawCropMarkTextPosition": "Top",
"drawCropMarkOutputArchiveType": "Zip"
},
"outputArtifacts": [
"result"
]
}