PDF Printing
Dan Friedman
dan at clearvisiontech.com
Tue Oct 4 15:39:50 EDT 2022
Mark,
Genius! I can't thank you enough... That worked! Make sure that the field that holds the text has a valid font name and isn't inheriting a system-level font. That REALLY ought to be documented in the PDF routines in LC.
As long as I have your ear... Whenever I call this, I get a blank page in the beginning of my PDF. I have checked that I'm not printing a blank page and have debugged this to death! Any thoughts on a blank page being included in a PDF?
-Dan
On 10/4/22, 11:44 AM, "use-livecode on behalf of Mark Waddingham via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of use-livecode at lists.runrev.com> wrote:
On 2022-10-04 16:20, Dan Friedman via use-livecode wrote:
> Here are examples of the printouts (the PDFs):
> Print to PDF - https://www.clearvisiontech.com/WORKING/PrintToPDF1.pdf
> Print to Printer -
> https://www.clearvisiontech.com/WORKING/PrintToPDF2.pdf
>
> Any thoughts or ideas?
Someone had a similar problem in the past (Paul or Klaus maybe?) - it
turned out that it was because no explicit font was set on the stack (or
controls) - meaning that it was using the macOS 'theme' font.
This isn't actually a 'discoverable' font in the various font related
APIs - and appears to be (somewhat!) hard-coded in the various low-level
Apple graphics rendering APIs.
The PDF printer does use the correct fonts and metrics - and CoreText
(on macOS) to do font layout - but the actual PDF generation is done
using a cross-platform library (so the output is the same on all
platforms) which relies on getting the 'real' font data for the given
font (which it does not in this case) and not macOS (CoreGraphics-based)
printing. The latter appears to be able to deal with the 'magic' fonts
(unsurprising as its all Apple stuff), but our pdf printer cannot.
If you set the stack to an explicit font then the problem should go
away.
Alternatively, if this is a mac-only product, you can use macOS's PDF
printing capability by setting the printerOutput property to
"file:<filename>" - on macOS the latter will generate a PDF (i.e. its
the same as choosing 'Save As PDF' from the printer dialog).
Hope this helps!
Mark.
--
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list