Common Classes

  • PDFDoc is a high-level class describing a single PDF (Portable Document Format) document. Most applications using PDFNet will use this class to open existing PDF documents, or to create new PDF documents from scratch.

    The class offers a number of entry points into the document. For example,

    • To access pages use pdfdoc.GetPageIterator() or pdfdoc.GetPage(page_num).
    • To access form fields use pdfdoc.GetFieldIterator(), pdfdoc.GetFieldIterator(name) or pdfdoc.GetField(name).
    • To access document’s meta-data use pdfdoc.GetDocInfo().
    • To access the outline tree use pdfdoc.GetFirstBookmark().
    • To access low-level Document Catalog use pdfdoc.GetRoot(). …

    The class also offers utility methods to slit and merge PDF pages, to create new pages, to flatten forms, to change security settings, etc.

    See more

    Declaration

    Objective-C

    @interface PTPDFDoc : NSObject

    Swift

    class PTPDFDoc : NSObject
  • PDFDraw contains methods for converting PDF pages to images and to Bitmap objects. Utility methods are provided to export PDF pages to various raster formats as well as to convert pages to GDI+ bitmaps for further manipulation or drawing.

    Note

    This class is available on all platforms supported by PDFNet.
    See more

    Declaration

    Objective-C

    @interface PTPDFDraw : NSObject

    Swift

    class PTPDFDraw : NSObject
  • PDFNet contains global library initialization, registration, configuration, and termination methods.

    Note

    there is only a single, static instance of PDFNet class. Initialization and termination methods need to be called only once per application session.
    See more

    Declaration

    Objective-C

    @interface PTPDFNet : NSObject

    Swift

    class PTPDFNet : NSObject
  • PTPDFViewCtrl is a utility class that can be used for interactive rendering of PDF documents.

    On iOS, PTPDFViewCtrl derives from UIView.

    PTPDFViewCtrl defines several coordinate spaces and it is important to understand their differences:

    • Page Space refers to the space in which a PDF page is defined. It is determined by a page itself and the origin is at the lower-left corner of the page. Note that Page Space is independent of how a page is viewed in PDFView and each page has its own Page space.

    • Canvas Space refers to the tightest axis-aligned bounding box of all the pages given the current page presentation mode in PDFView. For example, if the page presentation mode is e_single_continuous, all the pages are arranged vertically with one page in each row, and therefore the Canvas Space is a rectangle with possibly large height value. For this reason, Canvas Space is also, like Page Space, independent of the zoom factor. Also note that since PDFView adds gaps between adjacent pages, the Canvas Space is larger than the space occupied by all the pages. The origin of the Canvas Space is located at the upper-left corner.

    • Screen Space (or Client Space) is the space occupied by PDFView and its origin is at the upper-left corner. Note that the virtual size of this space can extend beyond the visible region.

    • Scrollable Space is the virtual space within which PDFView can scroll. It is determined by the Canvas Space and the current zoom factor. Roughly speaking, the dimensions of the Scrollable Space is the dimensions of the Canvas Space timed by the zoom. Therefore, a large zoom factor will result in a larger Scrollable region given the same Canvas region. For this reason, Scrollable Space might also be referred to as Zoomed Canvas Space. Note that since PDFView adds gaps between pages in Canvas Space and these gaps are not scaled when rendered, the scrollable range is not exactly what the zoom factor times the Canvas range. For functions such as -SetHScrollPos:, -SetVScrollPos:, -GetCanvasHeight, and -GetCanvasWidth, it is the Scrollable Space that is involved.

    See more

    Declaration

    Objective-C

    @interface PTPDFViewCtrl
        : UIView <UIScrollViewDelegate, UIGestureRecognizerDelegate,
                  UIPrintInteractionControllerDelegate> {
      UIView *ContainerView;
      UIScrollView *innerScrollView;
      UIScrollView *outerScrollView;
    }

    Swift

    class PTPDFViewCtrl : UIView, UIScrollViewDelegate, UIGestureRecognizerDelegate, UIPrintInteractionControllerDelegate