| Introduction |
| We will show you with a few examples for different programming languages
how easily VPE can be used. Each example places the text "Hello World!" at the
position (1.5, 1) on the current page. VPE works device- independent in
a centimeter
coordinate system with 1/10.000 mm resolution (optionally you can switch to
an inch coordinate system). The coordinates are of type "double".
The coordinate (1.5, 1) means, the text is positioned with an offset of
1.5cm from the left
page border and 1cm from the top page border. |

|
| A JPEG image is inserted below the text at the position
(1.5, 2). VPE recognizes the image type
automatically by the file suffix. The VFREE parameters mean that VPE will compute the
bottom and the right borders of the image itself by extracting the size and resolution
from the image file and transforming it into the WYSIWYG system. The method
"WriteDoc()" creates a PDF file from the document. |
| The common
sequence of function calls |
- Open a virtual document with the method "OpenDoc"
- Use all possible output methods
- Use "Preview" to show the preview, "PrintDoc" to print the document
or
"WriteDoc" to create a PDF document
- Close the document with "CloseDoc"
|
 |
Example in Visual Basic .NET
The following example uses a VPE .NET component named
"Report". |
|
- Private Sub
Form1_Load(ByVal sender As
System.Object, ByVal e As
System.EventArgs)
- Report.OpenDoc()
- Report.Print(1.5, 1, "Hello World!")
- Report.Picture(1.5, 2, Report.nFree, Report.nFree,
"example.jpg")
- Report.WriteDoc("My Document.pdf")
- Report.Preview()
- End Sub
|
 |
Example in C#
The following example uses a VPE .NET component named
"Report". |
|
- private void Form1_Load(object sender, System.EventArgs
e)
- {
- Report.OpenDoc();
- Report.Print(1.5, 1, "Hello World!");
- Report.Picture(1.5, 2, Report.nFree, Report.nFree,
"example.jpg");
- Report.WriteDoc("My Document.pdf");
- Report.Preview();
- }
|
 |
Example in Visual Basic
The following example uses a VPE-ActiveX control
named "Report". |
|
- Private Sub Form_Load()
- Report.OpenDoc
- Report.VpePrint
1.5, 1, "Hello World!"
- Report.Picture
1.5, 2, VFREE, VFREE,
"example.jpg"
Report.WriteDoc "My Document.pdf"
Report.Preview
- End Sub
|
 |
Example in Delphi
The following example uses a VPE-VCL component named
"Report". |
|
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- Report.OpenDoc;
- Report.Print(1.5, 1, 'Hello World!');
- Report.Picture(1.5, 2, VFREE, VFREE, 'example.jpg');
- Report.WriteDoc('My Document.pdf');
- Report.Preview;
- end;
|
Example in
C/C++
The following example uses the VPE-DLL. |
- void Hello()
- {
- VpeHandle hDoc;
- hDoc = VpeOpenDoc(hWndParent, "Title", 0);
- VpePrint(hDoc,
1.5, 1, "Hello World!");
- VpePicture(hDoc,
1.5, 2, VFREE, VFREE,
"example.jpg");
- VpeWriteDoc(hDoc, "My Document.pdf");
- VpePreviewDoc(hDoc, NULL, VPE_SHOW_NORMAL);
- }
|
| The Resulting Preview |

View
the PDF Document
The examples here are intentionally simple ones. Many concepts which form the unique
quality of VPE, especially the dynamic layout features, are not shown here. Please
download the trial-version for more detailed information. |
| We
recommend to continue with the following link |
 |
Overview: The Different Editions |
|