XDoc.PDF
Features
Tech Specs
How-to C#
How-to VB.NET
Pricing
C# PDF: How to HTML5 Viewer & Editor PDF Create PDF Export File and Page Process PDF Read PDF Write Form Process Document Protect Annotation & Drawing PDF Print WPF Viewer & Editor Work with Other SDKs Barcode Read Barcode Create OCR Twain
PDF Print
  |  
Home ›› XDoc.PDF ›› C# PDF: PDF Print

C#.NET PDF SDK - Print PDF Document in C#.NET


.NET PDF Document Printer API SDK for Visual C# .NET Class Applications




A best PDF printer control for Visual Studio .NET and compatible with C# programming language


Quicken PDF printer library allows C# users to batch print PDF file in .NET framework


Free library control SDK for automatically printing PDF document online in ASP.NET WebForm application


Standalone and easy-to-use API allows C# developers to send a source PDF document file to an actual physical printer device


Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint


C# source code for printing PDF adobe PDF file in .NET Windows Forms project


Provide variety of printing options, like like number of copies, PDF document printing orientation, PDF document printing paper size and PDF document printing resolution


Fully-featured PDF document printing SDK can help to easily create a custom web-based client-server printing application or a custom Windows Forms project





C# print PDF documents programmatically


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:

       

       If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.

       

       If using x86, the platform target should be x86.




        #region print pdf document with default settings
        internal static void printPdf()
        {
            String inputFilePath = @"C:\demo.pdf";
            PDFPrinter.Print(inputFilePath);
        }
        #endregion

        #region print pdf stream from database
        internal static void printPdf(Stream stream)
        {
            //set printer settings
            PDFPrinterOption option = new PDFPrinterOption();
            PDFPrinter.Print(stream, option);
        }
        #endregion

        #region print pdf stream from database
        internal static void printPdf(byte[] srcData)
        {
            //set printer settings
            PDFPrinterOption option = new PDFPrinterOption();
            PDFPrinter.Print(srcData, option);
        }
        #endregion

        #region print pdf document with specified settings
        internal static void printPdfWithSpecifiedSettings()
        {
            String inputFilePath = @"C:\demo.pdf";
            
            //set printer settings
            PDFPrinterOption option = new PDFPrinterOption();
            PDFPrinter.Print(inputFilePath, option);
        }
        #endregion

        #region print specified pages of pdf document
        internal static void printPdfPages()
        {
            String inputFilePath = @"C:\demo.pdf";

            //set printer settings
            PDFPrinterOption option = new PDFPrinterOption();
            option.Duplex = Duplex.Horizontal;
            option.PrintRange = PrintRange.SomePages;
            option.FromPage = 2;
            option.ToPage = 4;
            option.Collate = true;
            option.Copies = 10;
            int offset = option.FromPage;
            int count = option.ToPage;
            //print 4 pages from second page.
            PDFPrinter.Print(inputFilePath, offset, count, option);
        }
        #endregion




.NET Class Namespace Required



Here we provide you guidance on how to use RasterEdge C# .NET PDF document printing add-on for high-quality and fast PDF file printing.


Make sure you have installed Visual Studio 2005 (or above versions) and .NET Framework 2.0 (or greater versions);


Add following dlls from C#.NET PDF document printer SDK to your C# project references;


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XDoc.PDF.dll