Print file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Print file
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
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
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
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?)
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
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
To print on Windows, substituting <printer name> and <nameFile> with the correct ones:
to print on Linux or Mac:
Code: Select all
put shell("cscript prnjobs.vbs –l –p <printer name> <nameFile>")
Code: Select all
put shell("print <nameFile>")
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: Print file
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.
The LC team has noted the feature request, evidently not such a hard thing to implement, at least on MacWinLin.
Thank you.