the screenshot use a canvas backdrop picture property that i had paint into a pdf.
its also not possible to set a background image to a pdf because loss of quality.
the method that create a pdf
Var pdf As New PDFDocument(PDFDocument.PageSizes.A4)
pdf.Author = "..."
pdf.Keywords = "..."
pdf.Landscape = True
pdf.Compressed = False
Var g As Graphics = pdf.Graphics
Var pic As Picture = CanvasChart.Backdrop
g.DrawPicture(pic,10,10,g.Width-20,g.Height-20,0,0,pic.Width,pic.Height)
Var f As FolderItem = SpecialFolder.Desktop.Child("Auslastung.pdf")
pdf.Save(f)
f.Open
Why don’t you go directly into the PDF context (PDFGrpahics). This would allow you to zoom into the drawing without loss. That would be an advantage over the static JPG file.
@Martin_T I’m on OSX (Catalina 10.15.7) and using the PDFGraphics way. When I try to load the example projects: /PDF/Invoice or /PDF/GraphicsPath the issue is also there. Images are displayed blurry and not sharp.
My approach is the same as in the examples/PDF/Invoice.
The pictures in the Invoice example are drawn as JPEG… and that means some quality loss (compression artefacts). I’ve been working on some improvements on this and will be available in the next release.
About the PDF GraphicsPath example, it is impossible that the result PDF is blurry; because that is drawn as vectors and, thus, it is resolution independent. In fact, you can open the PDF file with any editor (for example Preview on macOS) and scale it as much as you can… without quality loss.
hi,
i am employee at service hotline, customer care & paper work and beside i do officially a job as software developer, only a few hours a day if there is time. (employed there since 4 month.)
i had used a scanned document as background and print over some text, that was ok at print output and ready.
because this graphics issue by xojo after version update i rebuild this report in more of a half day with lines and boxes and other texts. (the picture background was quick and dirty i know …)
that was much effort that it looks same as the original document which was used in past at this company.
the chart output from mbs to picture to pdf was also good enough and ready to use.
my boss have visions and we made last year a time schedule. i try to do my best as fast as possible to start with a new software to optimize his business processes which will handle the customer base this year before Easter.
the mbs dynachart examples was based on picture output, so it get a picture first and then it draw into.
so i need to draw the picture in the pdf then. i don’t know yet if dynachart can output direct to graphics.
if me print to a 300 dpi (20 years old) printer and if me calculated it correct a A4 page width is 2480 pixels and 3507 height.
the pdf drawn image at top (from canvas backdrop ) was 3.904px × 2.167px in size,
that blurry thing came after a xojo update. my zoomed screenshot was a png.
it seems that pdf class use a fractional part of that dpi.
at least the resulution at print preview should look same as the window backbround before and not coarse.
i responded to your pm.
I have the same problem with the PDF-Class. An invoice is shown correctly on the printer, but in the created pdf the logo-icon, a .png picture, is drawn invers and in a very poor quality.
The same with the invoice example from the Examples\PDF - Folder.