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

Web and WebWorks Development

Reply
Highlighted
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

PlayBook WebWorks and HTML embed support for PDF

PlayBook has built in support for HTML5 but I couldn't embed a PDF in an HTML page using embed tag. Embedding of PDF is a feature of HTML5. Even the browser for Playbook doesn't support this. Please check this link in PlayBook browser. http://blogs.adobe.com/pdfdevjunkie/2007/08/using_the_html_embed_tag_to_di.html. This page renders properly in my Chrome browser. I would like to know if this issue will be fixed in the next release of SDK

 

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: PlayBook WebWorks and HTML embed support for PDF

I'm not sure that embedding specifically a PDF in a HTML is part of the HTML5 spec, but our browser does support embedding Flash files.

 

I believe the only way you will likely be able to launch a PDF is to use the new file open method that will be available on the PlayBook in the next week or so.

http://www.blackberry.com/developers/docs/webworks/api/blackberry.io.file.html

 

This will open a local file using the application who has registered as the default editor which should be the PDF reader.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: PlayBook WebWorks and HTML embed support for PDF

Hi Tim,

 

HTML5 has an object tag which enables to embed pdf file into an HTML page without the need of other plugins. I suppose Playbook's browser is having webkit engine, so it should be working same as that of a Chrome browser. I've tried a sample in simulator, but I couldnt get that to work. But when I tried the same using a ripple emulator with Chrome plugin I could see the embed PDF file. Please see this link for Object tag details. http://www.w3schools.com/html5/tag_object.asp.

 

So, is that a bug on the simulator or will it be the same in device too. Could you please let me know if this works in a real device.

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: PlayBook WebWorks and HTML embed support for PDF

While the <object> tag syntax is a standard tag in HTML5 it requires a plug-in or add-on for the browser to render the content that's embedded inside.  This is the same way you embed flash in the browser which requires a browser plug-in and it's not included in the HTML5 standard.

 

On Chrome, it packages Flash with the browser and the Adobe PDF viewer on your desktop will have created a NPAPI plug-in for use with Chrome and other browsers.

 

The PlayBook does have a PDF reader distributed with it which is not on the simulator.  Whether or not they have created a PDF viewer plug-in for the adobe reader into the browser is a good question.  I don't have my PlayBook on me right now to test out your link to see if it was built in or not.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: PlayBook WebWorks and HTML embed support for PDF

Thanks for the info. I'll have a detailed study about this then.  Smiley Happy

Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: PlayBook WebWorks and HTML embed support for PDF

Hi Tim,

 

I was able to test the sample page in PlayBook browser. That feature is not enabled for PlayBook browser presently. I would like to know if that will be included in coming releases since that is a generic feature.

 

Also, about the open file API which was mentioned before. Will I be able to open a PDF file in my WebWorks app without navigating away to default PDF reader app?

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: PlayBook WebWorks and HTML embed support for PDF

I belive the file.open() would launch into the PDF reader.  It wouldn't stay within your application.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Contributor
Posts: 5
Registered: ‎08-23-2011
My Device: Playbook
My Carrier: Telus

Re: PlayBook WebWorks and HTML embed support for PDF

to follow what was said, i've been hitting my head on my desk for the past two days trying different ways to embed a PDF to stay within an app.  

 

so thought i'd get an official and straight answer from someone from RIM, is it or isn't it possible to do this?  i don't want it to launch outside of the app, i want it to display within the app.  i've done this on the iOS platform and it performs seamlessly and easily, i just don't understand why it's so difficult on the playbook platform, it's quite restrictive.

New Contributor
Posts: 7
Registered: ‎09-11-2011
My Device: Q5 and Playbook
My Carrier: Rogers

Re: PlayBook WebWorks and HTML embed support for PDF

The difficulty of reading pdf on browser is serious.  pdf pages are a part of many websites and a browser that does not open them for direct reading cannot claim to give the "full web experience".

 

I can live grudgingly with the workaround of saving a pdf file and then reading it with separate app which works 90% of the time but there are situations where this does not work.  For example "Directors Desk" (a website you would expect a "professional grade" tablet to interface with seamlessly) is basically a database of pdf documents, clicking on a document link opens a page with link like eg https://secure.directorsdesk.com/includes/popup.aspx?fileID=13962667&folderid=8953721&flPwdProt=0&fl...

a new browser tab opens with a Directors Desk message about loading in progress but it never completes and the page remains blank.  Pressing and holding the link does not provide an option of downloading the document file.

 

When is RIM going to fix this obvious browser flaw by embedding a pdf reader or providing a plugin or something?