Why Docotic.Pdf is better than X

There are plenty of libraries for PDF processing. They all have some advantages and disadvantages. Some of them can open PDF documents very fast, some libraries can create well-looking documents, and some are quite low-level and allow you to create form fields rotated to 45 degrees. In this article I show you why Docotic.Pdf is an excellent alternative to other similar components.

Very easy to use

Each good library must encapsulate all complexity and provide handy API for client. PDF Reference itself has more than 1300 pages and it’s often quite hard to understand all the details. Our target was to give our clients extremely clean API, but to keep all power of PDF at the same time. Look at some examples, isn’t they are really simple?

1. Add copyright note to an existing PDF document:

PdfDocument document = new PdfDocument("Document.pdf");

string copyright = "Copyright 2008-2010 Bit Miracle.";
foreach (PdfPage page in document.Pages)
{
    RectangleF footer = new RectangleF(0, page.Height - 40, page.Width, 40);

    page.Canvas.DrawString(copyright, footer, PdfTextAlign.Center, PdfVerticalAlign.Top);
}

document.Save("DocumentWithCopyright.pdf");

2. Fill rectangle with CMYK color in specified color profile:

PdfDocument document = new PdfDocument();

PdfColorProfile colorProfile = document.AddColorProfile("JapanColor2001Coated.icc");

PdfCanvas canvas = document.Pages[0].Canvas;
canvas.Brush.Color = new PdfCmykColor(colorProfile, 20, 80, 70, 20);

canvas.DrawRectangle(new RectangleF(10, 10, 100, 50), PdfDrawMode.Fill);

document.Save("CmykColorProfile.pdf");

3. Create password-protected document and forbid printing:

PdfDocument document = new PdfDocument();

document.OwnerPassword = "owner";
document.UserPassword = "user";

document.Permissions.PrintDocument = false;

document.Save("Permissions.pdf");

Perfect examples and documentation

Best frameworks have detailed documentation for their API and a lot of samples in addition. Docotic.Pdf is not the exception.

It has clear MSDN-like documentation.

At the moment 54 examples for both C# and VB.NET exist. They cover all popular tasks of PDF processing such as filling form fields, merging several documents, extracting text and so on. For viewing the examples we’ve created the sample browser which allows you to become familiar with Docotic.Pdf very quickly. As a bonus sample browser allows you to modify and run existing samples without Visual Studio!

A screenshot of Sample Browser with Docotic samples

You can create any PDF document

Docotic.Pdf supports a lot of PDF features which help you to create great-looking documents. You can

  • Write text in different languages using any font you like.
  • Draw any images in your documents.
  • Create and fill in PDF forms.
  • Use events and actions.
  • Protect documents with password.
  • Create PDF/A compatible documents.
  • and more!

Optimized size of output PDFs

Docotic.Pdf optimizes PDF files before saving them. Let’s suppose you’re writing an article in Chinese. The problem here is that all fonts with Chinese symbols take a lot of disk space (often more than 15 Mb) and your document will be very large if you embed whole font in it. PDF standard itself doesn’t provide means for partial embedding of a font. So we’ve implemented our own font processing algorithm which helps Docotic.Pdf to embed only used subset of font. Using this algorithm Docotic.Pdf produces very small documents! Of course, you can always embed full font if you like.

PDF supports compression of file content with known algorithms and Docotic.Pdf also supports this feature.

PDF file is essentially a dump of PDF objects and often there are unused objects in a file. Docotic.Pdf discards unused objects before saving PDFs and that often greatly reduce output file size. For complex documents Docotic.Pdf can reduce file size up to 25-30%.

Robust code

What is not visible to our customers is the quality of the library code. However, that’s very important to us. In our development process we try hard to write only clean and robust code. At the moment there are more than 500 unit tests for Docotic.Pdf that cover more than 80% of its code. For any found bug in Docotic.Pdf we create a unit test to make sure the bug won’t reappear.

Constant development

We constantly develop Docotic.Pdf library and extend its possibilities. Our immediate plans are to speed up document load time and make PDF pages able to act like objects of System.Drawing.Graphics class.

Impressed? Try Docotic right now!