Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 4 Monaten, 1 Woche
Letzter Beitrag:
vor 4 Monaten
Beteiligte Autoren:
Arie, Fabrice Harari, Tor-Bjarne

WD21 - PDF in imagecontrol bad quality

Startbeitrag von Arie am 15.09.2017 09:32


In one of our applications we are showing images like jpg, png but also pdf.
Most of the pdf's are perfectly readable, but some are not.
See below the first example is the pdf opened with Irfanview (same quality as for example in the Edge-browser).
The second example is in an WD image control. Bad quality.

Do I have any options to improve the quality of the PDF shown in an image control?

[attachment 2438 Clip31.png]
[attachment 2439 Clip32.png]

BTW: the imagecontrol is used to extract al individual pages of the PDF and save them als JPG files. I can use Irfanview for that, but that means on every client an extra tool has to be installed. I prefer not to.


Hi Arie,

there are 2 componants to your question:

1. the display quality problem
2. the page extractions

The answer is different for the 2 parts :

1. In order to have a better image DISPLAYED quality, you need to change the settings of the image field to something like homethetic/centered/+High Quality

2. In order to have a good quality when extracting pages from your pdf you need something completely different (which is why I'm using a HIDDEN image field to do this part):
- set your hidden image field as 100%
- get the size in pixel of the pdf page using the infobitmap function
- RESIZE your hidden image field to the exact value found (..width and ..height). You may want to also change ..X to push it further out left
- THEN load the image in the field, and loop on the pages to save each page as images

The SIZE of the image control has to be EXACTLY the size of the page, or SCALING will occur and make the resulting image blurry/low quality.

Best regards

von Fabrice Harari - am 15.09.2017 14:33
Thanks Fabrice,

but I'm already doing both. It works for most (in fact all) pdf's, for quite some time. Until recently with pdf's coming from the one particular customer. I guess these pdf's differ from most others in some way, but I cannot see how.

I already send an example to PCSoft. They should be able to see the difference behind the scenes. Hope they are willing to do so as well.

For those interested: here is on of the bad guys

Try to load in an imagecontrol. No need for a compiled executable, it even goes wrong in the IDE.

von Arie - am 15.09.2017 18:46
Hi Arie,

I looked at your file, and it's not a version problem (1.7, and others of that version are ok)

However, I found out that your pdf seems to have multiple layers (by the way, I could read easily what's under the black rectangles). You can see that by opening it in acrobat readers: first the bad quality/thumbnail layer is displayed, then the good quality on top of it. and that's probably what is not supported in the image field.

So, it looks like you need to find a way to flatten that pdf (or ask your customer to stop playing with layers).

Best regards

von Fabrice Harari - am 16.09.2017 12:54
Thanks Fabrice,

I didn't know about the layers, so that explains the problem. I send pcsoft an example. Waiting for an answer now....

von Arie - am 18.09.2017 10:52
Hi Arie,

Whats funny is that the "sender" (GPC) in your form has a WinDev system for shipping fish (FlyFish) delivered from me. :)


von Tor-Bjarne - am 18.09.2017 17:30
Hi Tor-Bjarne,

it's a great world and small at the same time!

Is the PDF also generated by your application? If so, then I could make a small sample for pcsoft and let them see their image control can not handle pdf's created by themselves. It would simplify their taks to solve this problem.

btw: I thought I had hidden all names for privacy reasons, but obviously I missed some pieces. So I removed the pdf.

von Arie - am 18.09.2017 18:42
Hi Arie,

good thing that you removed it, because ALL masked information was clearly visible in my pdf editor (once again, it looked like you had just added a layer of masking tape on top, but you didn't merge the different layers.

Best regards

von Fabrice Harari - am 19.09.2017 16:05
Is the PDF also generated by your application?

Yes, but I use List and Label to generate PDF`s and do not use any image to show PDF`s (We only ship PDF`s)


von Tor-Bjarne - am 21.09.2017 18:58
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.