Some test text!
PTDocumentViewController
class, please see this guide.
Open your ViewController file. This is either the ViewController.swift
or ViewController.m
file in the left pane depending on your choice of language. Import PDFNet and Tools libraries.
import PDFNet
import Tools
Override the viewDidAppear()
method in the ViewController
class and then open the DocumentViewController using:
override func viewDidAppear(_ animated: Bool) {
// Create a PTDocumentController
let documentController = PTDocumentController()
// The PTDocumentController must be in a navigation controller before a document can be opened
let navigationController = UINavigationController(rootViewController: documentController)
navigationController.modalPresentationStyle = .fullScreen
navigationController.navigationBar.isTranslucent = false
navigationController.toolbar.isTranslucent = false
// Open a file from URL.
let fileURL: URL = URL(string:"https://pdftron.s3.amazonaws.com/downloads/pl/sample.pdf")!
documentController.openDocument(with: fileURL)
// Show navigation (and document) controller.
self.present(navigationController, animated: true, completion: nil)
}
Your app should look like this:
Get the answers you need: Support
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.
Web
Android
iOS
Windows
Linux
Unlimited usage. No email address required.