English | 日本
C++ PDF
Shopping Cart Contact Us Java PDF
Adobe C++
C# PDF

Here is how to create PDF C# Apps quickly without writing any code

  1. Download easy PDF SDK.
  2. Run easy PDF SDK Action Center.
  3. Select C# as your programming language.
  4. Optional: Select your input document type to create PDF.
  5. Optional: Select the features you want in the PDF you will create.
  6. Generate a sample PDF C# App.
  7. Or download C# code or a C# project to include in your PDF App.

If you want to write your own code, few lines of C# code are all it takes to convert Word to PDF for your .C# application::

...
Type type = Type.GetTypeFromProgID("easyPDF.Loader.8");
Loader oLoader = (Loader) Activator.CreateInstance(type);

Printer oPrinter = (Printer) oLoader.LoadObject("easyPDF.Printer.8");

PrintJob oPrintJob = oPrinter.PrintJob;
oPrintJob.PrintOut(Server.MapPath (@".\input.doc"), Server.MapPath(@".\output.pdf"));
...

Comprehensive PDF C# API features

BCL easy PDF SDK comes with all the PDF features that you may need in developing enterprise .C# server applications:

  • Create PDF
  • Process PDF
  • Rasterize PDF
  • PDF Form

How to create PDF using C# in .NET Server Application

...
Type type = Type.GetTypeFromProgID("easyPDF.Loader.8");
Loader oLoader = (Loader)Activator.CreateInstance(type);

Printer oPrinter = (Printer)oLoader.LoadObject("easyPDF.Printer.8");

PrintJob oPrintJob = oPrinter.PrintJob;
oPrintJob.PrintOut(Server.MapPath(@".\input.doc"), Server.MapPath(@".\output.pdf"));
...
                  


How to write C# Programs to Process and Manipulate PDF in .C# (Merging PDFs, Splitting PDF, Extracting Text from PDF, etc)

  • Read the PDFProcessor Object Specification
    This object lets you do post-processing of existing PDF files (such as merging multiple PDF files into one, splitting one PDF file into two, and encrypting/decrypting a PDF file)

Merging PDF Files

...
Type type = Type.GetTypeFromProgID("easyPDF.Loader.8");
Loader oLoader = (Loader)Activator.CreateInstance(type);

PDFProcessor oProcessor = (PDFProcessor)oLoader.LoadObject("easyPDF.PDFProcessor.8");

// merge two files using Merge
oProcessor.Merge(Server.MapPath(@".\input1.pdf"), Server.MapPath(@".\input2.pdf"), Server.MapPath(@".\merged.pdf"));

// merge more than two files using MergeBatch
string[] inputFiles = new string[] 
{ 
   Server.MapPath(@".\input1.pdf"),
   Server.MapPath(@".\input2.pdf"),
   Server.MapPath(@".\input3.pdf") 
};
oProcessor.MergeBatch(inputFiles, Server.MapPath(@".\merged.pdf"));
...
                  

 

Splitting PDF

...
Type type = Type.GetTypeFromProgID("easyPDF.Loader.8");
Loader oLoader = (Loader)Activator.CreateInstance(type);

PDFProcessor oProcessor = (PDFProcessor)oLoader.LoadObject("easyPDF.PDFProcessor.8");

// split the document at page 3
oProcessor.Split(Server.MapPath(@".\input.pdf"), Server.MapPath(@".\part1.pdf"), Server.MapPath(@".\part2.pdf"), 3);
...
                  

 

Extracting Text from PDF

...
Type type = Type.GetTypeFromProgID("easyPDF.Loader.8");
Loader oLoader = (Loader)Activator.CreateInstance(type);

PDFProcessor oProcessor = (PDFProcessor)oLoader.LoadObject("easyPDF.PDFProcessor.8");

// extract text from pages 1 through 4 to a physical file using ExtractText
oProcessor.ExtractText(Server.MapPath(@".\input.pdf"), Server.MapPath(@".\extracted.txt"), null, 0, 3, null, null);

// extract text from a bounding box on page 1 to a string variable using ExtractText2
string text = oProcessor.ExtractText2(Server.MapPath(@".\input.pdf"), 0, 0, 0, 300, 300, null);
...
                  

 

How to write C# Program to Rasterize PDF in .C#

...
Type type = Type.GetTypeFromProgID("easyPDF.Loader.8");
Loader oLoader = (Loader)Activator.CreateInstance(type);
 
PDFConverter oConverter = (PDFConverter)oLoader.LoadObject("easyPDF.PDFConverter.8");
 
PDF2Image oPDF2Image = oConverter.PDF2Image;
oPDF2Image.Convert(Server.MapPath(@".\input.pdf"), Server.MapPath(@".\output.jpg"), null, null, null);
...
                  

How to write C# Program to Process PDF Form Fields in .NET

Download the input.pdf form (line 27 below)

// this example takes the first two fields in a PDF template
// which are Name and Address, and populates them with 
// values of "BCL Technologies" and "Santa Clara, CA"
 
Type type = Type.GetTypeFromProgID("easyPDF.Loader.8");
Loader oLoader = (Loader)Activator.CreateInstance(type);
 
PDFDocument oDocument = (PDFDocument)oLoader.LoadObject("easyPDF.PDFDocument.8");
 
oDocument.Open(Server.MapPath(@".\input.pdf"));
 
// get all form fields from the PDF
 
FormFields oFormFields = oDocument.FormFields;

// get the first form field
FormField oFormField = oFormFields[0];
 
TextField oTextField;
 
if (oFormField.Type == docFormFieldType.DOC_FRMTYPE_TEXT && oFormField.Name == "Name")
    {
        // set Name to "BCL Technologies"
        oTextField = (TextField)oFormField;
        oTextField.Value = "BCL Technologies";
    }

// get the second form field
oFormField = oFormFields[1];

if (oFormField.Type == docFormFieldType.DOC_FRMTYPE_TEXT && oFormField.Name == "Address")
    {
        // set Address to "Santa Clara, CA"
        oTextField = (TextField)oFormField;
        oTextField.Value = "Santa Clara, CA";
    }
oDocument.SaveAs(Server.MapPath(@".\output.pdf"));
                  

 

Download Free Trial

Request Pricing

QuickStart Video
PDF C++ Watch a QuickStart Video to see how easy it is to convert Word to PDF.
Complete PDF Features
  • easy PDF SDK setup was very straightforward, unlike our experience with other products. We wrote just a few lines of code to start using it.” Read the case study

Here are the things you can do you with Java and easyPDF SDK

- With easyPDF SDK you can easily create a C# Application that Prints a variety of document types to PDF Files.
- The Printer API of easyPDF SDK can be used from C#, Java, and other Common Programming Languages to convert documents to pdf easily and efficiently.
- Using the PDFProcessor.PrintToPhysicalPrinter method available in easyPDF SDK, you can use a C# application to print a pdf file to a specific Printer of your choice. Any printer defined on your machine and visible in the "Devices and Printers" window can be printed to using only their Printer Name.

 
© 1993 - , BCL Technologies.
All other trademarks are the property of their respective owners.