Page 1 of 1

Print file

Posted: Sun Apr 03, 2016 2:46 pm
by neville
I have a card which prints correctly in MacOS using "print cd ..into.." but the formatting goes awry (in fact some bits don't print at all) in Windows. I gather the correct solution is to use "open printing for PDF". Great, it produces a correct PDF file on both platforms. Now how do I print the PDF file? I can "print card" or "print stack" but where is "print file"? This must be a dumb question, because surely every language has a method for printing files; so what I am I missing?

Re: Print file

Posted: Sun Apr 03, 2016 3:05 pm
by Klaus
Hi neville,

you aren't missing anything, LC cannot print external files!
But check the "formatforprinting" property in the dictionary, maybe that helps.


Best

Klaus

Re: Print file

Posted: Sun Apr 03, 2016 3:28 pm
by neville
B***er! If LC produces PDF it ought to be able to print it.

I was hoping to avoid formatforprinting, it just seems too weird - only works with an invisible stack which has to be closed purged and then re-opened, don't edit ... that surely must have been a temporary kludge for which I guessed "open printing for PDF" was to be the proper elegant solution.

I wonder if I could use a doshell command, streaming .. no, there be demons (daemons?)

Re: Print file

Posted: Mon Apr 04, 2016 10:32 am
by neville
I have formatForPrinting working, with some minor problems of measureText not giving quite accurate results and clear backgrounds being rendered in grey, both surmountable problems. Printing to PDF would be a much less cumbersome (and generic) solution however so I will be making a feature request for printing pdf files.

Re: Print file

Posted: Thu Apr 14, 2016 1:47 pm
by MaxV
To print on Windows, substituting <printer name> and <nameFile> with the correct ones:

Code: Select all

put shell("cscript prnjobs.vbs –l –p <printer name>  <nameFile>")
to print on Linux or Mac:

Code: Select all

put shell("print  <nameFile>")

Re: Print file

Posted: Fri Apr 15, 2016 2:03 am
by neville
Good one! Definitely a code snippet to squirrel away in a macro.

The LC team has noted the feature request, evidently not such a hard thing to implement, at least on MacWinLin.

Thank you.