Three minutes implementation guide

This guide is also available as screencast number 4.

  • Clone the repository from github or just grab the compressed archive;
  • Open your existing project in Xcode;
  • Open the downloaded folder in the Finder and locate FastPdfKit.embeddedframework;
  • Drag the framework on the Xcode workspace;
  • Inherit the project options: select the Project an from info tab and configurations line choose FastPdfKitFramework from the drop down list;
  • Open the framework's Resource folder and locate the Snippets.txt document;
  • Copy in you controller interface these lines:

      #import <FastPdfKit/FastPdfKit.h>
      @class MFDocumentManager;
  • Copy in your controller implementation these other lines:

          /** Set document name */
          NSString *documentName = @"Manual";
          /** Get temporary directory to save thumbnails */
          NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
          /** Set thumbnails path */
          NSString *thumbnailsPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",documentName]];
          /** Get document from the App Bundle */
          NSURL *documentUrl = [NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:documentName ofType:@"pdf"]];
          /** Instancing the documentManager */
          MFDocumentManager *documentManager = [[MFDocumentManager alloc]initWithFileUrl:documentUrl];
          /** Instancing the readerViewController */
          ReaderViewController *pdfViewController = [[ReaderViewController alloc]initWithDocumentManager:documentManager];
          /** Set resources folder on the manager */
          documentManager.resourceFolder = thumbnailsPath;
          /** Set document id for thumbnail generation */
          pdfViewController.documentId = documentName;
          /** Present the pdf on screen in a modal view */
          [self presentModalViewController:pdfViewController animated:YES]; 
          /** Release the pdf controller*/
          [pdfViewController release];
  • Choose a pdf from the finder and drop it in the project;

  • Change the documentName to the corresponding name;
  • Call the actionOpenPlainDocument method to open the document;
  • Enjoy.

Recent Discussions

15 Apr, 2020 04:25 AM
26 Feb, 2020 07:23 AM
27 Jun, 2019 06:08 AM
23 Nov, 2018 01:54 PM
14 Nov, 2018 04:37 PM