@@ -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 )
@@ -8367,16 +8369,22 @@ def restore_settings(self):
8367
8369
if wx .Platform == "__WXMSW__" :
8368
8370
gs_path = get_ghostscript_path ()
8369
8371
settings ['gs_path' ] = gs_path
8370
- elif wx .Platform == '__WXGTK__' :
8372
+ #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.
8373
+ #elif wx.Platform == '__WXGTK__':
8374
+ else :
8371
8375
try :
8372
8376
gs_path = subprocess .check_output (["which" , "gs" ])
8373
8377
settings ['gs_path' ] = gs_path [0 :- 1 ].decode ()
8374
8378
except :
8375
- settings ['gs_path' ] = ''
8379
+ if wx .Platform == "__WXMAC__" and int (platform .mac_ver ()[0 ].split ('.' )[0 ]) <= 13 :
8380
+ settings ['gs_path' ] = '/usr/bin/pstopdf'
8381
+ else :
8382
+ settings ['gs_path' ] = ''
8376
8383
#1.3.6.1 [SS] 2014-01-13
8377
- elif wx .Platform == "__WXMAC__" :
8378
- gs_path = '/usr/bin/pstopdf'
8379
- settings ['gs_path' ] = gs_path
8384
+ #FAU:PDF:pstopdf is not provided by Apple starting from MacOS Sonoma. So merge with Ghostscript in case ghostscript is installed
8385
+ #elif wx.Platform == "__WXMAC__":
8386
+ # gs_path = '/usr/bin/pstopdf'
8387
+ # settings['gs_path'] = gs_path
8380
8388
8381
8389
# 1.3.6.1 [SS] 2015-01-12 2015-01-22
8382
8390
gs_path = settings ['gs_path' ] #eliminate trailing \n
0 commit comments