Display PDF in Linux/Ubuntu

Hi

I would like to display a local stored PDF in my Linux application but I can’t (OS X and Windows are working).
my code:

Dim myPDF As FolderItem myPDF = GetFolderItem("/home/user/Public/ProjectOverview/ProjectOverview.pdf", FolderItem.PathTypeShell) HTMLViewer1.LoadURL(myPDF.URLPath)

Nothing happens. If I enter any URL e.g. www.google.com I see the page. Tried native and WebKit as renderer.

Linux: Ubuntu 14.04 / 32 bit kernel 3.13.0-29
I’ve installed the libwebkitgtk-1.0.0

Does th folder ‘/home/user/Public/ProjectOverview/’ exist on your Linux machine? And if it exists, do you have access rights? As on most Linux machines there’s a home folder for every user (name), but there’s no ‘public’ user in the home folder. You have to use as special folder. Check this info:

@thomas: Folder exists. ls /hoem/user/Public/ProjectOverview gives me the correct output.
-I have a If myPDF.Exists <> false Then, but double checked it.
-File permission “my” user

To be 100% sure I downloaded another PDF to another place and tried it without success.
Additionally I added a try-catch statement, no exception.

Or is it just that your WebKit has no plugin to show pdfs?

well, are you sure you have a PDF plugin for webkit browser?

If you want to display PDF without htmlviewer, please check out our DynaPDF Pro plugin.

[quote=98158:@Urs Jäggi]@thomas: Folder exists. ls /hoem/user/Public/ProjectOverview gives me the correct output.
-I have a If myPDF.Exists <> false Then, but double checked it.
-File permission “my” user

To be 100% sure I downloaded another PDF to another place and tried it without success.
Additionally I added a try-catch statement, no exception.[/quote]

From experiments in Windows, it appears that PDF can be displayed in HTMLViewer only if renderer is set to native and if the Acrobat Reader plugin is installed in Internet Explorer.

In Mint, I use Chrome, which is PDF aware.

[quote=98163:@Thomas Rottensteiner]Or is it just that your WebKit has no plugin to show pdfs?
[/quote]

From what I could see on Windows, WebKit was not able to display PDF. No error, but nothing happens.

PDF plugin for webkit : I didn’t installed any plugin. How can I check that? Or install a PDF plugin?
DynaPDF Pro plugin: This is a little bit to expensive for only showing a PDF.

From what I just experimented on Linux, Firefox is able to open PDF directly, and Document Viewer as well… Why not use what the system provides to show your files ?

folderitem.launch method can open PDFs if a PDF Viewer is installed.

Michel Bujardet: because I would like to show the PDF inside my app.

What I aim: users should be able to show a project overview on a ‘public’ screen. They have the project overview in a Word document. So my idea was: they save it as PDF in a public folder and my application displays the PDFs.

Looks like this is more complicated than I thought. :frowning:

Didn’t found any solution to display a PDF under Linux in the program. My solution: I use a HTMLViewer control and the user saves the Word document as “Web Page”. This works perfect.

I found a way to display PDF in HTMLViewer with pdf2htmlEX

Download Project