How Do I View a PDF in My Mobile Application? (Magic xpa 4.x)
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.
![](/PublicKnowledge/servlet/rtaImage?eid=ka23z0000004PPM&feoid=00ND0000005rAjf&refid=0EM3z000001re7g)
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:
-
Create an Invoke OS Cmd operation.
-
Make sure that the Execute On property is set to Client.
-
Set the command with a syntax of pdf:filename where filename is a path to a local file.
For example, the following command will copy the ReleaseNotes.pdf file from the C:\Magic\ folder on the client and will open a PDF viewer to show this file: Invoke OS 'pdf:/' & ServerFileToClient('C:\Magic\ReleaseNotes.pdf')
![](/PublicKnowledge/servlet/rtaImage?eid=ka23z0000004PPM&feoid=00ND0000005rAjf&refid=0EM3z000001re7i)