[SOLVED] trouble printing to printer

Post your Gambas programming questions here.
Post Reply
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

[SOLVED] trouble printing to printer

Post by grayghost4 »

I am having trouble with printing. When I print to a pdf file or preview on the screen everything is fine.
When I print the .pdf file to the printer it is fine on the printer.
But, If I print directly to the printer (without the pdf file) the font size is wrong and the horizontal lay out is wrong.
A year ago I did not have this problem ... it all worked well.
It is like gambas is using inches and the printer is using metric.
Last edited by grayghost4 on Wednesday 5th May 2021 9:12pm, edited 2 times in total.
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: trouble printing to printer

Post by grayghost4 »

I have found the problem, but I don't know how to fix it

The print to file and preview use 300 dots per inch resolution, and the printer driver to the printer uses 72 dots per inch (dpi)

The command
Printer.resolution = 300
does not seem to correct the problem
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: trouble printing to printer

Post by grayghost4 »

I have been able to find a fix for my problem , lots of trial and error :

By using these two commands together :
 Printer1.Resolution = 72
   Paint.FontScale = 1
OR;
 Printer1.Resolution = 300
   Paint.FontScale = 0.2
They both seem to give similar results, You must use both commands together.
Either one by themselves will not correct the problem with canon printer driver and gb.gtk3
I have not tried other resolution and fontscale combination ... that is for later ;)

later has arrived:
For my setup debian and a canon ts8220 printer and gtk3 the exact setting is 64 to exactly match the preview to the printout, But you must use both resolution and fontscale .... either one alone produces opposite results.
 Printer1.Resolution = 64
   Paint.FontScale = 1
Post Reply