Recent

Author Topic: [SOLVED] Is it possible to print Syntax highlight?  (Read 1887 times)

egsuh

  • Full Member
  • ***
  • Posts: 241
[SOLVED] Is it possible to print Syntax highlight?
« on: June 25, 2019, 08:29:38 am »
in colors..

and is it possible to remove line numbers in printing?
« Last Edit: June 25, 2019, 11:45:46 am by egsuh »

trev

  • Full Member
  • ***
  • Posts: 214
  • Former Delphi 7 and Delphi 10.2 User
Re: Is it possible to print Syntax highlight?
« Reply #1 on: June 25, 2019, 09:27:37 am »
I think you need to add some context  ;)  Where? What? When?
o Lazarus v2.1.0 r61775, FPC v3.3.1 r42640, macOS 10.14.6 (with sup update), Xcode 10.3
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.0 (Parallels VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

howardpc

  • Hero Member
  • *****
  • Posts: 3155
Re: Is it possible to print Syntax highlight?
« Reply #2 on: June 25, 2019, 10:26:29 am »
If you refer to the Print ... menu under the main IDE File menu, then all things are possible, but not without extending the IDE beyond its current capabilities.
To add an option for line number printing to be optional could be done fairly easily, since this would involve merely keeping or discarding information that the current print routine calculates.

To provide for colour printing of syntax highlights (presumably grayscaled on non-colour printers) would be considerably more complex, since the print routine would have to access (or construct) individual highlight information for every code point in the source editor synedit that was to be printed.

Thaddy

  • Hero Member
  • *****
  • Posts: 8967
Re: Is it possible to print Syntax highlight?
« Reply #3 on: June 25, 2019, 10:38:41 am »
There are several html highlighters for Pascal that can be used to pipe to your browser and then print from the browser, if that is an acceptable solution.
Most people that want to use threading should learn to patch their jeans first: use a needle.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5635
    • wiki
Re: Is it possible to print Syntax highlight?
« Reply #4 on: June 25, 2019, 10:49:10 am »
The IDE has an "export to html" function. This preserves the colors, you can then print this from your browser.

The "print" function in the IDE does not yet support color. (would be nice to have)

egsuh

  • Full Member
  • ***
  • Posts: 241
Re: Is it possible to print Syntax highlight?
« Reply #5 on: June 25, 2019, 11:45:31 am »
Alright. Thank you for your kind replies.
Yes, it's simple to open the pascal file in other text editors which support syntax highlights.

Thaddy

  • Hero Member
  • *****
  • Posts: 8967
Re: [SOLVED] Is it possible to print Syntax highlight?
« Reply #6 on: June 25, 2019, 02:02:21 pm »
I would recommend Geany which supports Pascal and - almost - does what you want.
It has some trouble with some of the more advanced FreePascal syntax, though, but so do alternatives.
Most people that want to use threading should learn to patch their jeans first: use a needle.