|
A very simple PDF In this first lesson we'll learn how to create a PDF file with the legendary string "Hello world inside". From this moment on, we'll use VB6 as our IDE, but the syntax is IDENTICAL for all other IDEs (Delphi, CBuilder, PowerBuilder...). The source code of the project can also be found here. First of all, let's open VB6 and create a new project; add to the project's references the PDFReport_XP library, then draw a button on the form and double click it; inside the event handler skeleton, type this code:
The first line declares an Object of type "PDFDocument" and creates an instance of it.
The third line draws the text string "Hello World!" at 10 mm from top and 10 mm from left border of the page. The point of the text from which misuring the distances is the bottom left corner. The last line saves the PDF file created with the name you want. The result of this code is shown here:
|