<< Click to Display Table of Contents >> Inserting (dumping) a Template at a specific position in a VPE Document |
![]() ![]() ![]() |
As you design the layout of a template in dycodoc, you specify the positions of the objects on a page. Sometimes it can be neccessary to dump the complete template at a different position in a VPE Document.
You can use a trick in order to do so: first of all, as you layout a template, make the topmost object dependent to the top margin of the document. All other objects of the template should also be made dependent either relative to the first object, or to the top margin or to another object which is dependent to the top margin. In other words: all objects need to be dependent directly - or indirectly - to the top margin. Make sure that the lowest object is the last object in the template.
Afterwards create the following program code (schematic):
call LoadTemplate()
set Template.Master = False
for i = 1 to 100
set the Fields to the desired values
call DumpTemplate()
set VPE.nTopMargin = VPE.nBottom + 0.50 // add 0.5cm
Next i
The above code will insert 100 times the same template into the VPE Document, where each template has an offset of 0.5cm to the previous dumped template.
Note, that Template-Master is set to false, otherwise the settings for the margins are copied from the template to the document.