Neevia Technology Sites:   www.neevia.com  |  docuPub.com  |  www.neeviaPDF.com
:: Home :: Products :: Technical Support :: About Us :: Contact Us
Technical support > Neevia docuPrinter SDK code samples
Example 1: How to create a simple PDF file from VB.NET  Print Example 

Private Sub Button1_Click(ByVal sender As System.Object, _
                              ByVal e As System.EventArgs) Handles Button1.Click

    Dim prn As New System.Windows.Forms.Printing.SimplePrintDocument

    Dim DPSDK As Object = CreateObject("docuPrinter.SDK")

    prn.FontName = "Times New Roman"
    prn.FontSize = 48
    prn.DrawText(0, 0, "Hello from VB.NET !!!")

    DPSDK.DocumentOutputFormat = "PDF"
    DPSDK.DocumentOutputFolder = "c:\"
    DPSDK.DocumentOutputName = "testVBNET"

    DPSDK.HideSaveAsWindow = True
    DPSDK.DefaultAction = 1
    DPSDK.ApplySettings()

    prn.PrinterSettings.PrinterName = "docuPrinter"
    prn.Print()

    Dim RVal As Long = DPSDK.Create()

    prn = Nothing
    DPSDK = Nothing

    If (RVal <> 0) Then
      MsgBox("Error while creating the document!!!")
    Else
      MsgBox("Done !!!")
    End If

End Sub



Copyright © 1999-2016 Neevia Technology. All Rights Reserved. Home | Products | Technical Support | About Us | Contact Us