VB2PDF |
Name |
VB2PDF.cls |
Version |
1.2 |
Author |
Marco Nicolato (mnicolato@hotmail.com) |
WEB Site |
http://freeweb.lombardiacom.it/mnicolato |
License type |
email-ware (send me an e-mail if you use it !) |
Description |
VB2PDF is a simplex, pure VB driver to create a PDF
file, |
Download |
Download here the source |
HISTORY
2000/10/24 |
First release 1.0 |
2002/02/21 |
Release 1.1: fixed the use with Acrobat 5 |
2003/05/30 |
Release 1.2: added positioning & text rotation |
PROPERTIES
FileName |
File name with full path and extension (usually .PDF) |
Title |
If you fill these info, them will be showed in the document property of Acrobat Reader |
PaperSize |
The paper size, you can use one of these symbolic
constants: |
LandScape |
True or False: if TRUE, the page layout will be rotated by
90° |
TopMargin |
Margin from the top of the page |
LeftMargin |
Margin from the left of the page |
FontSize |
Font size |
FontType |
Font aspect: you can use one of these symbolic
constants: |
VertSpace |
The spacing between the rows |
METHODS
StartPDF() |
Create the file and initialize all objects |
WritePDF( |
Write <text> in the PDF file, and if <newline> is TRUE the text will start on a new line; optionally with <fonttype> you can select the aspect of the text (bold, italic, bolditalic or regular) |
SetOrigin( |
Set text origin at <nStartX>, <nStartY>
coordinates, and text <nDegree> rotation (optional, 0
default) |
NewPage() |
Start a new page |
EndPDF() |
Close the document and all the objects: the .PDF is ready to be distributed |
Example:
Dim myPDF As New
VB2PDF
myPDF.PaperSize = pdfA4
myPDF.FileName =
"c:\temp\test.pdf"
myPDF.StartPDF
myPDF.WritePDF
"Hello world !", True
myPDF.WritePDF "This is a new
row ", True
myPDF.WritePDF "and I can write in BOLD ",
False, pdfBold
myPDF.WritePDF "or ITALIC ", False,
pdfItalic
myPDF.WritePDF "or BOTH !", False,
pdfBoldItalic
myPDF.WritePDF "And so and so ...", True
'
Text Rotation sample
Dim i As Long
For i = 0 To 345 Step
15
myPDF.SetOrigin 300, 500,
i
myPDF.WritePDF "--- NEW - text
rotated by " & i & "°", False,
pdfRegular
Next
myPDF.NewPage
myPDF.WritePDF "This is
another page !", True
myPDF.EndPDF
Useful link:
- The PDF Reference Manual Version 1.3 (about 5 MB)