Some test text!

menu

Quick start - view a document on iOS

This guide demonstrates how to display a PDF. To begin working with PDFTron SDK, you must have first added it to your project.

  1. PDFTron must be initialized before using any PDFTron classes. This only needs to be done once. This is done as shown:

    No trial license key required.
    The trial of PDFTron SDK works without a license key. A commercial license key is required for use in a production environment. Please fill out our licensing form if you do not have a valid license key.
    Keep your commercial license key confidential.
    License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).
    PTPDFNet.initialize("<key-goes-here>")
  2. At the top of your source file, import PDFNet and Tools.

    import PDFNet
    import Tools
  3. The following shows how to create a document viewer, set the document to display, and present it on screen.

    // Create a PTDocumentViewController
    let documentController = PTDocumentViewController()
    
    // The PTDocumentViewController must be in a navigation controller before a document can be opened
    let navigationController = UINavigationController(rootViewController: documentController)
    
    // Open an existing local file URL.
    let fileURL: URL! = Bundle.main.url(forResource: "sample", withExtension: "pdf")
    
    documentController.openDocument(with: fileURL)
    
    // Show navigation (and document) controller.
    self.present(navigationController, animated: true, completion: nil)

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.

Join our live demo to learn about use cases & capabilities for WebViewer

Learn more
close