AccusoftPrintPro8 ActiveX DLL > PrintPro Object : TemplateFile Property |
The photograph collage description file name.
Visual Basic |
---|
Public Property TemplateFile As String |
The use of a TemplateFile provides a simplified access to PrintPicture and PrintDIB.
A collage template file is a text file of particular format that describes component image size and location. The first line is a format and version control line so that future modifications may be supported transparently and is as follows:
Accusoft PrintPRO Template Version 1 Units = TW | PO | PI | CH | IN | MI | CE
Use only one of the unit indicators. They represent Twips, Point, Pixel, Character, Inches, Millimeter and Centimeter. The first two characters are sufficient for selecting the unit used to describe location and dimensions.
Each subsequent line describes the location and cropping of a component image. A line consists of a delimited (by comma, space, spaces or tab) series of values: Left, Top, Width, Height, SourceLeft, SourceTop, SourceWidth, SourceHeight and an Aspect flag.
If the source parameters are omitted, then the entire source image is inserted. For example:
Accusoft PrintPRO Template Version 1 Units = IN
0,0,8.5,11.0, 0 ' Full size background image, stretch to fit
1.0, 1.0, 4.0, 5.0 ' Insert a 4x5 an inch in from the top left corner
4,5,4.5,6 ' Fill the bottom right corner
3, 2, 1, 1, 7, 0, 1, 1 ' Clip a 1x1 section out of the top right corner of an image and insert it
See PrintDIB for the particulars on these parameters.
The following is an example of building a collage:
Private Sub TiffPrint1_Click()
Dim BaseDir As String
BaseDir = "C:\Develop\PrintPRO\PhotoTest"
PrintPRO.SelectDefaultPrinter
' PrintPRO.PictureTransparent = True
PrintPRO.PrintToFile = True
PrintPRO.SaveFileType = PP_TIF
PrintPRO.OutputFileName = BaseDir & "\Collage.tif"
PrintPRO1.StartPrintDoc
' Page 1
Ixp.FileName = BaseDir & "\Accusoft111.jpg"
PrintPRO.hDIB = Ixp.hDIB
PrintPRO.PrintTemplateDIB 0
Ixp.FileName = BaseDir & "\exif.jpg"
PrintPRO.hDIB = Ixp.hDIB
PrintPRO.PrintTemplateDIB 0
Ixp.FileName = BaseDir & "\jeansFix.jpg"
PrintPRO.hDIB = Ixp.hDIB
PrintPRO.PrintTemplateDIB 0
Ixp.FileName = BaseDir & "\MainTest.bmp"
PrintPRO.hDIB = Ixp.hDIB
PrintPRO.PrintTemplateDIB 0
Ixp.FileName = BaseDir & "\Blue hills.bmp"
PrintPRO.hDIB = Ixp.hDIB
PrintPRO.PrintTemplateDIB 0
‘ Page 2 generated because template file wraps which is a implicit new-page
Ixp.FileName = BaseDir & "\Accusoft111.jpg"
PrintPRO.hDIB = Ixp.hDIB
PrintPRO.PrintTemplateDIB 0
Ixp.FileName = BaseDir & "\monet.jpg"
PrintPRO.hDIB = Ixp.hDIB
PrintPRO.PrintTemplateDIB 0
Ixp.FileName = BaseDir & "\jeansFix.jpg"
PrintPRO.hDIB = Ixp.hDIB
PrintPRO.PrintTemplateDIB 0
Ixp.FileName = BaseDir & "\exif.jpg"
PrintPRO.hDIB = Ixp.hDIB
PrintPRO.PrintTemplateDIB 0
Ixp.FileName = BaseDir & "\MainTest.bmp"
PrintPRO.hDIB = Ixp.hDIB
PrintPRO.PrintTemplateDIB 0
PrintPRO.EndPrintDoc
End Sub
The Template file places images only at this time. Draw text and other objects (circles, rectangles, etc.) using the appropriate Draw method.