Script Reference : Markup

A Markup object represent watermarks, page numbers, watermarks etc.

Data Members
Name Type Description
type string Read only. Valid values are: string, image, poly.
pos,org Point Item bind point. Normalized coordinates from 0 to 1
angle float Angle. In degrees. Counter clockwise.
binding string Markup target.
paper Whole sheet of paper
workarea Sheet work area.
gutter Gutter
cell Cell of table in case of NxN layout.
subpage Source page. Coordinates are in original page space.
id int 
Item identifier. Can be set only once.
SRCPAGENUM 1
PAPERNUM  2
C_CALLOUT  5
R_CALLOUT  6
LINE 7
ARROW 8
RECT  9
CIRCLE  10
FREEHAND 11
CLOUDS 12
POLYLINE 13
POLYGON 14
Custom values >=100

color Color Text color
alpha float Text opacity
topmost bool On by default
sheetFirst bool Visible on the first sheet of paper. In case of binding to cell or subpage this flag is related to source page.
sheetLast bool Visible on the last sheet of paper.
sheetMiddle bool Visible on all other sheets.
mirrorPosition bool Mirror position for booklets.
fitToPage bool Fit markup shape to page (obsolete).
even bool Visible on the even pages
odd bool Visible on the odd pages
sheetCustom int Visible on selected sheet of paper.
Text
font
Font Markup font.
outline true text only
text string text only
shape int 1 - rect border
2 - rounded rect border
3 - circle
filled shapes:
100 - rect
101 - rounded rect
102 - circle
103 - right arrow
104 - left arrow
105 - triangle
106 - rhombus
107 - pentagon
108 - hexagon
109 - heptagon
110 - octagon
111 - 5 star
112 - 6 star
113 - 7 star
114 - 8 star
115 - 9 star
116 - 10 star
117 - 12 star
118 - 16 star
shapeBorder float Border width.
shapeFixedSize bool Fixed shape size or relative.
shapeEnlarge float  
shapeHeight float Height of item in mm. Text and Image markups only. Read only for images.
shapeWidth float Width of item in mm. Text and image markups only. Read only for images.
targetMarker int Leader line marker type:
MARKER_NONE 0
MARKER_OPEN 1
MARKER_CLOSE 2
MARKER_BOX 3 - not supported yet
MARKER_ROUND 4 - not supported yet
targetMarkerSize float Size of leader marker.
targetPoint Point Leader line target point.
callout bool Callout mode on/off.
textAlign string Text align mode. Available values are: "left","right","center".
Image
dpi
   
file string Current image file. Read and write.
     
Line
   
     
     

 

Constructors
Name Description
  markup object may exist in layout or source page only and can be retrieved or created by methods of these objects only.

 

Methods
Name Return Type Description
bool SetFile(String) bool Set image for image type markup

 

 Where iarea defines type of information to retrieve. Size of page may be different due to rotation and cropping.
0 - current page, 1 - original non rotated job page, 2 - original optionally rotated page.

 

 

Watermark Sample

 

local m = layout.CreateMarkup("string");
if(m)
{
    m.pos=Point(0.5,0.5);
    m.text="Test String";
    m.alpha=0.5;
    m.angle=45;
    m.color=Color(255,0,0);
    local f=m.font;
    f.height=36;
    f.name="Verdana";
    m.font=f;
    m.outline=true;
}

Image watermark:

local m = layout.CreateMarkup("image");
if(m)
{
    m.pos=Point(0.5,0.5);
    m.dpi=300;
    m.file="C:/temp/img.jpg";
    m.angle=15;
}

Image markup attached to source page:

llocal page=window.GetDocument().GetPage(0);
local m = page.CreateMarkup("image");
if(m)
{
    m.pos=Point(0.5,0.5);
    m.dpi=300;
    m.file="C:/temp/img.jpg";
    m.angle=15;
}