Mac Monterey O$ 10.1 PDF not creating

Michael Houlberg michael at houlbergdevelopment.com
Mon May 23 16:25:11 UTC 2022


Sue,

The problem is that Apple deprecated the version of Python included in the Omnis runtime that powers the kOmnisPDF device for creating PDFs.  So using Omnis 10.2 won’t help you either.  Omnis knows about the problem and it is identified as ST/RC/1386 with a status of “integrated and awaiting QA test” the last time I checked.

There is another method of printing PDF’s which is a Mac-only solution. As I remember, this has been available in Omnis for a long time prior to their inclusion of cross platform PDF printing using the Omnis PDF Device.  Look up $macosdesttype in the docs for some more information.

I set it up by using $putfilename to have the user choose a place to put the file

Then...
Calculate $cdevice as kPrinter
Calculate $prefs.$macosdesttype as kPDF
Calculate $prefs.$macosdestname as <path from $putfilename>

Then you just print the report. I usually save the current $cdevice in a local var and set it back when finished, in case it is set to screen or something else.

Michael Houlberg
Houlberg Development, LLC

> On May 22, 2022, at 6:42 PM, Sue Leaver <sue at leaver.co.nz> wrote:
> 
> A client upgraded their Mac to Monterey and are running Studio 10.1 - I see
> they should be using 10.2 but that isn't an option at the moment. The
> program uses the code below to print an invoice to a PDF. When they upgraded
> to Monterey it stopped creating the PDF. Same thing with a text file created
> elsewhere in the program, file stopped creating. I don't have a Mac to try
> things on. Hoping someone can tell me how to get this working again.
> 
> 
> 
> Sue
> 
> 
> 
> Calculate HTML_FILE_NAME as con(SYSTEM_PDF_LOCATION,'Inv',ENTRY_CODE)
> 
> Do ivoP.$setAttachmentDevice(HTML_FILE_NAME,kTrue,kTrue) ## true means
> delete any preexisting file of the same name
> 
> Do $cdevice.$assign(kDevOmnisPDF) ## set which device to print to
> 
> Do $prefs.$reportfile.$assign(HTML_FILE_NAME)
> 
> Set report name Dr_Invoices
> 
> Calculate ENTRY_SEQ_COPY1 as ENTRY_SEQ
> 
> Set search as calculation (ENTRY_SEQ=ENTRY_SEQ_COPY1)&not(ITEM_CONTROL)
> 
> Print report (Use search) 
> 
> #Wait for file to be created
> 
> Repeat
> 
> Do FileOps.$doesfileexist(HTML_FILE_NAME) Returns #8
> 
> Calculate iNum as sleep(100)
> 
> Until #8=kTrue
> 
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list