Modify a document page
Use the OnPage exit point to manipulate a particular page of the document. To do so, you can use the same functions and variables as in the StreamingUnit context. In addition, a set of calls is available to make changes to the page.
To configure the context for the OnPage exit point, follow these steps:
- In the
Navigator lower pane, find and double-click
CCM_Streaming.
The process appears in the central pane.
- Click
Streaming in the lower central pane.
- In the
Action section on the right, set the
OnPage parameter to a script that has the
StreamingPage context.
When the parameter is set, the configured script is called automatically whenever a stack is processed.
To create and modify the script, use the functions and variables listed in Properties of the StreamingPage context.
In addition to the general functions and variables, to modify the content of the current page, you can also use the following block of calls and variables:
- EditPage()
- Post()
- SetFont(string fontName, int fontSize)
- TextOut(double x, double y, string text, bool bold, bool italic)
- TextOut(double x, double y, string text, bool bold, bool italic, OdinPageLayer layer)
- Line(double x1, double y1, double x2, double y2)
- Line(double x1, double y1, double x2, double y2, OdinPageLayer layer)
- Rectangle(double x, double y, double width, double height, bool fill, string fillColor)
- Rectangle(double x, double y, double width, double height, bool fill, string fillColor, OdinPageLayer layer)
- TextOut(double x, double y, string text, bool bold, bool italic, string color, int angle)
- TextOut(double x, double y, string text, bool bold, bool italic, string color, int angle, OdinPageLayer layer)
- Line(double x1, double y1, double x2, double y2, double lineWidth, OdinLineStyle lineStyle, string color)
- Line(double x1, double y1, double x2, double y2, double lineWidth, OdinLineStyle lineStyle, string color, OdinPageLayer layer)
- Rectangle(double x, double y, double width, double height, double lineWidth, OdinLineStyle lineStyle, string lineColor, bool fill, string fillColor)
- Rectangle(double x, double y, double width, double height, double lineWidth, OdinLineStyle lineStyle, string lineColor, bool fill, string fillColor, OdinPageLayer layer)
- Image(double x, double y, string imageFileName)
- Image(double x, double y, string imageFileName, OdinPageLayer layer)
- AddBookmark(string id, string parentId, string title)
- AddBookmark(string id, string parentId, string title, double x, double y)
- AddComment(string value)
- AddPJLCommand(string value)
- SetAfpCopyGroup(string copyGroup)
For more information on these calls, see the chapter Scripting functions.
Example script
Try
Label = GetOrganisationalMetadata ("Label")
OnError()
Label = "Generic Corporate Brand"
End-Try
If (HasSender)
Label = Label + " :: " + GetSenderData ("Department")
End-If
If (HasRecipient)
Agent = GetRecipientData ("AgentName")
End-If
EditPage ()
SetFont ("Courier New", 12)
TextOut (75, 51, Label, false, false)
TextOut (75, 60, Agent, false, false)
Post()
This example puts the marker on the current page (through the
OnPage event).
Also, you can insert a bar code on the page with the AddBarcode function as shown here.
EditPage ()
Bar = AddBarcode()
Bar.Type = "EAN 13"
Bar.CheckDigits = 1
Bar.Data = "978159059389"
Bar.Readable = true
Bar.Angle = 90
Bar.X = 12
Bar.Y = 3
Bar.Height = 10
Bar.Width = 30
Bar.Post()
Post()
For a description of the function parameters and explanation of the example, see the next section.