Search

Atalasoft Knowledge Base

INFO: DotPdf - Getting Started

Tananda
DotPdf

DotPdf is technically able to be used as a "stand-alone" SDK.

When it was first introduced, we had a separate installer just for DotPdf. However, since the vast majority of users of DotPdf were also DotImage users, we streamlined our offerings some time ago.

We still can sell DotPdf as a "stand-alone" but the installer is the same installer used for DotImage.

What the DotPdf license does is gives you access to use certain classes within the DotImage SDK.

Stand-Alone

When used stand alone you would still install the DotImage SDK but you will only ever reference these two DLLs:

  • Atalasoft.PdfDoc.dll
  • Atalasoft.Shared.dll

Within that main PdfDoc.dll there are three main classes that you will be able to use
PdfDocument, PdfGeneratedDocument and PdfDocumentSigner classes

Add-On to DotImage

When used as an add-on to DotImage you get the full functionality of DotPdf but it conveys a few additional benefits:

AtalaImageCompressor

AtalaImageCompressor Class is a class that can be added to a PdfGeneratedDocument Image Resources object to provide compression services for AtalaImage objects. This object will make it possible to directly add AtalaImage objects into your PdfGeneratedDocument pages.

WebDocumentViewer - Burning Annotations when saving PDFs

WebDocumentViewer added the feature to allow burning annotations on save in 11.x. This feature works for TIFF and JPEG and other image types "out of the box" with DotImage Document Imaging, but when the file type is PDF, the PdfGeneratedDocument class is used behind the scenes within the burn process - this means that if you are using WDV and built in burning and your output is PDF then you must have a DotPdf license for your application or your saves will throw an AtalaLicenseException

AcroForms Filling in WDV

In version 11.x WebDocumentViewer (WDV) added the allowforms feature to allow customers with PdfReader viewing PDFs with AcroForms to fill forms - however, this feature reuires DotImage DocumentImaging, PdfReader, AND DotPdf licensing in order to be used.

PDF related Classes and required licenses

PdfDocument

This class can be licensed either through DotPdf (PDFG / PDFX2 serial) or through DotImage Document Imaging (DID2/DIDX2serial).

It allows for page-level manipulations of existing PDFs including opening existing PDFs and removing pages, reordering pages, applying full page rotation to pages, accessing and manipulating the PdfBookmarkTree, and combining pages from multiple PDFs as well as splitting out a pdf into multiple single page PDFs.

PdfGeneratedDocument

This class is licensed exclusively through the DotPdf product (PDFG / PDFX2 serial).

It allows primarily for the creation from scratch of markup (vector) based PDF documents where one may add text and drawing objects directly into the pages of a PDF. When used along with a DotImage Document Imaging license, you also have access to the AtalaImageCompressor factory from the Atalasoft.dotImage.PdfDoc.Bridge.dll which lets you use AtalaImage objects within your PdfGeneratedDocument pages

PdfGeneratedDocument also gives access to the PdfBookmarkTree (similar to PdfDocument) and to many of the same page level manipulations import new pages, reorder existing pages, set page rotations, delete pages.. but also gives access to the Form object - this allow for the creation and some manipulation of PDF AcroForms (fillable forms) and can enable you to create new PDF fillable forms from scratch as well as pre-filling existing fields with data and/or extracting filled in data from AcroForms a user has input data into. SOME manipulation of existing forms may be possible, but AcroForms are complex and it is easy to break existing functionality if you're not intimately familiar with the structure of AcroForms and the specific PDF form you may be working with - use with caution when manipulating existing PDF AcroForms (changing fields and appearances)

PdfDocumentSigner

This class is licensed either by DotPdf (PDFG / PDFX2 serial) or DotImage Document Imaging (DID2 / DIDX2 serial)

This is a class that is responsible for getting information about Digital Signatures within a PDF document and applying signatures to a PDF document.

PdfEncoder

This is a tool used to create image based PDFs from AtalaImage objects. It is licensed via a DID2 / DIDX2 serial as part of the main DotImage Document Imaging SDK

PdfDecoder

This is a class that allows the reading of individual frames within a PDF and rendering a raster image of said page - it is licensed by our PdfDecoder (sometimes called PdfReader or in our legacy versions 10.2 and older PdfRasterizer). This requires a PRP2 / PRPX2 serial (for 11.0 and newer. For 10. and older it used a serial beginning with PRS2 / PRSX2. We can no longer sell those serials - some users who purchased before the cutoff have "grandfathered" rights to use them but this applies only to those with existing PRS2 / PRSX2 serials that have been maintained under active maintenance. See this Article for a more in-depth explanation: INFO: Changes to PDF Rendering Library (Foxit to PdfIum).

PdfTextDocument

This is licensed via the PRP2 / PRPX2 serial and is always included in any such licenses purchased / valid for 11.0 and newer. For 10.7 and older this class required that you had (have) a valid PRS2 / PRSX2 serial with the optional (additional cost) TextExtraction flag enabled

NOTE that for legacy (PRS2 / PRSX2) licenses we can not add this feature to a license that did not have it - you lust move to 11.0 or newer to use it if you did not already have a grandfathered in license INFO: Changes to PDF Rendering Library (Foxit to PdfIum)

PDF-related Classes broken down by license

This only covers the PDF-related classes licensed via various licenses - those licenses allow possibly many other classes to be used - this is just a focus on what license is needed for which PDF-related components

DotImage Document Imaging license (DID2 / DIDX2 serial)

  • PdfEncoder
  • PdfDocument

PdfReader (PRP2 / PRPX2 serial)

NOTE: PRP2/PRPX2 are for 11.0 and newer only

  • PdfDecoder
  • PdfImageSource
  • PdfTextDocument

PdfReader (PRS2 / PRSX2 serial)

NOTE:for older versions (10.7 and older) only

  • PdfDecoder
  • PdfImageSource
  • PdfTextDocument (but only if you had the optional PdfTextExtraction flag enabled)

DotPdf license (PDFG / PDFX2 serial)

  • PdfGeneratedDocument
  • PdfDocument
  • PdfDocumentSigner

DotPdf (PdfGeneratedDocument)

The main goal of the PdfGeneratedDocument class is to allow programmatically creating vector (markup) based PDFs from scratch. It does however have a couple other very useful purposes

Creating a PDF from scratch

Drawing Shapes

This is a high level description, but essentially you would create a new PdfGeneratedPage and add it to a new empty PdfGeneratedDocument. Within that page, you might choose to add one or more Shape objects derived from our Atalasoft.PdfDoc.Generating.Shapes.PdfBaseShape class. These could be drawing shapes such as polygons, etc.. or they may be one of the various Text -specific shapes derived from PdfBaseTextShape or much more complex custom shapes.

These Pdf shapes are then added to the page.DrawingList for the target page.

BookmarkTree

You can completely generate and control the PdfBookmarkTree to create a navigation tree, however please keep in mind, this class is a very low-level wrapper over native Adobe Acrobat PDF Bookmark objects - it requires that you dig into the PDF spec or have a fairly robust understanding of how PDF bookmarks work (we do not have extensive examples or training materials in this subject)

Native Pdf Annotations

A PdfGeneratedPage has an Annotations property that gets you access to the PdfAnnotationList which lets you add/remove/modify various PDF native annotations

AcroForms (Fillable Forms)

A PdfGeneratedDocument has a Forms property that gives access to a PdfForm object that contains the AcroForms elements for the whole document.

It is beyond the scope of this document to explain AcroForms design or implementation, but big-picture you need to create a BaseWidgetAnnotation of the desired type such as a TextWidgetAnnotation or CheckboxWidgetAnnotation , etc.. set its properties and such and then add the annotation to the pdfGeneratedPage.Annotations AND add a reference to it correctly to the pdfGeneratedDocument.Form.Fields collection as well.

A fuller explanation of the process is covered in the DevelopersGuide.pdf that ships with the SDK under C:\Program Files (x86)\Atalasoft\DotImage 11.2\Help\ in the chapter on Programming DotPdf. NOTE that like our BookmarkTree implementation, our AcroForms implementation in PdfForm is a very low level wrapper around native PDF AcroForms and may require digging into the PDF spec or other learning materials on the subject to fully understand

Sample Applications / Examples

We have provided several useful sample applications to showcase various features of DotPdf. They can be found on our Legacy Demos KB (any demo that starts with "DotPdf")

  • DotPdfInvoiceLayout
  • DotPdfInvoiceShape
  • DotPdfInvoiceTemplate
  • DotPdfShapesDemo
  • DotPdfTemplateGenerator
Details
Last Modified: Last Month
Last Modified By: Tananda
Type: INFO
Article not rated yet.
Article has been viewed 46 times.
Options
Also In This Category