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 C#  Print Example 

Note: Add a reference in your Visual Studio project to docuPrinter library.
To do this:
  • On the Project menu, click Add Reference;
  • On the COM tab, locate docuPrinter Library and then click Select;
  • Click OK in the Add References dialog box to accept your selections.
private void button1_Click(object sender, EventArgs e)
{

    System.Windows.Forms.Printing.SimplePrintDocument prn =
      new System.Windows.Forms.Printing.SimplePrintDocument();
    docuPrinter.SDK DPSDK = new docuPrinter.SDK();

    prn.FontName = "Times New Roman";
    prn.FontSize = 48;
    prn.DrawText(0, 0, "Hello from VC# !!!");

    DPSDK.DocumentOutputFormat = "PDF";
    DPSDK.DocumentOutputFolder = @"c:\";
    DPSDK.DocumentOutputName = "testCSHARP";

    DPSDK.HideSaveAsWindow=true;
    DPSDK.DefaultAction=1;
    DPSDK.ApplySettings();

    prn.PrinterSettings.PrinterName = "docuPrinter";

    prn.Print();

    int RVal = DPSDK.Create(100);

    prn = null;
    DPSDK = null;

    if (RVal != 0) {
       MessageBox.Show("There was an error!!! Rval=" + RVal.ToString());
    } else {
       MessageBox.Show("Done !!!");
    }

}



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