Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - daisearle

Pages: [1]
1
Spine / Printing from the plot screen
« on: 11-Nov-2006, 18:12:51 »
From my limited knowledge of C++ you seem to be doing it right.

I can imagine my problem with the laserprinter could be lack of memory in the printer, just at the point where you start to overlay the NOTAMS.

However why the Epson 860 fails baffles me. Both your code and mine are very easy to make device independent, and if the device is initialised and disposed of properly, what can go wrong!

Thanks for your efforts, but unless I can get some printing going somehow, I'll have to pass on Spine, although I've been impressed with what other people have produced with it.

I'll keep playing a bit longer.

2
Spine / Printing from the plot screen
« on: 10-Nov-2006, 16:44:33 »
I attach some Delphi code in the hope it may help.

BTW the reference to canvas is a Delphi property of any graphical device of any size or resolution, so once you have established its properties any graphics function can write to any device's canvas

The first InitPrinter is from a text program, and the second is from a graphics program. The second is the later program, and it implies that the graphics needed an apparently redundant call to the PrinterIndex property to initialise properly.

As you can see from the {comments}, I am confused why I needed to do this second assignment to PrinterIndex. Whether it was Delphi's implementation of the Microsoft functions or the underlying functions I cannot tell, although the forums I visited suggested it was a Microsoft problem (well, they would, wouldn't they!)

Please excuse the diagnostics commented out, plainly I was confused and irritable at the time!

Procedure InitPrinter;
{
for GetPrinter.... if used...
var
hDevMode:THandle;
Device,Driver,Port:array[0..79] of Char;
}
begin
{
  Assumes A4 throughout, to calculate layout dimensions.
  Has to use WINAPI calls to get pixels per inch.
}
  with printer do
  begin
    printerindex:=-1;
{
    The following 2 lines are said to be necessary to ensure change is fully
    implemented:-
    GetPrinter(device,Driver,Port,hDevMode);
    SetPrinter(device,Driver,Port,hDevMode);

    I have also seen:-
    Printer.PrinterIndex:=Printer.PrinterIndex;

    Probably(?) equivalent. I am not using them (apparently without ill effect)
    as I am setting Printer.PrinterIndex anyway.
 }
    begindoc;
    with canvas do
    begin
      InchPixW:=GetDeviceCaps(printer.canvas.Handle,LogPixelsX);
      InchPixH:=GetDeviceCaps(printer.canvas.Handle,LogPixelsY);
      with font do
      begin
  {
      Is this a Windows bug, or a VCL bug(!?)
      The following line is necessary to ensure font scaling is initialised:-
  }
        pixelsperInch:=InchPixH;
        name:='Arial';
        Size:=LmkFontSize;
      end;
      ThinLine:=round(inchpixh / 300);
      if thinline<1 then
        ThinLine:=1;
      BorderWidth:=Thinline*2;
      SetFontSize(LmkFontSize);
  {
      showmessage('Horizontal pixels/in '+inttostr(inchpixw)+#13+
                  'Vertical pixels/in '+inttostr(inchpixh)+#13+
                  'Thin line width '+inttostr(thinline)+#13+
                  'Line height '+inttostr(lineheight));
  }
      pen.color:=clblack;
    end;
  end;
end;

Procedure InitPrinter;
begin
  with printer do
  begin
    printerindex:=-1;
{
The following seems to be necessary (it might be VCL magic!)to ensure
printer change is fully implemented:-
}
    PrinterIndex:=PrinterIndex;

    begindoc;
    XPixPerMm:=round(GetDeviceCaps(printer.canvas.Handle,LogPixelsX)/InToMm);
    YPixPerMm:=round(GetDeviceCaps(printer.canvas.Handle,LogPixelsY)/InToMm);
{
    showmessage(floattostr(GetDeviceCaps(printer.canvas.Handle,HorzSize)));
    showmessage(floattostr(GetDeviceCaps(printer.canvas.Handle,VertSize)));
}
  end;
end;

3
Spine / Printing from the plot screen
« on: 08-Nov-2006, 16:47:29 »
no problems with any other colour graphics printing program over two or three years! I have double checked, MsPaint still works!

Is there a problem with initialisation of the printer object? I used to write some fairly exacting graphic software in Delphi, where initialisation of the chosen printer scaling required some inelegant workarounds, allegedly because of Microsoft standard calls not correctly returning all the properties expected.

4
Spine / Printing from the plot screen
« on: 07-Nov-2006, 17:29:19 »
I have just installed spine 3.7 on a windows 98 L2 machine. The text listing of NOTAMS works fine on both printers I have attached to the computer. I have a Laserjet 4L, and an Epson Stylus Color 860. However the plot screen only prints the base information with no NOTAM data on the Laserjet, and prints nothing at all on the Epson (I particularly wanted to print in colour). If I examine the printer status dialog there is no document listed, when I try to use the Epson. I haven't looked at the dialog when using the Laserjet, as it actually printed something. It doesn't matter whether I select the printer to use via the printers dialog, or set either one as the Windows default printer.

Any ideas, or workarounds?

Pages: [1]