Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-12

Souce listing on Mac

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tom Backer Johnsen

Dear all

I have a small problem with Lazarus on a Mac. If I use the print option on a source element, it is printed out, but the first line is missing on every page. I can get around that by printing a pdf of the listing and then adjust the output to match the page size. That works, but it is cuumbersome. That is the main problem.

But I would also like to have a running header on the listing with the name of the unit, a date/time and a "Page x of n" page numbering. And if the left margin could be set (increased) as well, that would be fine.

This was possible to set up in Delphi. Is there an addin for Lazarus to take care of this?

I might add: Otherwise Lazarus is a very fine application!

Tom Backer Johnsen
backer(at)psych.uib.no

Reply by email

Howard Page-Clark
to Tom Backer Johnsen
Tom Backer Johnsen wrote
I have a small problem with Lazarus on a Mac. If I use the print option on a source element, it is printed out, but ...

The file to fiddle with is
lazarus\components\printers\design\sourceprinter.pas

Perhaps a horrid hack such as changing line 101 of the PrintPage method to

  Printer.Canvas.TextOut(Margin, 50 + Round(LineHeight * l), s);

(to increase the y offset by 50 - or some other value that suits your printer's dpi) and recompiling Lazarus would work for you. I think that TPrinterSetupDialog is not supported on Carbon.
However, I don't know what is actually causing the loss of your first line. Finding the cause would lead to a more intelligent remedy than the shot-in-the-dark suggested above.

There are several enhancements (some suggested by the author in a txt file in the source directory ...\printers\design\ ) that you might feel able to contribute if you come up with worthwhile improvements to the existing code. I'm sure patches to improve the functionality would be welcome.

Howard

Reply by email

Tom Backer Johnsen
to Howard Page-Clark

Howard

I have to admit that I was looking for something simpler than a change in the source and recompile of the IDE, I would like to avoid that as long as possible. But thank you for the suggestion anyhow, it may be useful. I'll wait and see if something simpler turns up.

Tom

Howard Page-Clark wrote 24 lines
On 25/12/2013 13:20, Tom Backer Johnsen wrote: > I have a small problem with Lazarus on a Mac. If I use the print > option on a source element, it is printed out, but ... The file to fiddle with is lazarus\components\printers\design\sourceprinter.pas Perhaps a horrid hack such as changing line 101 of the PrintPage method to Printer.Canvas.TextOut(Margin, 50 + Round(LineHeight * l), s); (to increase the y offset by 50 - or some other value that suits your printer's dpi) and recompiling Lazarus would work for you. I think that TPrinterSetupDialog is not supported on Carbon. However, I don't know what is actually causing the loss of your first line. Finding the cause would lead to a more intelligent remedy than the shot-in-the-dark suggested above. There are several enhancements (some suggested by the author in a txt file in the source directory ...\printers\design\ ) that you might feel able to contribute if you come up with worthwhile improvements to the existing code. I'm sure patches to improve the functionality would be welcome. Howard -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Tom Backer Johnsen
Email: backer(at)psych.uib.no

Reply by email