@@ -1096,16 +1096,24 @@ def _print_figure_tex(self, outfile, format, dpi, facecolor, edgecolor,
1096
1096
isLandscape = True
1097
1097
width , height = height , width
1098
1098
bbox = (lly , llx , ury , urx )
1099
- temp_papertype = _get_papertype (width , height )
1100
- if papertype == 'auto' :
1101
- papertype = temp_papertype
1102
- paperWidth , paperHeight = papersize [temp_papertype ]
1099
+
1100
+ # set the paper size to the figure size if isEPSF. The
1101
+ # resulting ps file has the given size with correct bounding
1102
+ # box so that there is no need to call 'pstoeps'
1103
+ if isEPSF :
1104
+ paperWidth , paperHeight = self .figure .get_size_inches ()
1103
1105
else :
1104
- paperWidth , paperHeight = papersize [papertype ]
1105
- if (width > paperWidth or height > paperHeight ) and isEPSF :
1106
+ temp_papertype = _get_papertype (width , height )
1107
+ if papertype == 'auto' :
1108
+ papertype = temp_papertype
1106
1109
paperWidth , paperHeight = papersize [temp_papertype ]
1107
- verbose .report ('Your figure is too big to fit on %s paper. %s \
1108
- paper will be used to prevent clipping.'% (papertype , temp_papertype ), 'helpful' )
1110
+ else :
1111
+ paperWidth , paperHeight = papersize [papertype ]
1112
+ if (width > paperWidth or height > paperHeight ) and isEPSF :
1113
+ paperWidth , paperHeight = papersize [temp_papertype ]
1114
+ verbose .report ('Your figure is too big to fit on %s paper. %s \
1115
+ paper will be used to prevent clipping.'% (papertype , temp_papertype ), 'helpful' )
1116
+
1109
1117
1110
1118
texmanager = renderer .get_texmanager ()
1111
1119
font_preamble = texmanager .get_font_preamble ()
@@ -1247,8 +1255,14 @@ def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None):
1247
1255
os .remove (outfile )
1248
1256
os .remove (tmpfile )
1249
1257
shutil .move (psfile , tmpfile )
1250
- if eps :
1251
- pstoeps (tmpfile , bbox )
1258
+
1259
+
1260
+
1261
+ # Since the the paper size is set to the figure size for eps
1262
+ # output (in '_print_figure_tex'), pstoeps call is not required.
1263
+
1264
+ #if eps:
1265
+ # pstoeps(tmpfile, bbox)
1252
1266
1253
1267
1254
1268
def xpdf_distill (tmpfile , eps = False , ptype = 'letter' , bbox = None ):
0 commit comments