It's possible to open a PDF view in the Salesforce for Android and iOS app. The PDF shows up as a thumbnail view, and there is a download link where a full view can be accessed in another browser window. However there are some best practices to follow, as well as known limitations to be aware of, which will be outlined here.
Use the sforce.one.navigateToSObject() event call to open the PDF in the mobile app environment. This method call is meant to be used in the Salesforce for Android and iOS app environment only. We do not recommend hard coding URL values to open the PDF in the Salesforce for Android and iOS app. The navigateToSObject() event call is the recommended way to render a PDF view from the Salesforce for Android and iOS app.
NOTE: The navigateToSObject() event call opens the PDF in a new browser window on the mobile device. This is working as designed, as it is not possible to render the PDF view inside of the mobile app context. Make sure you set your mobile browser to allow popups so that the PDF renders seamlessly.
If you have previously uploaded the PDF to your Files tab in Salesforce full site org, then you can use the Files record id as a parameter in the navigateToSObject() method call to navigate to the PDF view page. To find the Files record id for your PDF, if you have already uploaded it, open up the Files tab in Salesforce desktop and copy and paste the record ID from the URL for the PDF. It'll start with the "069" prefix, which is the Files record ID.
NOTE: Read our help article for a list of the standard object record IDs and their prefixes. Do not use the Attachment record ID when opening a PDF in the Salesforce for Android and iOS app environment, as the navigateToSObject call won't open the PDF.
<apex:page standardController="Campaign">
<script>
sforce.one.navigateToSObject('06946000000WeeL');
</script>
</apex:page>
NOTE: lightning:navigation uses the navigate() with pageReference
({
handleClick: function(cmp, event, helper) {
var navService = cmp.find("navService");
var pageReference = {
type: 'standard__recordPage',
attributes: {
recordId: '069e0000000azKYAAY',
objectApiName: 'ContentDocument',
actionName: 'view'
}
}
event.preventDefault();
navService.navigate(pageReference);
}
})
If you're trying to dynamically build and display your PDF file, you will want to generate and save this file via your controller then navigate to the new ID accordingly. Generating and saving it on the server side, will eliminate conflicts noticed with the webview incorrectly handling content types across different platforms, or other rendering related issues that may occur. With this approach and navigating to the file directly, it should provide a more consistent user experience in our supported mobile environments.
NOTE: Salesforce Support cannot offer assistance in building out the functionality to dynamically generate PDFs, but we are able to assist if there is a specific error observed when attempting to render the dynamically generated PDFs.
000384273

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.