TTMSFNCWXPDFViewer does not work on Android or IOS

Hello. I've tried to make a small project about generating pdf and displaying it. However the app works on windows but when I try to run it on Android or IOS platform it does not work. When I run it in debug mode on Android platform it shows an error something like "delphi filenotfoundexception (read only file system)" . I've uploaded the project source code into drive.
Here is the link : PDFGenerator.rar - Google Drive
I would be appreciated if you take a look at that,
Thanks in advance...


The error message has little to do with TTMSFNCWXPDFViewer. It means you are trying to open a file that is stored on a read only part of your system.
In your project SetFilePath is never called. Try to call that before saving the PDF.

Regarding to loading the PDF back, you need to keep in mind that TTMSFNCWXPDFViewer is asynchronous. This means you cannot load a PDF before showing the form as the embedded browser won't be visible and responsible. Implement the TTMSFNCWXPDFViewer.OnViewerInitialized event where you can automatically load the PDF from the filename that you pass along before showing the form.

Thanks for reply, I called Setpath (it was my bad) as you reminded and it worked for android. But when I try to use it on ios, it doesn't display the pdf file.I didn't find the problem. Did you run the source code on IOS ?

We originally tested a setup similar to yours with an Android device.
We retested this now on an iOS device (iPad with iOS version 15.4.1) and it is working as expected.

Are you using the OnViewerInitialized event to show the PDF?

Besides that, you can keep the TMSFNCWXPDFViewer.LoadFromFile call in your filename setter/method. This will ensure that once the form is hidden, the new file will still be loaded (as opposed to one-time PDF loading in the OnViewerInitialized event when the form is first shown).

I've used OnViewerInitialized event. It is iphone 6 with 12.5.5 ios version that does not display pdf file. When I send the same project to the iPad with 15.6 ios version, it works. I guess this is about old version of IOS. Thanks for your support Keller.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.