Horizontal/Vertical print resolution @ 96 dpi

Thanks for this advice, but didn’t help. Our printer has a maximum dpi of 203. Setting dpi exact to 203 doesn’t influence the result.

With Version 2017r1.1 the result is still depending on the printer we use. On some the resolution is better, on some it isn’t.

203? that is a strange value… what is the make/model of the printer?

It´s a EpsonTM-T20II .
80mm POSprinter

With different laserprinter its the same problem.

Barcode printers… very odd number, but …

Have-you checked this page: PrinterSetup.MaxHorizontalResolution , especially the -1 trick (to get the Printer max value) ?

Divide that by 2.54. The printer is 80 pixels/cm.

Thanks for the replys.
But we found no solution .
Our problem:
The printoutput of a xojo report is between 72. dpi and 96 dpi.
It looks awesome.
We are printing barcode and QRCode. They are not scanable.
HOW can we get a print with 200-300 dpi with the xojo report? Thats my problem!!!

Thanks for your help.

Why the barcode/QRCode are not scalable? You can use a 200-300 dpi images in 72dpi, just resize the image.

You can’t. This make the xojo report pretty much useless.

You can wait for 2017r2. According to Feedback, this one will be fixed in the upcoming release: <https://xojo.com/issue/45971>

Ok this works to get a high res report image.

Dim ss As String = ps.SetupString ss = ss.ReplaceAll("ActualHorizontalResolution=72","ActualHorizontalResolution=600") ss = ss.ReplaceAll("ActualVerticalResolution=72","ActualVerticalResolution=600") ps.SetupString = ss

Just understand this is
a) unsupported
b) not recommended
c) not cross platform in any way
d) may break if we ever change the printer setup string format

For now it’s the only way I know to get High resolution reports. I added compiler directives to fall back to the old method in future versions since this will supposedly be fixed.

I tested the following code on Windows using Xojo 2017r1.1and it prints a nice looking report once again.

In a module add the following two methods:

Public Function RunHighRes(extends rpt as report,rs as RecordSet, printersettings as PrinterSetup, HRes as Integer = 600, VRes as Integer = 600) as Boolean
  #if TargetWindows and XojoVersion < 2017.2 then
    Dim ss As String = printersettings.SetupString
    ss = ss.ReplaceAll("ActualHorizontalResolution=" + printersettings.HorizontalResolution.ToText,"ActualHorizontalResolution=" + HRes.ToText)
    ss = ss.ReplaceAll("ActualVerticalResolution=" + printersettings.VerticalResolution.ToText,"ActualVerticalResolution=" + VRes.totext)
    Dim ps As PrinterSetup = printersettings
    ps.SetupString = ss
  Return rpt.Run(rs,ps)
End Function

Public Sub PrintHighRes(extends rpt as Reports.RBReportDocument, g as Graphics)
  #If TargetWindows And XojoVersion < 2017.2 Then
    For i As Integer = 1 To rpt.PageCount
      Dim p As picture = rpt.Page(i)
      Dim w,h As Integer
      w = p.Width
      h = p.Height
      Dim scale As Double
      scale = Min(g.Width / w,g.Height/h)
      If scale > 1 Then scale = 1
      g.DrawPicture(p,0,0,w*scale, h*scale,0,0,w,h)
      If i < rpt.PageCount Then g.NextPage
End Sub

Then call them like this:

rpt.RunHighRes(rs,ps) rpt.Document.PrintHighRes(g)

i have xojo 2017 r2 and internal report still print in lowres :frowning:

With Neil code ?

yes with neil code on windows

[quote=324946:@Travis Hill]Try the included [Printing and Reporting/Printing/PrintingGraphics/PrintingPicture] example. You should notice a difference in output between low and high- high just takes a higher resolution image and scales it down, creating higher resolution output.


Hi Travis,
this example works (for Bitmaps and Strings) and I understand the concept and advantage of a virtual layout. The problem we have (and others) is the following: We need lines, rectangles, circles etc. with, for example, 0.1 mm thickness. At 96 dpi one pixel is approximately 0.265 mm. And PenWidth/PenHeight are Integers, so less than 1 is not possible.

Microsoft, however, writes this: Direct2D uses a floating-point coordinate space and antialiasing, so any content can be scaled to any arbitrary DPI.


The short question is this: How can we draw a line with a thickness of 0.1 mm? This was no problem with Xojo 2016 r3 (and before).

I just bumped into the pitiful limitation to 96 dpi when I tried to generate Check Print’R+ and Check Writer III+ with higher than the 2016R3 I have been using until now.

After reading the somewhat dismissive comments in this thread, as well as in <https://xojo.com/issue/47538> and <https://xojo.com/issue/47424> I see no way to get the actual resolution of the printer. I cannot release my popular software with some half botched solution based on reducing a picture by some arbitrary resolution. I have one printer with 600x600, another one with 360x360, and used to have a Canon printer with rectangular pixels. I absolutely need to know the resolution of the equipment users employ.

It is really a pity that an “improvement” in effect renders printing in Xojo as crude as some prehistoric equipment. That leaves me absolutely no incentive whatsoever to upgrade. In fact, I had already decided not to buy a new license until Windows got to a really usable state, but that is such a show stopper, I may have to settle with 2016R3 for a long time, especially with the kind of answers I see so far. Jeez, I wonder how my customer would take it if I had the same take it or leave it attitude…

I wonder if Christian would not have here a wonderful market for a printing plug in. It does not seem out of this world to tap into the API, to be able again to have a decent printing service. Unless I create my own DLL with VS…