839
Views
14
Comments
[File Viewer Plugin] PDF not opened in IOS
Question
file-viewer-plugin
Mobile icon
Forge asset by OutSystems

I am opening a PDF file from a URL. It is working fine in android but when i am trying in IOS it is not opening. It showing me blank . It is not showing any error.

Below is my app screenshot.


2018-05-15 08-41-11
Davide Periquito

Hello mohd,


We have implemented in the following way.

First we save the file to the external storage of the device


After that we show the file that was stored in the device.


Let me know if it worked?


regards,

2024-05-22 10-21-41
Mohammad Hasib

Davide Periquito wrote:

Hello mohd,


We have implemented in the following way.

First we save the file to the external storage of the device


After that we show the file that was stored in the device.


Let me know if it worked?


regards,


Dear David,

Thanks for your response. i have to save the file from a URL so when i am saving it is showing me error: "The string contains invalid characters".


GeDataFromUri:


SaveFile:




2018-05-15 08-41-11
Davide Periquito

In that scenario I think that using the PDF url on the filePath field instead of the urlFile field should do the trick.


Additionally, I can see that you use the getfileURI after the save, why don't you use the filepath returned by the savefile action directly on the opendocument action

2021-08-30 15-28-09
Leandro Correa



2024-05-22 10-21-41
Mohammad Hasib

Leandro Correa, MSc. Eng. wrote:



Dear Leandro,

I don't have binary data, i have to download the file from URL and save it. Then only i can open it.


2021-08-30 15-28-09
Leandro Correa

Hi dear Mohd! 

So, you can use the propertie urlFile instead filePath.


I hope this help you!

2024-05-22 10-21-41
Mohammad Hasib

Leandro Correa, MSc. Eng. wrote:

Hi dear Mohd! 

So, you can use the propertie urlFile instead filePath.


I hope this help you!

Hi Dear Leandro,

As you will see in my first screen shot i am doing in the same way. It is working on android but it not showing any content on IOS.


2024-05-22 10-21-41
Mohammad Hasib

mohd hasib wrote:

Leandro Correa, MSc. Eng. wrote:

Hi dear Mohd! 

So, you can use the propertie urlFile instead filePath.


I hope this help you!

Hi Dear Leandro,

As you will see in my first screen shot i am doing in the same way. It is working on android but it not showing any content on IOS.


Dear Leandro,


Its done as in my url there was some blank spaces in file name. Thatsy why it was not opening.


Now its working.

Thanks,



2021-08-30 15-28-09
Leandro Correa

Hi dear Mohd! 

I’m glad to know that it’s works now! 

Best Regards,

Leandro. 

UserImage.jpg
Domingo Del Rosario

Hi,

Im getting some issues with IOS. I uploaded a PDF manual as resources to a mobile app. Then I tried to open it with this implementation. When I click the link I get some share, copy and save options. If I click the save option a blank page start opening but quickly close and it goes back to the mentioned options (kind of a loop). With copy and share I didn't get anything except when a I choose google drive that I got a file with a diferente name. But never change from waiting status. 

Seem that I have to do some file conversión but I not sure. 

I tried File Plugin but when I used I didn't any response from the open link.

Any help please.


Regards,

Domingo


2021-08-30 15-28-09
Leandro Correa

Hi Domingos,

Check if you mark the propertie Deploy Action on the resource.

And in the OpenDocument action, you'll need to use the complete URL in the filePath

In the next time, please open a new topic.


Best regards,

Leandro.

UserImage.jpg
Deepak Rathore

I want to view file in same screen by using file viewer its getting open in new tab

Kindly suggest to open in same screen

Thanks

 

2021-08-30 15-28-09
Leandro Correa

Hi Deepak,

Would be better if you open a new topic.

Take a look at this other component:

https://www.outsystems.com/forge/component-overview/6223/mobile-pdf-preview

2024-02-08 19-20-59
Mateus Leite Pedrosa

Hello everyone! 

I was facing the same struggle with PDF handling for iOS and Android. So after a few days of search and trying differents approachs I came to this simple solution:

Basically you need to implement two solutions for the differents OS:

1) In case of Android the "Save File" and "Open Document" works really well but not for iOS;
2) In case of iOS you need to use the specific action "Open System Browser" that only works for iOS from the "InAppBrowserPlugin";

*In my case I get a PDF "Binary Data" from a REST service so in iOS it opens the system's browser and for android downloads the PDF file and open the same.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.