PDF not working in Clarion IMAGE control

I am making use of the Image control (Clarion 11) and it works 100% for images (Jpg etc.)
I store the image data in a BLOB field.

When I try to upload a PDF, nothing works. No errors, but also nothing shown or stored.

Any suggestions?

Hi Jaco

check the help for the file types that can be used by an image control:

The displayed file may be a bitmap (.BMP), PaintBrush (.PCX), Graphic Interchange Format (.GIF), JPEG (.JPG), or Windows metafile (.WMF). The file may be an icon (.ICO) or Icon Equate in an IMAGE on a WINDOW but not on a REPORT, because Windows does not support printing icons. The type of file is determined by its extension.

I seem to remember PNG was added some time back as well but am not completely sure of that.

Anyway PDF is not supported in an image control.

You can of course store a pdf in a blob but you will have to move it there yourself using something like fileToBlob from CWUtil.clw or st.ToBlob if you have StringTheory. SystemStringClass also has a ToBlob method.


Thanks, I really appreciate your help.

@Jaco you have a couple of options. Back in the day, I converted the first page of the PDF to a JPG image and used the image control to display that. Worked, but not that pretty. You are not going to get an actual PDF to display in an Clarion image control.
What I’ve been doing lately is using Chrome Explorer from Capesoft. If the file I want to display is a .PDF, I load the chrome explorer object with the PDF. This allows for paging back and forth and options like printing an downloading. If the file to be display is an image type (JPG,PNG,etc), the I display it in an image control.

1 Like

Similar to Rick’s suggestion, we use an OLE = Shell.Explorer.2 for .pdf as follows …

szFilename   CSTRING(255)

Window      WINDOW('Caption'),AT(,,1029,574),SYSTEM,FONT('Microsoft Sans Serif',8)

      szFilename = 'put_your_filename_here'
         CASE Event()
         of EVENT:OpenWindow        
            ?myPDF{'navigate("file://' & szFilename & '")'}

Don’t know how long embedded IE will last but it’s still working for us in Windows 10 & 11.

1 Like

I needed to put PDF pages on a report. I used the free GhostScript DLL to convert PDF pages to PNG. Then I used a little Report, that just had an IMAGE, to make page WMF files.

You can use WPViewPDF to display PDFs inside a Clarion app
About (klarisoft.com)
It’s very fast and also supports printing, zooming etc

Leonid Chudakov
[email protected]