4/9/2023 0 Comments Pdfkit example swiftRecently I wanted to port my Objective-C code to Swift and I decided to share the implementation, so I created this GitHub project I started working on the custom solution back when we didn’t have WKWebViews nor PDF Kit, so my only alternatives were displaying PDFs in a UIWebView or implementing a custom solution. The third alternative is drawing PDF pages and place them on a UIScrollView. In iOS 11 Apple introduced a new class PDFView, a subclass of UIView that comes with a configuration, so you can have side-by-side pages, vertical and horizontal scrolling and many more options. I said we have 3 ways to show the PDF and we just saw one, so what are the remaining two? The only downside is the scrolling is only vertical, which is fine for most apps but you may want to provide some customisations, for example the ability to scroll horizontally and to have two pages side-by-side in landscape. Just like loading a local page, or a remote one, you can provide the URL of the PDF and the WKWebView will take care of it. There are three possible ways of displaying a PDF. It could be a privacy policy document, an invoice, a flyer the company distributes on paper and via its app, a magazine. Open the framework's Resource folder and locate the Snippets.Showing PDFs is pretty common for an iOS app.Inherit the project options: select the Project an from info tab and configurations line choose FastPdfKitFramework from the drop down list.Drag the framework on the Xcode workspace.Open the downloaded folder in the Finder and locate FastPdfKit.embeddedframework.Clone the repository from github or just grab the compressed archive. This guide is also available as screencast number 4. In amework and FPKReaderLib the libFastPdfKit.athat contains the compiled core rendering engine.Īll the other classes are public and can be customized or subclassed at will.Įvery target can be compiled and recompiled for your needs. FPReaderBundle: bundle of resources for needed by the ReaderViewController.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |