Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 14
Registered: ‎01-18-2012
My Device: Blackberry Playbook
Accepted Solution

Loading PDF file using Stageview - not loading in Playbook

Hi,

 

I am desperately trying to get this problem fixed as it's a make or break situation for my prototype.

 

I've created a sample eBook using Adobe InDesign, and I tried exporting it as a SWF file to load in my flex mobile project, but the performance on the playbook is very slow and lags a lot, and I can't get any additional functinality to work such as page transitions, zoom, search, etc.

 

So I exported the eBook as an interactive PDF, added Javascript to the created PDF to recognize commands such as page navigation, finding the page number, basic search, zoom in/out and an interactive TOC. I was able to get everything working on the adobe flash builder simulator on my desktop, but unfortunately the PDF doesn't open in the playbook

 

I've uploaded a link to a sample project that has the code for the view that loads the PDF using Stageview.. please anyone if you can help me then I would greatly apprecaite it.

 

This is about 4 months of work and will be a big problem if I cant get the PDF to load.

 

Thanks in advance

 

Please see link to project:

https://docs.google.com/open?id=0B0WguNnkiW_fTTZaZEFTeEZTU3VIcmkxZDhTM XBydw

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Loading PDF file using Stageview - not loading in Playbook

You won't be able to load a PDF into a QNXWebStageView. Your only option, as far as I know and if you aren't thinking of writing your own PDF viewer, is to write the PDF into the filesystem in a shared folder (e.g. documents) and launch the Adobe Reader to display it.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Contributor
Posts: 14
Registered: ‎01-18-2012
My Device: Blackberry Playbook

Re: Loading PDF file using Stageview - not loading in Playbook

Thanks for your reply Peter.

 

Loading the PDF in the Adobe Reader app is not an option for me as the user will be prompted to another application and I want to view the PDF within my app.

 

Do you have any links that describe how to write your own PDF viewer in flex mobile?

 

I am just picking up flex on the go, so all I'll appreciate anything I can get.

 

Thanks once again

 

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Loading PDF file using Stageview - not loading in Playbook

There are a few AS3 libraries that create PDF files. ALivePDF is one that works pretty well.
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Loading PDF file using Stageview - not loading in Playbook

John's talking about a PDF generator, not a viewer.

I don't know of anyone who has written a decent PDF viewer for AIR. I really doubt it's feasible if you're just picking up the language. It could likely be a many-months project even for an experienced developer. You're basically talking about writing a Postscript interpreter, which is certainly not an easy task.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Loading PDF file using Stageview - not loading in Playbook

Sorry, I read your post as to create a PDF. Yes, I too have yet to see a AS3 library to read and display a PDF. Outside of the PB, it is typical to use the HTML viewer to load a PDF that loads the PDF viewer, but that does not seem to be implemented yet on the PB.
Developer
Posts: 247
Registered: ‎11-22-2011
My Device: Blackberry Playbook

Re: Loading PDF file using Stageview - not loading in Playbook

So, why dont you export from InDesign to HTML and use stageWebview to display the content in FLEX? StageWebview should render fast.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Loading PDF file using Stageview - not loading in Playbook

Note that it should be QNXStageWebView, from the qnx.* packages, as I don't believe the generic StageWebView is supported at all on the PlayBook.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 247
Registered: ‎11-22-2011
My Device: Blackberry Playbook

Re: Loading PDF file using Stageview - not loading in Playbook

Ah,  QNXStageWebView. Following this link: http://renaun.com/blog/2010/12/using-playbooks-qnxstagewebview-with-flex-hero-mobile/ it should work well inside Flex. And you have  the "ability to use JavaScript between app and web view".

Contributor
Posts: 14
Registered: ‎01-18-2012
My Device: Blackberry Playbook

Re: Loading PDF file using Stageview - not loading in Playbook

Hi all,

 

Thanks a lot for al the advice and clarifcations :smileyhappy:

 

The reason I can't export as HTML is that InDesign basically converts the document into JPG and all the interactivity is lost in the HTML file (multimedia content, pictures.. etc). The entire format is also mixed up and the results are really bad.

 

The only decent html version is when I export as SWF file, it also generates an HTML file which is in the corrent format. But I think that's just the SWF file playing in the HTML browser.

 

The SWF file also loads in the Flex project, but the only issue I have is with page transition (it lags a lot!!)

 

And in this case, I will not be able to use any of my functionality (page navigation, zoom, search, etc)

 

So I am still confused now as to which direction I should adopt...

 

I can't use the PDF format, and the only html version I can use is the one that is exported along with the SWF File.. but if I use this format I am not sure how I can pass java script to the SWF file (not sure if it even recognizes JS)....