For example, you’d use Document’s annotationsForPage(at:type:) to get annotations for a specific page. Anything related to a page is accessed via the document or a related object by passing a page index. Page HandlingĪs noted above, PSPDFKit doesn’t have a corresponding class for PDFPage. Many customers use this feature to split large documents up into individual files - for example, to download each part individually on demand. This allows you to treat multiple PDF files as a single document in cases where you need to. You can think of one provider as corresponding to a single file on disk. This class corresponds to Document in PSPDFKit.Ī Document consists of one or more PDFDocumentProviders. The PDFDocument class in Apple PDFKit represents a single PDF document either stored on disk as a file or loaded via a Data object. For more information, see the Text Handling section. While PDFSelection is generic in Apple’s PDFKit, covering multiple use cases, PSPDFKit offers more dedicated objects for each use case. The PDFSelection class doesn’t have a corresponding class in PSPDFKit. The PDFPage class doesn’t have a corresponding class in PSPDFKit the concept of a page is supported mainly via page indexes, as described in more detail in the Page Handling section. The following table shows an overview of Apple’s PDFKit classes that have a corresponding class in PSPDFKit: Let’s take a look at these and see how they relate to PSPDFKit. All remaining classes in Apple’s PDFKit are what Apple calls utility classes. The only UI classes provided by Apple’s PDFKit are PDFView and PDFThumbnailView. We expose the classes publicly to give you hooks for customization, advanced control, and performance optimization. We traded a bit of simplicity for flexibility and performance, and we achieve this by using a couple of techniques and patterns.įor example, the responsibility for providing, parsing, and managing various PDF objects and concepts is split into individual classes. But once you understand the basic concepts, it’s straightforward. The PSPDFKit API can be overwhelming at first, especially when coming from Apple PDFKit. See the Easy Transition with PDFXKit section below for more information. It’s a drop-in replacement with little or no changes required, and it allows you to program against the PDFKit API while using PSPDFKit under the hood. To simplify migrating a codebase from PDFKit to PSPDFKit as much as possible, we provide a wrapper called PDFXKit. Loading of documents from custom sources with on-the-fly decryptionĪdvanced, customizable rendering, including CMYK color space supportĬustom bookmark implementation (bookmarks are not part of the PDF spec)Īvailable on multiple platforms with excellent interoperabilityįirst-class support directly from our engineers Indexed full-text search (with near-instant search results) Importing and exporting annotations in JSON and XFDF formats Support for all annotations defined in the PDF specification It also includes a lot of customization options:Īdvanced and native UI and UX, with support for most PDF features PSPDFKit, on the other hand, is a cross-platform PDF framework with more advanced features and fine-grained control over various aspects of PDF handling. It’s a system library, so it’s easy to integrate. Apple’s PDFKit provides a great starting point for integrating PDF support into your iOS app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |