Salesforce

How Do I View a PDF in My Mobile Application? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I View a PDF in My Mobile Application? (Magic xpa 3.x)

On iOS devices:

You can view a PDF using Magic xpa's internal Browser control.

Note that the PDF should be located on the server and not locally on the device.

On Android devices:

Most of the Android browsers do not display PDFs. Therefore, you cannot use Magic xpa's internal Browser control to view a PDF.

However, you can view a PDF using a third-party PDF viewer application. You do this as follows:

  1. Create an Invoke OS Cmd operation.

  2. Make sure that the Execute On property is set to Client.

  3. Set the command with a syntax of pdf:filename where filename is a path to a local file that is stored on a public folder on the device, such as the /SDCARD folder.

For example, the following commands will copy the ReleaseNotes.pdf file from the C:\Magic\ folder on the server to the /SDCAD folder on the client and will open a PDF viewer to show this file:

  • Evaluate ClientFileCopy(ServerFileToClient('C:\Magic\ReleaseNotes.pdf'),'/sdcard/tmpfile.pdf')

  • Invoke OS 'pdf:/sdcard/tmpfile.pdf'

Reference
Attachment 
Attachment