When drawing a 600 DPI picture in a area, I see people getting a 72DPI garbage result. I couldn’t find in the manual how to set the resolution to the usual standards 150, 300 and 600 DPI. Am I missing something or is it an incomplete feature? Still a WIP, or the manual is not clear, or am I being myopic here?
This recent thread has a response from @Javier_Menendez that may prove useful:
No, really not useful. It ended without a solution, the version at that time presented the same defects, missing feature and people had no solution.
But there was a Feedback Case included in the discussion that you can sign on to and follow:
<https://xojo.com/issue/63039>
Eight months old, not implemented yet.
You can use our MBS DynaPDF plugin instead of the built-in class.
We can do higher dpi, jpeg pass through, preserve or convert color spaces and later optimize images.
Well… but it won’t be a solution for “How to set Xojo’s PDF resolution”
But right now I know it’s a very basic missing feature that we do not have it working yet but we have an old report for it we can track. [https://xojo.com/issue/63039](https://xojo.com/issue/63039)
Thanks for the info, Anthony.
I am battling with the resolution issue.
Var d As New PDFDocument
Var g As PDFGraphics = d.Graphics
g.DrawPicture(pic, 0, 0)
(not full code)
this blog suggests, the issue has been resolved. Yet I can not implement pics without blur.
How is the resolution set?
g.ScaleX = dMyScale
has no effect
Maybe you can find this blog post useful: PDFDocument: No More Blurry Images – Xojo Programming Blog
@Javier_Menendez
Thank you!
Indeed, i missed something in the Blog: myImage.Width/3,
The division by Three.
Now my Image is crisp.
There are still some open questions:
-
placing text at g.DrawText(“X”, 590, 840) will meet the lower right corner of my A4 page. This equates to 72 dpi. However the Image obviously has better resolution. Why is the x, y reference not according to the resolution?
-
I need to place g.DrawText(“X”, 0, 10) to meet the left upper corner. Why is y=10 needed, not 0?
-
this is the important one:
I am rewriting code where I placed container controles
ccList_Purchaseitems.DrawInto(g, 0, 0)
How do I do this in the pdf? Of corse, I could run through my lists and place all Items, Quantities and Prices as text. But I am strongly hoping to avoid this, as all is neatly placed in the container -
maybe interesting to others: you can use fractions
g.DrawText(“- |”, 300, 400)
g.DrawText(“- |”, 300.5, 400.5)
g.DrawText(“- |”, 301, 401)
This will be placed at three different locations
PDFs do not have an intrinsic pixel resolution. They are resolution-independent. In fact, the coordinates you are referencing are in PPI - points per inch. There are 72 points per inch in all modern vector systems, which conveniently corresponded to older computer monitors which were 72 DPI - dots per inch. Hence the confusion.
This is also why you can use fractional values for coordinates: points can be subdivided indefinitely, unlike dots or pixels.