How can I add a PDF file in storyboard

I’m trying to make an app that when people press a button the app will show a PDF file so the can read it.

is it possible in corona using storyboard?

And if it is possible, could you please help me out and tell me how to do it. And also how to remove it

later when I change a scene.

Thank you

Victor

You can’t display a PDF as a scene object, but you can probably open one with a native web popup.

Depending on your end-goal, I suggest converting your PDF documents to JPG files and showing those instead.

Can you elaborate more on what you are hoping to use PDFs for?

I am making a book. It has some pages of text to explain things. Even on the iPad, I would have to use 3 or 4 “pages” or “views” or “scenes” to explain everything. So I was hoping to just display a PDF and that’s it.

Unless I have a large JPG and I can use a scrolling window, so people can scroll on the JPG, but I don’t know how to do scrolling also

I hope you can help.

Victor

PDF’s won’t work on most android devices’s webViews.  It will want to download the PDF and play it in a separate player app.

Instead of a PDF you could use a webView and show an HTML page from a web server.  If you want to use the big JPEG idea, then you would look into using a widget.newScrollView()

Catalogue apps with hundreds of pages will usually use JPG images for the pages. 

They will display different sized images depending on the device to get good paging speed vs quality (too high quality leads to bigger jpegs which leads to slower page loading and ultimately crashes due to memory limitations).

Pre-loading into memory 3-4 pages at a time would be the way to go as well and then releasing them from memory after viewing some time.

Could you help me out with the widget.newScrollView()

Please.

I have no idea how to do that.

Thanks

Victor

You can’t display a PDF as a scene object, but you can probably open one with a native web popup.

Depending on your end-goal, I suggest converting your PDF documents to JPG files and showing those instead.

Can you elaborate more on what you are hoping to use PDFs for?

I am making a book. It has some pages of text to explain things. Even on the iPad, I would have to use 3 or 4 “pages” or “views” or “scenes” to explain everything. So I was hoping to just display a PDF and that’s it.

Unless I have a large JPG and I can use a scrolling window, so people can scroll on the JPG, but I don’t know how to do scrolling also

I hope you can help.

Victor

PDF’s won’t work on most android devices’s webViews.  It will want to download the PDF and play it in a separate player app.

Instead of a PDF you could use a webView and show an HTML page from a web server.  If you want to use the big JPEG idea, then you would look into using a widget.newScrollView()

Catalogue apps with hundreds of pages will usually use JPG images for the pages. 

They will display different sized images depending on the device to get good paging speed vs quality (too high quality leads to bigger jpegs which leads to slower page loading and ultimately crashes due to memory limitations).

Pre-loading into memory 3-4 pages at a time would be the way to go as well and then releasing them from memory after viewing some time.

Could you help me out with the widget.newScrollView()

Please.

I have no idea how to do that.

Thanks

Victor

When i need to process and handle multi-page PDF document files,i always use a PDF document processor.You can have a try

Thanks for the tip…

I read 4 pages… I did not understand anything.

It’s telling me that I need C# and something .NET

But I use Corona an lua. So I have no idea what they are talking about.

Do you have any “simple” examples or videos in how to use this technology?

Thanks

@Rob I would say that native PDF display on Android should be a priority. It’s very easy on iOS (as everything is) but if Corona is to support Android apps as well as it does iOS apps (ie: native looking) then this is a must.

@horacebury, how would a Corona app deal with PDF displays on iOS other than through a webView?

Hi Rob, have you had a chance to see my post –

Help with removing a display object inside of a function

I would really thank you if you could help me solve that problem. Thanks

@horacebury Not being an Obj-C coder, I’m not entirely sure, but I was talking to one of our in-house guys (who is) and he was saying that there is a native PDF display function in iOS, rather than a third party add-on. I’m sort of assuming a good chance that Android can display PDFs natively, but if it can’t there is a good opportunity for a Corona plugin, I think. Same for iOS, too, if I’m wrong about that.

Some good links here : 

http://stackoverflow.com/questions/6369568/how-to-display-a-pdf-in-objective-c

Ah, I think this must be the standard “how to display a PDF natively on iOS”:

http://developer.apple.com/library/ios/documentation/uikit/reference/UIDocumentInteractionController_class/Reference/Reference.html

I have no idea what the Android equivalent would be.

It sounds like we are talking apples (no pun) and oranges.

I’m 100% certain that Apple has SDK/API’s that Objective-C apps can use to render PDF’s in-app.  And for most of the Apple SDK/API’s they are fairly easy to implement (relatively speaking).   I don’t know the Android SDK all that well, but I would suspect that they have something similar and could be implemented without a bunch.

But none of that affects what you can do with Corona SDK today if you’re not building Enterprise apps.  Today, the only way I know of for a Corona SDK app to show a PDF is with a  native.newWebView.   In my experience, for iOS, this will play in the WebView.  However for Android, it want’s to download the file and let a native PDF viewer view the file.   For the client I was working for, this worked great for their web-hosted PDF file on iOS but they had to basically drop the PDF in favor of a straight HTML file because they wanted the content in the webView.   So to say PDF view on Android should be a priority, with regards to how it works now, there is nothing Corona can do about it.  Google would have to make it work the way you want. 

Now if you re-phrase that to say Corona should add support for PDF’s then we need to do it for both and it should be an equal priority for each platform.

Naturally, it’s important to file a feature request for PDF viewing at http://feedback.coronalabs.com

Rob