Quick start - view a document on iOS

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

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

No trial license key required.

The trial of Apryse Mobile SDK does not require a trial key. A commercial license key is required for use in a production environment. Please contact sales to purchase a commercial key or if you need any other license key assistance.

Keep your license keys confidential.

License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).

1PTPDFNet.initialize("<key-goes-here>")
  1. At the top of your source file, import PDFNet and Tools.
1import PDFNet
2import Tools
  1. The following shows how to create a document viewer, set the document to display, and present it on screen.
1// Create a PTDocumentController
2let documentController = PTDocumentController()
3
4// The PTDocumentController must be in a navigation controller before a document can be opened
5let navigationController = UINavigationController(rootViewController: documentController)
6
7// Open an existing local file URL.
8let fileURL: URL! = Bundle.main.url(forResource: "sample", withExtension: "pdf")
9
10documentController.openDocument(with: fileURL)
11
12// Show navigation (and document) controller.
13self.present(navigationController, animated: true, completion: nil)

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales