Create PDF text document in VB.NET
A sample application using PDFBuilderX
This example shows how to create a PDF document containing text and to format that text in a number of ways, using VB.NET.
To use this demo, you will need to download two files:
Install PDFBuilderX, then extract the VB.NET demo files from pbxtext1vbnet.zip, keeping the same directory structure. Start VB.NET, and open the project in solution file 'PBX_Text1_VBNET\PBX_Text1_VBNET.sln'.
Run the project and you will be guided through three steps to create a PDF file.
The first step is to select and load a font. The second step is to add a block of text after setting various configuration parameters.Finally, the PDF file is saved to disk.
The font to be used for the demo must be a TrueType font (.ttf file). The file name must be entered into the text box before clicking the 'Load Font' button. The file will be loaded from the Fonts subdirectory of the Windows directory. If a file from a different location is to be used, the code in Sub cmdLoadFont_Click must be modified accordingly.
The units of measure can be selected when adding the text. These units will be used for the value of the width used for wrapping text and for the location on the page where the text will be written. The location is measured from the bottom left corner of the page.
After saving the file, view the file in a suitable PDF viewer such as Adobe Acrobat Reader, to see the effect of the configuration parameters that were chosen.