PSPDFKit is used by thousands of apps and millions of end users across different industries like aviation, board meetings, construction, e-learning, e-readers, and magazines.
In this post, we’ll see how to configure PSPDFKit for the aviation industry. We’ll also discuss how to use PSPDFKit to show a flight manual for pilots and a passenger list for the cabin crew.
How pilots can view a flight manual PDF alongside a real-time map view in the cockpit
How the cabin crew can view a passenger list document
ℹ Info: You can build the PSPDFKit Catalog app on your iOS device or Simulator to explore the aviation example, and you can find the source code in
AviationExample.swift. You can also install PDF Viewer from the App Store on your iOS device and open the example via Settings > PSPDFKit Catalog.
ℹ Info: This example uses PSPDFKit’s Viewer and Annotations components.
Below, we’ll discuss the similarities and differences between the two use cases, and we’ll also discuss how we customized PSPDFKit for these use cases.
So let’s get started!
If you open the aviation example on a device that has the light appearance, you’ll notice that the UI is in Dark Mode. That’s because we programmatically override the appearance to force Dark Mode, since most aviation apps prefer the dark appearance.
You can also see that the flight manual document is rendered in night mode. We do this because a pilot’s flying environment is dark during the night, and having night mode for PDFs is an important feature to make it easier to read in the cockpit.
ℹ Info: If you want to view the original document without the color correction for night mode, you can always change to the default appearance mode using the brightness button in the main toolbar.
To learn more about color correction for night mode document rendering, see our Color-Correct Night Mode blog post.
The aviation example customizes several parts of the UI:
The PDF view (i.e.
PDFViewController) is embedded next to the map view
The main toolbar (
The available tools in the annotation toolbar
The annotation selection menu
The sharing experience
PDFViewController is PSPDFKit’s principal view controller, and it allows you to display PDF documents. You can treat
PDFViewController like any other standard UIKit
UIViewController. For our use case, we’ll embed the PDF view controller alongside a standard
MKMapView. This way, the pilot using the app can see the flight manual and the map on the same screen. Take a look at the Embedding the PDFViewController Inside a Custom Container View Controller guide to learn more about this.
Since our first example is intended to be used in the cockpit by pilots during a flight, we want to minimize any distractions in the UI and only add the required elements.
For example, a pilot may want to add a few notes to a document, but they may not need to add, remove, or reorder pages from the PDF. That’s why we customized the main toolbar to include only the necessary buttons — in this case, the brightness, annotation, bookmark, and share buttons.
For the second example, we added another custom button to the main toolbar. This allows the cabin crew to toggle the visibility of all the annotations in a document, which can be useful when a flight attendant wants to see the original PDF of the passenger list without annotations.
Please refer to our documentation to learn more about customizing the main toolbar and its buttons.
For both the flight manual and the passenger list examples, we customized the available tools in the annotation toolbar, allowing both the flying and cabin crews to use relevant annotation tools during the flight.
Then, we added a custom button in the annotation toolbar that allows the end user to delete all the annotations from the document should they wish to start over.
To learn more about how to customize the annotation toolbar, please refer to our Customizing the Annotation Toolbar guide.
We customized the long-press menus for both examples, allowing the end user to quickly access some frequently used tools like the free text, notes, and ink annotation tools.
We also added a custom menu item to invert the document rendering colors, allowing the user to switch between the default and night appearance modes.
To learn more about how to customize the menus, please refer to our Customizing Menus guide.
And finally, we customized the sharing experience for the cockpit example, allowing the pilot to either email or print the flight manual. We removed the ability to share the document with other apps like messaging apps, as there’s no need for this functionality.
For the cabin crew example, flight attendants can use the default system sharing settings, which allows them to share the document via the system share sheet.
Please refer to our Document Sharing guide to learn more about how to customize the document sharing experience.
If you’re curious about how PSPDFKit is used in other industries, please take a look at our other blog posts from this series: