Welcome! Log In Create A New Profile

Advanced

{WB24} Image control and PDFs

Posted by DarrenF 
{WB24} Image control and PDFs
January 22, 2020 11:50AM
Hi guys,

Can an Image Control display an image of a PDF?

I've dropped an image control onto a page and as the online Help states I just need the following code:

IMG_Control = sFilename

...but nothing is displayed!

The thing that makes me think it is possible is that if I paste the path/filename into the Image Control's "Image" field at design time - the image of the PDF is displayed in the page designer.

Very strange!

My web page accepts the path/filename as a parameter, so as a test, I've added a button that uses fFileExist to make sure that file exists - and it finds the file no problem.

Any ideas what I'm doing wrong or if it's even possible to do what I'm trying to do?

Online Help is here:
[help.windev.com]

Regards,
Darren.



Edited 1 time(s). Last edit at 01/22/2020 12:37PM by DarrenF.
pao
Re: {WB24} Image control and PDFs
January 22, 2020 12:40PM
As far as i know only in WD

[help.windev.com]

Regards

Paulo Oliveira
Re: {WB24} Image control and PDFs
January 22, 2020 12:50PM
Thanks Paulo.

Even though I'm testing in Windows, I'm going to try changing the permissions of the PDF and also try to display a JPG or PNG image - at least that should prove that it's the PDF file type that is causing the issue?

I'll report back...

Regards,
Darren.
JP
Re: {WB24} Image control and PDFs
January 22, 2020 01:41PM
Darren,

How about using PDFExtractPage() to extract a copy of a page as an image variable and saving that to an image file and then pointing to that image file in the control?

JP
Re: {WB24} Image control and PDFs
January 22, 2020 05:00PM
Hi JP,

Yeah, I spotted that, but imagine my disappointment when the Help page seems to imply that it doesn't work with WB thumbs down

I'm not at my dev machine at the moment, but I'll still try it and report back... thumbs up

Regards,
Darren.
Re: {WB24} Image control and PDFs
January 22, 2020 07:40PM
Ok... reporting back...

I changed the permissions on the file to allow "Users" all access and other Admins etc. already had the permissions - and no luck - still nothing displayed sad smiley

Also tried PDFExtractPage function and that just gives a "function not available in Webdev" message! sad smiley

...BUT I've figured it out!!! If you want to use an image control to display an image of your PDF document, all you need to do is a simple properties change. So (obviously) double click the image control, on the properties "General" tab, change the value of "The transformation is calculated for:" drop-down from the default of "Browser" to "Server" ...and that's it! smoking smiley

Regards,
Darren.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: