February 15, 2012

10.6um 10.6um
Lab Rat
3 posts

Show pdf with qtwebkit

 

I have a project in which we use custom built software, that is not developed by us. The application is developed in qt 4.7.0 and is running on Ubuntu 10.04 LTS.

It uses html pages to provide the “online help” to the user. My task is to write the initial help content. The pages are rendered using qtwebkit.

Our customer would also like to display pdf-documents. When I asked the developers, I was told to convert the pdfs to html and add the converted files to the online help.

This would cause quite a bit of additional work and results in html-output that won’t look exactly like the pdf-files… and it would prevent the simple addition of new pdf-files by the customer.

So I ask the community here: is there a way to display pdf-files with qtwebkit? Are there any plugins?

Cheers,

10.6um

2 replies

February 15, 2012

leon.anavi leon.anavi
Mad Scientist
1046 posts
10.6um wrote:
So I ask the community here: is there a way to display pdf-files with qtwebkit? Are there any plugins?

In my opinion you should detect that it is actually a pdf by the MIME type using MimeType::fileExtensions [developer.qt.nokia.com] Please have a look at QWebPluginFactory [developer.qt.nokia.com] documentation as it may give you further hints how to load the pdf.

 Signature 

http://anavi.org/

February 15, 2012

10.6um 10.6um
Lab Rat
3 posts

Thanks a lot for your reply. I am not a qt dev… so digging to deep into the stuff is not really to way to go for me… I am looking for info to pass on to the devs…

I found this post [developer.qt.nokia.com] and it looks like it simply does not work. As I’ve written in reply, I get the same results as tomleitner: it works in WinXP but doesn’t in Ubuntu 10.04.

And here [qtforum.de] (sorry in German) they say it just works with the Gecko rendering engine…

 
  ‹‹ QtSDK 1.2 and QtWebKit 2.2 not working in qml      New To Qt ››

You must log in to post a reply. Not a member yet? Register here!