@@ -47,6 +47,7 @@ def __init__(self):
4747 self ._cached = {}
4848
4949 @property
50+ @cbook .deprecated ("3.1" )
5051 def gs_exe (self ):
5152 """
5253 executable name of ghostscript.
@@ -64,6 +65,7 @@ def gs_exe(self):
6465 return str (gs_exe )
6566
6667 @property
68+ @cbook .deprecated ("3.1" )
6769 def gs_version (self ):
6870 """
6971 version of ghostscript.
@@ -86,6 +88,7 @@ def gs_version(self):
8688 return gs_version
8789
8890 @property
91+ @cbook .deprecated ("3.1" )
8992 def supports_ps2write (self ):
9093 """
9194 True if the installed ghostscript supports ps2write device.
@@ -1465,15 +1468,10 @@ def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
14651468 psfile = tmpfile + '.ps'
14661469 dpi = rcParams ['ps.distiller.res' ]
14671470
1468- gs_exe = ps_backend_helper .gs_exe
1469- if ps_backend_helper .supports_ps2write : # gs version >= 9
1470- device_name = "ps2write"
1471- else :
1472- device_name = "pswrite"
1473-
1471+ gs_exe , gs_version = checkdep_ghostscript ()
14741472 cbook ._check_and_log_subprocess (
14751473 [gs_exe , "-dBATCH" , "-dNOPAUSE" , "-r%d" % dpi ,
1476- "-sDEVICE=%s" % device_name , paper_option ,
1474+ "-sDEVICE=ps2write" , paper_option ,
14771475 "-sOutputFile=%s" % psfile , tmpfile ], _log )
14781476
14791477 os .remove (tmpfile )
@@ -1484,14 +1482,9 @@ def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
14841482 # the original bbox can be restored during the pstoeps step.
14851483
14861484 if eps :
1487- # For some versions of gs, above steps result in an ps file
1488- # where the original bbox is no more correct. Do not adjust
1489- # bbox for now.
1490- if ps_backend_helper .supports_ps2write :
1491- # fo gs version >= 9 w/ ps2write device
1492- pstoeps (tmpfile , bbox , rotated = rotated )
1493- else :
1494- pstoeps (tmpfile )
1485+ # For some versions of gs, above steps result in an ps file where the
1486+ # original bbox is no more correct. Do not adjust bbox for now.
1487+ pstoeps (tmpfile , bbox , rotated = rotated )
14951488
14961489
14971490def xpdf_distill (tmpfile , eps = False , ptype = 'letter' , bbox = None , rotated = False ):
0 commit comments