About IDEAL Software Conception of VPE Short Programming Examples Overview: The Different Editions Press Reports, References and Customer's Letters Downloads Ordering Information Information about Updates and Upgrades Infos, Service Releases, FAQ Forum Send an e-mail to IDEAL Software
Home Conception Examples Editions References Download Ordering Update Info Support Forum e-Mail

Examples

"Excellent service!! You guys are great."
Tom Bergman, SilverPlatter Information Inc., Boston, USA
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.

endless.jpg (8871 Byte)

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
  1. Open a virtual document with the method "OpenDoc"
  2. Use all possible output methods
  3. Use "Preview" to show the preview, "PrintDoc" to print the document or
    "WriteDoc" to create a PDF document
  4. Close the document with "CloseDoc"

 

NET logo.jpg (2382 Byte) 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

 

NET logo.jpg (2382 Byte) 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();
}

 

activex.gif (11436 Byte) 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

 

BorlandPartnerLogo.gif (1246 Byte) 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 Overview: The Different Editions