Work with Other SDKs
PDF Create
  |  
Home ›› XDoc.PDF ›› C# PDF: PDF Create

C# PDF - PDF Creating in C#.NET


Tell Users How to Create New PDF File and Load PDF from Other Files




Free PDF creator SDK for Visual Studio .NET


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


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 Using C#



Create PDF from Microsoft Word, Excel, PowerPoint


Create PDF from Tiff


Create PDF from Jpeg, png, images


Create PDF from Open Office files


Create PDF from CSV




C# Project: PDF Creator Library DLLs



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;




Create a new PDF Document with one Blank Page in C# 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);





Load 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");
//  ...





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");
    //  ...
}