[Gambas-user] PdfDocument class - problem with landscape PDFs

Claus Dietrich claus.dietrich at freenet.de
Thu Dec 21 20:41:46 CET 2023


 >>On Dec 20. 15:44:57 Claus wrote:

>>Hi
>>Someone in the German Gambas Club raised the question, why the reading 
>>of a PdfDocument in portrait format is OK, but not if it is a PDF in 
>>landscape format.
>>
>>Please find attached a small demo which confirms his observation. I used 
>>the PdfDocument class of the gb.poppler component and the render-method 
>>to read the PDF. The text appears to be horizontally stretched while its 
>>vertical dimensions seem to be correct. After I changed to the gb.pdf 
>>component and adapted the code the result was OK.
>>
>>Is this possibly a bug of the gb.poppler component (couldn't find 
>>anything relevant in the bugtracker) or a wrong use of the PdfDocument?
>>
>>Best regards
>>
>>Claus


>On 20 Dec 2023 22:45:15 Gianluigi wrote:

 >Hi Claus and Lee,
 >
 >have you tried to use the project I put in the Farm?
 >With the first pdf it didn't work but with the second one it did.
 >It works with qt and gtk.
 >The name is DocumentViewPdfZoomDialog is in the Examples
 >
 >Greetings
 >Gianluigi

Dear Gianluigi

A very good example! It helped me to find the bug between my ears. 
Rendering the PDF into a portrait format target is the solution - no 
matter whether it is a portrait or landscape PDF. It seems that the 
interpretation of the term "landscape PDF document" was wrong. With a 
little modification the demo app is now also doing what it was supposed 
to do.

I dropped an according note and code snippet in the German Gambas Club.

Thanks a lot for your attention in this matter and

with best regards

Claus










More information about the User mailing list