View Issue Details

IDProjectCategoryView StatusLast Update
0027728LazarusLCLpublic2019-09-11 14:51
ReporterJohannes W. DietrichAssigned ToDmitry Boyarintsev 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformMacintoshOSMac OS XOS Version10.5.8
Product Version1.2.6Product Build2014/12/22 
Target VersionFixed in Version 
Summary0027728: Printing on Mac OS X with 72 dpi only
DescriptionPrinting with Lazarus on Mac OS X (Carbon widgetset) is supported with a resolution of 72 dpi only. Regardless of the printer's capabilities the following values are always identical.

Printer.XDPI=72
Printer.YDPI=72

Therefore, Mac OS X cannot take advantage of the printer's support for high resolution printing.
Steps To ReproduceEvery attempt to print delivers the same result.
Additional InformationSee the following discussions on the forum:

http://forum.lazarus.freepascal.org/index.php/topic,14641.0.html

and

http://forum.lazarus.freepascal.org/index.php/topic,27849
TagsCarbon, Mac OS X, OS X, printer
Fixed in Revisionr48507
LazTarget-
WidgetsetCarbon
Attached Files

Relationships

related to 0036063 new Packages In Cocoa 64bit, Printer.XDPI and Printer.YDPI always return 72 dpi resolution for all printers 

Activities

Johannes W. Dietrich

2015-03-25 17:23

reporter   ~0082305

A first step for improving would be to rewrite the TCarbonPrinter.GetOutputResolution method as:

  function TCarbonPrinter.GetOutputResolution: PMResolution;
  var
    res: OSStatus;
    Major, Minor, Bugfix: SInt32;
    theError: SInt16;
  begin
    theError := Gestalt(gestaltSystemVersionMajor, Major);
    if theError <> 0 then
      Major := 0;
    theError := Gestalt(gestaltSystemVersionMinor, Minor);
    if theError <> 0 then
      Minor := 0;
    if (Major < 10) or (Minor < 5) then
      res := noErr+1;
    else
      res := PMPrinterGetOutputResolution(GetCurrentPrinter, PrintSettings, Result{%H-});
    if res<>noErr then
    begin
      Result.vRes:=72;
      Result.hRes:=72;
    end;
  end;

However, it will not solve any problem. On some machines, still a resolution of 72 dpi is returned, although the printer has 600 or 1200 dpi.

Dmitry Boyarintsev

2015-03-26 01:49

developer   ~0082320

please test and close if ok.

Issue History

Date Modified Username Field Change
2015-03-25 15:29 Johannes W. Dietrich New Issue
2015-03-25 15:33 Johannes W. Dietrich Tag Attached: Carbon
2015-03-25 15:33 Johannes W. Dietrich Tag Attached: Mac OS X
2015-03-25 15:33 Johannes W. Dietrich Tag Attached: printer
2015-03-25 15:34 Johannes W. Dietrich Tag Attached: OS X
2015-03-25 17:23 Johannes W. Dietrich Note Added: 0082305
2015-03-25 22:24 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2015-03-25 22:24 Dmitry Boyarintsev Status new => assigned
2015-03-26 01:49 Dmitry Boyarintsev Fixed in Revision => r48507
2015-03-26 01:49 Dmitry Boyarintsev LazTarget => -
2015-03-26 01:49 Dmitry Boyarintsev Note Added: 0082320
2015-03-26 01:49 Dmitry Boyarintsev Status assigned => resolved
2015-03-26 01:49 Dmitry Boyarintsev Resolution open => fixed
2019-09-11 14:51 Dmitry Boyarintsev Relationship added related to 0036063