XDoc.PDF
Features
Tech Specs
How-to C#
How-to VB.NET
Pricing
Work with Other SDKs
PDF Create
  |  
Home ›› XDoc.PDF ›› C# PDF: PDF Create

C#.NET PDF - Create PDF in C# Using .NET XDoc.PDF SDK


Tell C#.NET Users How to Create New PDF File and Load PDF from Other Files with C#.NET PDF SDK




Free PDF creator SDK for Visual Studio .NET C# class


Batch create adobe PDF from multiple forms


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


Best C#.NET component to create searchable PDF document from Microsoft Office Word, Excel and PowerPoint


Gratis control for creating PDF from multiple image formats such as tiff, jpg, png, gif, bmp, etc


Create writable PDF from text (.txt) file


HTML webpage to interactive PDF file creator freeware


Create multipage PDF from OpenOffice and CSV file


Create and save editable PDF with a blank page, bookmarks, links, signatures, etc


Create fillable PDF document with fields in .NET WinForms application


Load PDF from existing documents and image in SQL server


Load PDF from stream programmatically


Preview PDF documents without other plug-ins


Able to download free trial and use online example source code in C# class


Professional PDF creating library, built on .NET Framework 2.0


Compatible with any Windows 32 or 64 bit system


C#.NET PDF document file creating library control, RasterEdge XDoc.PDF SDK for .NET, is a robust & thread-safe .NET solution which provides a reliable and quick approach for C# developers to create a highly-secure and industry-standard PDF document file. The PDF document file created by RasterEdge C# PDF document creator library is searchable and can be fully populated with editable text and graphics programmatically.


This Visual C# .NET PDF document creation control toolkit can not only allow developers to generate standard PDF document file but also offer them the ability to count the page numbers of generated PDF document by simple C# programming code. As this PDF document creator library is built on .NET Framework 2.0 and designed specifically for .NET applications, C# developers can easily use this professional PDF document generating SDK in all .NET developing applications, including ASP.NET web services and Windows Forms application.


After creating a PDF document in C#.NET using this PDF document creating toolkit, if you need to add some text and draw some graphics on created PDF document file, you can also use this C#.NET PDF document drawing library control. Besides, using this PDF document metadata adding control, you can add some additional information to generated PDF file. What's more, you can also protect created PDF file by adding digital signature (watermark) on PDF using C# code.




Create PDF Document from Existing Files in C#.NET



C#.NET Create PDF from Word


This page tells C# users how to create PDF document from Microsoft Word in Visual C# .NET application using related .NET dlls and C# demo code for .NET framework.


C#.NET Create PDF from Excel


This page gives a guide on how to create PDF document from Microsoft Excel in Visual C# .NET application using related .NET dlls and C# demo code for .NET framework.

C#.NET Create PDF from PowerPoint


This page illustrates how to create PDF document from Microsoft PowerPoint in Visual C# .NET application using related .NET dlls and C# demo code for .NET framework.

C#.NET Create PDF from Tiff


This page provide a guide on how to create PDF document from Tiff image in Visual C# .NET application using related .NET dlls and C# demo code for .NET framework.


C#.NET Create PDF from Images


This page will guide C# users how to create PDF document from images in Visual C# .NET application using related .NET dlls and C# demo code for .NET framework.


C#.NET Create PDF from OpenOffice


This page will help C# developers to create PDF document from OpenOffice document in Visual C# .NET application using related .NET dlls and C# demo code for .NET framework.

C#.NET Create PDF from CSV


This page shows how to create PDF document from CSV file in Visual C# .NET application using related .NET dlls and C# demo code for .NET framework.


C#.NET Create PDF from RTF


This page tells C# users how to create PDF document from RTF file in Visual C# .NET application using related .NET dlls and C# demo code for .NET framework.


C#.NET Create PDF from Text


This page tells C# users how to create PDF document from text file (.txt) in Visual C# .NET application using related .NET dlls and C# demo code for .NET framework.






C#.NET PDF DLLs for Creating PDF Document in Visual C# .NET Project



In order to run the sample code, the following steps would be necessary.


Add necessary references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Raster.dll


  RasterEdge.XDoc.Raster.Core.dll


  RasterEdge.XDoc.PDF.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PDF;




C#.NET Demo Code for Creating a New PDF Document with One Blank Page in C#.NET Project



In C# class programming, you can use specific APIs to create PDF file. And the PDF document can contain one empty page or multiple empty pages. The following example will tell you how to create a PDF document with 2 empty pages.




String outputFile = Program.RootPath + "\\" + "output.pdf";

//  Create a new PDF Document object with 2 blank pages
PDFDocument doc = PDFDocument.Create(2);

//  Save the new created PDF document into file
doc.Save(outputFile);





C#.NET Demo Code for Loading PDF Document from Existing PDF File Using C#



You may also load or create a PDF document object from existing PDF file in C#.net.




//  Load from a file
String inputFilePath1 = Program.RootPath + "\\" + "1.pdf";
PDFDocument doc1 = new PDFDocument(inputFilePath1);
if (doc1 == null) throw new Exception("fail to load the file");
//  ...





C#.NET Demo Code to Load PDF from Stream Object in C# Project



PDF document can be loaded from a stream object in C# programming.




//  Load from a stream
String inputFilePath2 = Program.RootPath + "\\" + "2.pdf";
using (FileStream fileStream = File.Open(inputFilePath2, FileMode.Open, FileAccess.Read))
{
    PDFDocument doc2 = new PDFDocument(fileStream);
    if (doc2 == null) throw new Exception("fail to load PDF document from the stream");
    //  ...
}