Serious problems with printing coloured text
Posted: Fri May 03, 2013 12:27 pm
Hello!
I have been using LiveCode for quite a while. I found that it can do a lot more than I thought in the beginning. But now I am really stuck in a project for a publishing company.
It is about printing the contents of a stack (just one text field). I've done it before, but this time the field is containing characters in different colours.
I made a seperate stack for printing. I set the formatForPrinting to true. I closed and removed the stack from memory. I also used it as a completely seperate file.
I copy the htmltext from another field into my textfield on the print stack.
And I did some other things just to try if it makes a difference.
Basically it now looks like this:
set the formatforprinting of stack (progpath&"/Ressources/druckseite.rev") to true
open invisible stack (progpath&"/Ressources/druckseite.rev")
set the locktext of fld "textseite" of stack "druckseite" to false
set the htmltext of fld "textseite" of stack "druckseite" to ( the htmltext of fld "eg_ergebnis" of stack "uebungseditor")
set the formatforprinting of stack "druckseite" to true
set the locktext of fld "textseite" of stack "druckseite" to true
printPage "druckseite" --- my print function
But NO LUCK. It's looking fine on the screen. But the output will always be wrong: All coloured letters are wrong positioned and destroy the whole layout on every printer or PDF. Whatever I tried, it stayed the same.
I've read the instructions on how to make sure that the stack has "formatforprinting" before it is being loaded very carefully. I'm 100% sure this is the case. Still not working.
Does anybody know if this is a general problem, maybe not solvable at the moment - or have I missed something?
I'd appreciate any hint! Thank you!
kroka
I have been using LiveCode for quite a while. I found that it can do a lot more than I thought in the beginning. But now I am really stuck in a project for a publishing company.
It is about printing the contents of a stack (just one text field). I've done it before, but this time the field is containing characters in different colours.
I made a seperate stack for printing. I set the formatForPrinting to true. I closed and removed the stack from memory. I also used it as a completely seperate file.
I copy the htmltext from another field into my textfield on the print stack.
And I did some other things just to try if it makes a difference.
Basically it now looks like this:
set the formatforprinting of stack (progpath&"/Ressources/druckseite.rev") to true
open invisible stack (progpath&"/Ressources/druckseite.rev")
set the locktext of fld "textseite" of stack "druckseite" to false
set the htmltext of fld "textseite" of stack "druckseite" to ( the htmltext of fld "eg_ergebnis" of stack "uebungseditor")
set the formatforprinting of stack "druckseite" to true
set the locktext of fld "textseite" of stack "druckseite" to true
printPage "druckseite" --- my print function
But NO LUCK. It's looking fine on the screen. But the output will always be wrong: All coloured letters are wrong positioned and destroy the whole layout on every printer or PDF. Whatever I tried, it stayed the same.
I've read the instructions on how to make sure that the stack has "formatforprinting" before it is being loaded very carefully. I'm 100% sure this is the case. Still not working.
Does anybody know if this is a general problem, maybe not solvable at the moment - or have I missed something?
I'd appreciate any hint! Thank you!
kroka