Some test text!

menu
search

Get started integrating PDFTron iOS SDK

Welcome to PDFTron. This guide will help you integrate a free trial of the PDFTron iOS SDK into your Xcode projects for iOS applications. You can either integrate PDFTron frameworks automatically using CocoaPods, or install them manually by downloading the SDK. Pick whichever your option you prefer, but integrating with CocoaPods is the recommended approach. Your free trial includes unlimited trial usage and support from solution engineers.

Manual Integration

linkPrerequisites

  • Xcode
  • PDFTron iOS SDK

    Take note of the location of your PDFNet.dmg download.

linkSetup

  1. Create a new Xcode Project. Call it pdfhello. For the purposes of this guide, select a view scene application.
  2. From your PDFNet.dmg download, copy the /Lib/ folder into pdfhello/.

linkIntegrating PDFTron SDK for your iOS application

  1. Select the project in the left pane and go to the General tab. Scroll down to find the Embedded Binaries section. Here, add Lib/Tools/Tools.framework and Lib/Framework-dynamic/PDFNet.framework from the Lib/ folder you copied into your project. You can do this by dragging them in from Finder or by clicking the + sign to browse your files.

    General Add Frameworks
  2. Go to the Build Phases tab and click on the + button to add a New Run Script Phase. Copy and paste the following into the shell command:

    bash "$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/PDFNet.framework/strip-framework.sh"

    This will ensure invalid slices are striped from the framework before being submitted to the app store (a longstanding Xcode bug).

    Build Phases Add Script

linkInitialize PDFTron

Initialize PDFTron before you use any PDFTron related classes or methods. This only needs to be done once.

The best practice to do this is to use the optional application:willFinishLaunchingWithOptions: method in the AppDelegate class found in either the AppDelegate.swift or AppDelegate.m file in the left pane depending on your choice of language:

// In AppDelegate.swift
import UIKit
import PDFNet
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    //... Any methods already here
    func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        PTPDFNet.initialize("Insert Commercial License Key Here After Purchase")
        return true
    }
}

While you are trialing PDFTron, you can pass any string to the initialize method. A string that is not a license key will enable demo mode, where all pages are lightly watermarked.

linkNext step

View a document

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn More
close