VB.NET: Generate PDF Document

How to Generate, customize PDF documents using VB.NET
Yiigo provides .NET PDF generating support included in Yiigo.Image for .NET, which can be easily added to your document imaging applications with fully-featured PDF generating, editing, manipulating, saving and printing functionalities. Find more PDF generating information on Yiigo.Imaging for .NET PDF Generating Plugin.
Yiigo.Imaging for .NET PDF Generating Plugin has those following functionalities:
  • Create or Write PDF documents from file or Stream
  • Create PDF document in a few minutes
  • Customize PDF document according to your needs, such as deskew, binarize, despeckle
  • Embed barcode, compressed images and more into PDF documents
  • Encrypt and decrypt PDF documents when you need
  • Add and edit the bookmarks of a PDF
  • Save PDF documents into local folder or other device
  • Print PDF document via compatible printers
For VB.NET developers, Yiigo provides online tutorials to generate, customize, save and print PDF documents using Yiigo.Image for .NET and .NET PDF Generating Plugin in details. Find more PDF generating tutorials on PDF Generating Support for Visual C#.NET, Web Imaging Viewer PDF Generating Support and Generate PDF Documents in .NET Winforms.
Generate PDF Documents with VB.NET Sample Code


Before generating and manipulating PDF documents in VB.NET, make sure that you have installed.

Start to Generate PDF Documents

  • Start your Microsoft Visual Studio;
  • Choose "Project" in "File-New" from the menu;
  • In "New Project" dialog box, choose "Visual Basic Projects";
  • Choose "Windows Application" in the "Templates" List and name it "YiigoImagingPdfGenerateVBNET";
  • In the "Solution Explorer" window from the context menu, right-click on the "References" folder, and select "Add Reference...";
  • In the "Add Reference" dialog box, select the ".NET" tab and browse to Yiigo.Imaging.Net.dll library and Yiigo.Imaging.Net.Pdf.Generate.dll;
  • Add it to your VB.NET applications;
  • Import Yiigo .NET Image Namespace & copy those following codes:
Imports System.IO
Imports System.Drawing.Printing
Imports Yiigo.Imaging
Imports Yiigo.Imaging.Processing
Imports Yiigo.Imaging.PdfGenerate

' Create a basic PDF
Dim pdf As New PDFGeneratorDocument()
Dim page As PDFGeneratorPage = DefaultPages.Letter
Dim font As String = New Font("Arial", 10F, FontStyle.Regular)
Dim line As New TextLine(font, 12, "Yiigo", New PdfPoint(72, 400))

' Add some graphics on PDF
Dim graphics As PDFGeneratorGraphics = DefaultPages.Letter
graphics.DrawRectangle = (System.Drawing.Color.Red, 5, new Rectangle(20, 20, 250, 200)
graphics.EllipseRectangle = (System.Drawing.Color.Red, 5, piont1(10.0F, 30.0F), Point2(50.0F, 30.0F))
graphics.BezierRectangle = (System.Drawing.Color.Red, 5, piont1(10.0F, 30.0F), Point2(50.0F, 340.0F))
piont3(15.0F, 55.0F), Point4(50.0F, 30.0F)))

' Save & print PDF
pdf.SaveToFile(String FilePath)
pdf.SaveToStream(Stream Stream)
Imaging Solution
Yiigo.Image for .NET
Online VB.NET Tutorial
VB.NET: Yiigo.Image for .NETVB.NET: How to StartVB.NET: Doc Management SolutionVB.NET: Web Doc ViewerVB.NET: How to Deploy SDK
Doc & Image Formats
VB.NET: PDFVB.NET: Create, Load, Save PDFVB.NET: PDF Doc ViewerVB.NET: Web PDF ViewerVB.NET: Windows PDF ViewerVB.NET: Mobile PDF ViewerVB.NET: Annotate PDFVB.NET: Convert PDFVB.NET: Convert PDF to BMPVB.NET: Convert PDF to GIFVB.NET: Convert PDF to JPEGVB.NET: Convert PDF to PNGVB.NET: Convert PDF to SVGVB.NET: Convert PDF to TIFFVB.NET: Compress PDF ImageVB.NET: Add PDF MetadataVB.NET: Extract PDF TextVB.NET: Process PDFVB.NET: Rotate PDF PageVB.NET: Add PDF PageVB.NET: Add Image to PDF PageVB.NET: Delete PDF PageVB.NET: Sort PDF PagesVB.NET: Merge PDF DocumentsVB.NET: Split PDF DocumentVB.NET: Read PDF BarcodeVB.NET: Generate PDF BarcodeVB.NET: Draw on PDFVB.NET: Draw PDF WatermarkVB.NET: TIFFVB.NET: WordVB.NET: DICOM
Advanced Functions
VB.NET: Image SDK ProgrammingVB.NET: Barcode ReadingVB.NET: Barcode GeneratingVB.NET: Twain ScanningVB.NET: OCR Recognition