Android Question PdfDocument -Print DrawRect Proportions and misaligned problems.

WebQuest

Active Member
Licensed User
Longtime User
Hello Community.
I'm having trouble generating pdfs.
I use BlueStack 5 as emulator on PC Desktop.
When I generate the pdf and import it into the PC via bluestack, I view it correctly with the Microsoft EDGE Browser.

The problem is that when I perform the same procedure on another PC the DrawRects lose their proportions and are misaligned.

[CODE lang="b4x" title="Code B4a Android"] Dim rect As Rect
Dim top As Int=15%x

rect.Initialize(2%x,top,540,312)
pdf.Canvas.DrawRect(rect, Colors.LightGray,True,1)

[/CODE]
 
the same procedure on another PC
so the two "devices" have a different WIDTH?
You should not use 15%x. It´ll result in different Values if the device have different sizes...
 
Upvote 0
A picture is worth a thousand words. You better upload two screenshots to show what you expect and what you got.
 
Upvote 0
the first image the DrawRects are displayed correctly. On the second PC the situation changes.
 

Attachments

  • g1385.png
    g1385.png
    42.9 KB · Views: 561
  • g1370-min.png
    g1370-min.png
    459.6 KB · Views: 590
Upvote 0
Because on two different Computers A PDF with different aspect ratio is generated. Does it depend on the video card? it doesn't seem possible for an .apk to generate different results after being compiled.
 
Upvote 0
Back
Top