How to show a PDF in iOS

According to online docs:

FolderItem.Open (activate As [Boolean]= True)

New in 2019r2.1

Supported for all project types and targets.

Doesn’t work in iOS
How do you create a PDF and open it using something else?
If I try to SHARE the file using it’s URLPath, and the user tries to Markup, the whole system becomes unresponsive.
So I want to hand off the display to another app

Is this miraculous timing ? Roadnap #2

No.
Awful timing really.
I don’t need Xojo to allow me to create PDFs -this roadmap item is no use to me.
I have spent a lot of money on MBS plugins to do that, and thankfully that part is working fine.

I want to have the PDF displayed once it is created.
The docs say Folderitem.open is available on all platforms
It isn’t available in iOS

ShowURL doesnt work.
I thought MBS might solve it with LaunchServicesMBS but that doesn’t launch the PDF either.

So I’m still looking for a way to display a PDF I created.

(I don’t want to display it in an HTMLViewer which is part of my app.
I want the user to be able to display it, print it, share it, copy it to iCloud.
None of those are possible in an HTMLViewer)

1 Like

Use a MobileSharingPanel to show a PDF on iOS.

SharingPanel1.ShareURL(pdfFolderItem.URLPath)

1 Like

You can show a PDF on iOS with PDFKit, DynaPDF or CoreGraphics functions in MBS Xojo Plugins or via declares.

Or even Picture.Open or Picture.FromData may work if Xojo did implement that with a PDF friendly API.

Use a MobileSharingPanel to show a PDF on iOS.

SharingPanel1.ShareURL(pdfFolderItem.URLPath)

This completely hangs my iPad if the user chooses ‘Markup’ from the options.
Works fine in simulator, hangs a device.
I cant ship like that and have no idea how to avoid it

You can show a PDF on iOS with [PDFKit]

I can render a PDF to a picture using plugins.

What I am trying to do is to get ‘a.n.other’ app to handle the PDF.
Adobe / Preview / GoodReader …

Implement MobileSharingPanel.ShareFile: <https://xojo.com/issue/62758>

Steps: For now we can share Picture, Text and URL. Would be also helpful and important to add a new ShareFile Method to MobileSharingPanel to share a FolderItem.

Sharing a file already ‘works’… thats how I get the sharing panel up for other kinds of files:

myview.Share.Shareurl(specialfolder.documents.child(filename).URLPath,theoptions, cell.Control)

In v 2022 4.1 there’s no sharing panel and viewing a pdf in a web html viewer in iOS does not have any controls and only shows one page

Hi @John_Scanlan

I’m pretty sure there’s a Sharing panel. I use it quite a bit every day :wink:

Looks like the sharing panel is only in the iOS version of Xojo. I’m doing a straight web app.

If you can get it into Safari, it should be showing this:

Oh, I understood for your question that it was iOS. :person_shrugging:t2:

I think he is running a web app on an iPhone. Confusing…

Yes . . . I’m not going to pay $600 and rewrite everything to make an iOS app for not a lot of customers.

My app creates a pdf as a webfile and then shows the pdf in an webHTMLviewer. On Windows and macIOS the entire pdf shows. In iOS no controls show and one only one page shows.

I am surprised to hear that a webHTMLViewer shows controls on Windows and MacOs. (The Desktop one didn’t, last time I looked at it)
You may have better luck offering a download button, as iOS should then be able to divert the PDF to either Safari or iBooks for display.

1 Like

and then the user has to log into the app again . . . Any other ideas?

Only 'why does the user have to log in again just because they have downloaded a file?’
Obviously there is stuff going on with Web that I don’t know about.
Are you saying that opening a PDF in iBooks or Safari kills your app’s session?
That doesn’t sound right - but I don’t ‘do’ web

@John_Scanlan – Have you thought about using a PDFView?

Edit: Here’s an example

1 Like