@@ -934,8 +934,10 @@ def AbcToPDF(settings, abc_code, header, cache_dir, extra_params='', abcm2ps_pat
934
934
# convert ps to pdf
935
935
# p09 we already checked for gs_path in restore_settings() 2014-10-14
936
936
cmd2 = [gs_path , '-sDEVICE=pdfwrite' , '-sOutputFile=%s' % pdf_file , '-dBATCH' , '-dNOPAUSE' , ps_file ]
937
- # [SS] 2015-04-08
938
- if wx .Platform == "__WXMAC__" :
937
+ #FAU:PDF:Manage the case where one put ps2pdf from ghostscript instead of gs directly
938
+ if 'ps2pdf' in gs_path :
939
+ cmd2 = [gs_path , ps_file , pdf_file ]
940
+ elif wx .Platform == "__WXMAC__" and int (platform .mac_ver ()[0 ].split ('.' )[0 ]) <= 13 and gs_path == '/usr/bin/pstopdf' :
939
941
cmd2 = [gs_path , ps_file , '-o' , pdf_file ]
940
942
if os .path .exists (pdf_file ):
941
943
os .remove (pdf_file )
@@ -8428,16 +8430,22 @@ def restore_settings(self):
8428
8430
if wx .Platform == "__WXMSW__" :
8429
8431
gs_path = get_ghostscript_path ()
8430
8432
settings ['gs_path' ] = gs_path
8431
- elif wx .Platform == '__WXGTK__' :
8433
+ #FAU:PDF:pstopdf is not provided by Apple starting from MacOS Sonoma. So in any case look for ghostscript and use /usr/bin/pstopdf only if Mac OS version earlier than Sonoma.
8434
+ #elif wx.Platform == '__WXGTK__':
8435
+ else :
8432
8436
try :
8433
8437
gs_path = subprocess .check_output (["which" , "gs" ])
8434
8438
settings ['gs_path' ] = gs_path [0 :- 1 ].decode ()
8435
8439
except :
8436
- settings ['gs_path' ] = ''
8440
+ if wx .Platform == "__WXMAC__" and int (platform .mac_ver ()[0 ].split ('.' )[0 ]) <= 13 :
8441
+ settings ['gs_path' ] = '/usr/bin/pstopdf'
8442
+ else :
8443
+ settings ['gs_path' ] = ''
8437
8444
#1.3.6.1 [SS] 2014-01-13
8438
- elif wx .Platform == "__WXMAC__" :
8439
- gs_path = '/usr/bin/pstopdf'
8440
- settings ['gs_path' ] = gs_path
8445
+ #FAU:PDF:pstopdf is not provided by Apple starting from MacOS Sonoma. So merge with Ghostscript in case ghostscript is installed
8446
+ #elif wx.Platform == "__WXMAC__":
8447
+ # gs_path = '/usr/bin/pstopdf'
8448
+ # settings['gs_path'] = gs_path
8441
8449
8442
8450
# 1.3.6.1 [SS] 2015-01-12 2015-01-22
8443
8451
gs_path = settings ['gs_path' ] #eliminate trailing \n
0 commit comments