[iOS] How can I integrate PDF Viewer into my website or iPhone/iPad app?

Posted in iOS Updated on .
Written by Peter Steinberger

URL Scheme of PDF Viewer

PDF Viewer implements the x-callback-url protocol, which allows iOS and Mac developers to expose and document the methods they make available to other apps and return useful data. This feature is available only for users that are subscribed to PDF Viewer Pro.

PDF Viewer URL Scheme actions look like this:

pdfviewer://x-callback-url/[action]?[action parameters]&[x-callback parameters]

Add to PDF Viewer

To send PDF files from Safari to PDF Viewer you can use this HTML snippet:

<a href="pdfviewer://x-callback-url/add-file?url=https://pspdfkit.com/downloads/case-study-box.pdf">Add to PDF Viewer</a>

Action: Add "Case Study" to PDF Viewer

The PDF will be automatically saved in PDF Viewer.

Actions

/open-file

Open the local file from the path.

Parameters:

  • path - required path to a file.

Example:

pdfviewer://x-callback-url/open-file?path=/Quick%20Start.pdf

/add-file

Store a file (or download from url) locally as filename.

  • url - URL address to a file.

  • data - base64 representation of a file. This parameter must be URL encoded.

  • filename - file name with extension. Both data and filename are required to successfully add a file.

  • open - optional. Open newly added file.

Examples:

pdfviewer://x-callback-url/add-file?open=true&url=https://pspdfkit.com/downloads/case-study-box.pdf
pdfviewer://x-callback-url/add-file?open=false&filename=Document.pdf&data=JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGNjkEKAjEMRfdzir/UhZ2mtrZdqniAgYAHKA4i7UCd+4PpKLrQhWSRT/7PSyoGVGgpFx2CNbhfcMaE/jgT0gzCnMRtTnln8qI08rKZccXY/ZGRtMCqMNvBTWuNmwoODLL2NRZholcOFH3HBT0zKS1bPGKFNfiGEy9//wSZEJ6gJsiQ2u68gSP9xdrTBzY8ANE8OGsKZW5kc3RyZWFtCmVuZG9iago1IDAgb2JqCjE0OQplbmRvYmoKMiAwIG9iago8PCAvVHlwZSAvUGFnZSAvUGFyZW50IDMgMCBSIC9SZXNvdXJjZXMgNiAwI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