Author Topic: printing via notepad++  (Read 9533 times)

0 Members and 1 Guest are viewing this topic.

andrew_nao

  • Swamp Rat
  • Posts: 566
printing via notepad++
« on: January 07, 2013, 04:05:47 PM »
Hi gang,
Happy new year to you all.

i have code that prints a txt file, and it comes out.. "plain" as if i printed from MS notepad.

if i print the same txt file via notepad++ it adds the time, day and file location stamp at the top of the page.

is there something different i have to do to get code to print as if i printed from notepad++

i know i can add day and time stamp with code, but im curious as to whether i can control how its printed.

hope this makes sense..


irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: printing via notepad++
« Reply #1 on: January 08, 2013, 01:26:55 AM »
I'm "reading" that the code is directly printing the text. Is this correct? If so, what "code" is this? Some sort of lisp calling a program to print, or a DLL/ARX? Could you post the code here?
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

andrew_nao

  • Swamp Rat
  • Posts: 566
Re: printing via notepad++
« Reply #2 on: January 08, 2013, 08:39:52 AM »
yes, its like
(setq printfile (openfile...))
(write-line ..)
(write-line ..)
(write-line ..)
(close printfile)

i guess i answered my own question here....
i just wasnt thinking correctly, of course i cant print from notepad++ if i have (write-line)

 :ugly: :ugly: :ugly:
« Last Edit: January 08, 2013, 09:09:48 AM by andrew_nao »

mmason

  • Guest
Re: printing via notepad++
« Reply #3 on: January 08, 2013, 09:14:22 AM »
Notepad++ is adding the header to the print.  Header and footer options are controllable via options in the settings.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: printing via notepad++
« Reply #4 on: January 08, 2013, 01:59:39 PM »
If you want the header/footer like NP+'s default, then you're out of luck. Apparently it's been a wish for some months now: http://sourceforge.net/p/notepad-plus/feature-requests/1730/

You could always simulate this by sending the page number and filename, then using the page break character (ASCII 12, or "\014" octal, or "\U+000C" unicode) to force a page feed at the correct spot. But you'll need some extra coding for this and you'd need to sort out how long lines should wrap otherwise you might send too many lines onto the page and getting run-on onto a 2nd page which won't have the header.

You could always attemp placing your text into a new word Doc file through ActiveX. You might be able to adjust it through the Word ActiveX library: http://msdn.microsoft.com/en-us/library/office/aa220474%28v=office.10%29.aspx
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.