Re: PDF Printing
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" 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:" - 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 ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: PDF Printing
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:" - 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 ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: PDF Printing
If it was one computer, I’d say there was a good chance but more than one computer I’d say no. Problem must be elsewhere. Marty > On Oct 4, 2022, at 10:15 AM, Dan Friedman via use-livecode > wrote: > > Thank you for your thoughts, but do you really think a font cache is the > issue? I have two computers in my office having this issue, and about a > dozen Macs at my client's location -- that we know of so far! If it were a > font issue, do you think one print method would be successful, and another > wouldn't? If the font table was messed up, I would think it would be wacked > for all methods. No? > > I could be wrong (I'm wrong all the time!) but, I think it's something in > LC's internal PDF handling, or some property I need to set or reset. > > -Dan > > > On 10/4/22, 9:51 AM, "use-livecode on behalf of Ralph DiMola via > use-livecode" use-livecode@lists.runrev.com> wrote: > >Dan, > >How to delete Windows font cache: > > https://www.tenforums.com/tutorials/54452-rebuild-font-cache-windows-10-a.ht >ml > >Ralph DiMola >IT Director >Evergreen Information Services >rdim...@evergreeninfo.net > >-Original Message- >From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf >Of Dan Friedman via use-livecode >Sent: Tuesday, October 04, 2022 11:21 AM >To: How to use LiveCode >Cc: Dan Friedman >Subject: PDF Printing > >I am getting different results using "open printing to pdf" vs standard >printing to a printer. I have a card with a single field on it with some >formatted text in it. If I print the card to a printer using "open >printing with dialog" it all looks perfect (even if I choose to save it to >PDF in the print dialog). But, if I use the "open printing to pdf" > method, >it get wrong fonts and inconsistent tab spacings. Here is the EXACT code > I >am using: > >on mouseUp currSName > put (the hilite of btn "printAsPDF" of stack "ReportOptions") into >printAsPDF > > if printAsPDF then >ask file "Save As PDF:" with (currSName & ".pdf") >put it into pdfPath >open printing to pdf pdfPath > else >open printing with dialog > end if > > if the result is "Cancel" then >exit mouseUp > end if > > print card 1 of stack "GB_PReport" > close printing >end mouseUp > >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? > >LC 9.6.8 > >___ >use-livecode mailing list >use-livecode@lists.runrev.com >Please visit this url to subscribe, unsubscribe and manage your > subscription >preferences: >http://lists.runrev.com/mailman/listinfo/use-livecode > > >___ >use-livecode mailing list >use-livecode@lists.runrev.com >Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: >http://lists.runrev.com/mailman/listinfo/use-livecode > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
RE: PDF Printing
Your right... If all computers are doing it then font cache is probably not the issue. Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -Original Message- From: Dan Friedman [mailto:d...@clearvisiontech.com] Sent: Tuesday, October 04, 2022 1:16 PM To: How to use LiveCode Cc: Ralph DiMola Subject: Re: PDF Printing Thank you for your thoughts, but do you really think a font cache is the issue? I have two computers in my office having this issue, and about a dozen Macs at my client's location -- that we know of so far! If it were a font issue, do you think one print method would be successful, and another wouldn't? If the font table was messed up, I would think it would be wacked for all methods. No? I could be wrong (I'm wrong all the time!) but, I think it's something in LC's internal PDF handling, or some property I need to set or reset. -Dan On 10/4/22, 9:51 AM, "use-livecode on behalf of Ralph DiMola via use-livecode" wrote: Dan, How to delete Windows font cache: https://www.tenforums.com/tutorials/54452-rebuild-font-cache-windows-10-a.ht ml Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Dan Friedman via use-livecode Sent: Tuesday, October 04, 2022 11:21 AM To: How to use LiveCode Cc: Dan Friedman Subject: PDF Printing I am getting different results using "open printing to pdf" vs standard printing to a printer. I have a card with a single field on it with some formatted text in it. If I print the card to a printer using "open printing with dialog" it all looks perfect (even if I choose to save it to PDF in the print dialog). But, if I use the "open printing to pdf" method, it get wrong fonts and inconsistent tab spacings. Here is the EXACT code I am using: on mouseUp currSName put (the hilite of btn "printAsPDF" of stack "ReportOptions") into printAsPDF if printAsPDF then ask file "Save As PDF:" with (currSName & ".pdf") put it into pdfPath open printing to pdf pdfPath else open printing with dialog end if if the result is "Cancel" then exit mouseUp end if print card 1 of stack "GB_PReport" close printing end mouseUp 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? LC 9.6.8 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: PDF Printing
Thank you for your thoughts, but do you really think a font cache is the issue? I have two computers in my office having this issue, and about a dozen Macs at my client's location -- that we know of so far! If it were a font issue, do you think one print method would be successful, and another wouldn't? If the font table was messed up, I would think it would be wacked for all methods. No? I could be wrong (I'm wrong all the time!) but, I think it's something in LC's internal PDF handling, or some property I need to set or reset. -Dan On 10/4/22, 9:51 AM, "use-livecode on behalf of Ralph DiMola via use-livecode" wrote: Dan, How to delete Windows font cache: https://www.tenforums.com/tutorials/54452-rebuild-font-cache-windows-10-a.ht ml Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Dan Friedman via use-livecode Sent: Tuesday, October 04, 2022 11:21 AM To: How to use LiveCode Cc: Dan Friedman Subject: PDF Printing I am getting different results using "open printing to pdf" vs standard printing to a printer. I have a card with a single field on it with some formatted text in it. If I print the card to a printer using "open printing with dialog" it all looks perfect (even if I choose to save it to PDF in the print dialog). But, if I use the "open printing to pdf" method, it get wrong fonts and inconsistent tab spacings. Here is the EXACT code I am using: on mouseUp currSName put (the hilite of btn "printAsPDF" of stack "ReportOptions") into printAsPDF if printAsPDF then ask file "Save As PDF:" with (currSName & ".pdf") put it into pdfPath open printing to pdf pdfPath else open printing with dialog end if if the result is "Cancel" then exit mouseUp end if print card 1 of stack "GB_PReport" close printing end mouseUp 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? LC 9.6.8 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
RE: PDF Printing
Dan, How to delete Windows font cache: https://www.tenforums.com/tutorials/54452-rebuild-font-cache-windows-10-a.ht ml Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Dan Friedman via use-livecode Sent: Tuesday, October 04, 2022 11:21 AM To: How to use LiveCode Cc: Dan Friedman Subject: PDF Printing I am getting different results using "open printing to pdf" vs standard printing to a printer. I have a card with a single field on it with some formatted text in it. If I print the card to a printer using "open printing with dialog" it all looks perfect (even if I choose to save it to PDF in the print dialog). But, if I use the "open printing to pdf" method, it get wrong fonts and inconsistent tab spacings. Here is the EXACT code I am using: on mouseUp currSName put (the hilite of btn "printAsPDF" of stack "ReportOptions") into printAsPDF if printAsPDF then ask file "Save As PDF:" with (currSName & ".pdf") put it into pdfPath open printing to pdf pdfPath else open printing with dialog end if if the result is "Cancel" then exit mouseUp end if print card 1 of stack "GB_PReport" close printing end mouseUp 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? LC 9.6.8 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: PDF Printing
It could be a corrupted font cache - I’ve found that can cause weird behavior as you’re describing. If you’re on a Mac, do a “safe reboot” (start up with the shift key pressed) and after it boots up, do a normal reboot. That will delete the current font caches and then rebuild them from scratch. It’s little harder to fix on Windows - if that is the case you might Google that. Worth a try anyway. Marty > On Oct 4, 2022, at 8:20 AM, Dan Friedman via use-livecode > wrote: > > I am getting different results using "open printing to pdf" vs standard > printing to a printer. I have a card with a single field on it with some > formatted text in it. If I print the card to a printer using "open printing > with dialog" it all looks perfect (even if I choose to save it to PDF in the > print dialog). But, if I use the "open printing to pdf" method, it get > wrong fonts and inconsistent tab spacings. Here is the EXACT code I am > using: > > on mouseUp currSName > put (the hilite of btn "printAsPDF" of stack "ReportOptions") into printAsPDF > > if printAsPDF then >ask file "Save As PDF:" with (currSName & ".pdf") >put it into pdfPath >open printing to pdf pdfPath > else >open printing with dialog > end if > > if the result is "Cancel" then >exit mouseUp > end if > > print card 1 of stack "GB_PReport" > close printing > end mouseUp > > 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? > > LC 9.6.8 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode