Printing options

Goffioul Michael goffioul at imec.be
Wed Oct 22 11:04:47 CEST 2003


OK, let me make this a little more clear about how it works.
QPrinter/KPrinter constructor has an argument that tells the
PS generator what resolution to use:
- PrinterResolution: 75 dpi
- ScreenResolution: the actual screen resolution
- HighResolution: 600 dpi
Those values are fixed and the actual printer resolution as
determined in the PPD file is not considered. Most apps uses
the second option because it's the easiest to produce WYSIWYG
print result (konqueror uses 75 dpi, kword uses 600 dpi).

In KPrinter, I extended this behavior by adding the possibility
to tell the KPrinter object to use the resolution as extracted
from the PPD file. If, for any reason, it cannot get the
resolution value, it uses one of the 3 values above as fallback
(the one used in the KPrinter constructor).

Now, the resolution extraction mechanism is based on the PPD
keywords "Resolution" and "DefaultResolution". If an option
"Resolution" exist in the PPD file, KPrinter uses the value
as selected by the user in the printer properties dialog. If
the option doesn't exist, it looks for "DefaultResolution"
which should be present (at least this is the case for all
Foomatic PPD files). Moreover, the resolution value must
follow the syntax "100dpi" or "100x100dpi" to be recognized
(again, as specified by Adobe).

But, let me state this again: in Qt, the application decides
the PS resolution, using fixed values. KPrinter extends this
by providing access to the actual printer resolution, if
possible. But the application is still responsible of using
this. You may force the resolution to be always the printer
resolution, but I'm afraid many apps are not prepared to
this. You can make the test by simply adding the line:

printer.setUsePrinterResolution(true);

just after the printer object creation in the application code.
And try to print to a printer that has a Adobe-compliant PPD
file.

Michael.

**************
This e-mail and/or its attachments may contain confidential information.  It is intended solely for the intended addressee(s).
Any use of the information contained herein by other persons is prohibited.  IMEC vzw does not accept any liability for the contents of this e-mail and/or its attachments.
**************

> I'm not exactly clear on this.  My PPD for my old line printer has:
> 
> *DefaultResolution: 360dpi
> *Resolution 60dpi: "1 dict dup /HWResolution [60 60] put 
> setpagedevice"
> *Resolution 180dpi: "1 dict dup /HWResolution [180 180] put 
> setpagedevice"
> *Resolution 360dpi: "1 dict dup /HWResolution [360 360] put 
> setpagedevice"
> 
> So, it has both a "DefaultResolution" and three "Resolution" 
> settings which 
> I presume is the normal setup for a printer capable of more than one 
> resolution.
> 
> Will the Qt PostScript driver use this information?


More information about the kde-print mailing list