@@ -1363,7 +1363,8 @@ def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
1363
1363
operators. The output is low-level, converting text to outlines.
1364
1364
"""
1365
1365
1366
- paper_option = "-sPAPERSIZE=%s" % ptype
1366
+ if eps : paper_option = "-dEPSCrop"
1367
+ else : paper_option = "-sPAPERSIZE=%s" % ptype
1367
1368
1368
1369
psfile = tmpfile + '.ps'
1369
1370
outfile = tmpfile + '.output'
@@ -1385,14 +1386,6 @@ def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
1385
1386
shutil .move (psfile , tmpfile )
1386
1387
1387
1388
1388
- # While it is best if above steps preserve the original bounding
1389
- # box, it does not seems to be the case. pstoeps not only convert
1390
- # the input to eps format, but also restores the original bbox.
1391
-
1392
- if eps :
1393
- pstoeps (tmpfile , bbox , rotated = rotated )
1394
-
1395
-
1396
1389
def xpdf_distill (tmpfile , eps = False , ptype = 'letter' , bbox = None , rotated = False ):
1397
1390
"""
1398
1391
Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file.
@@ -1432,17 +1425,9 @@ def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
1432
1425
os .remove (tmpfile )
1433
1426
shutil .move (psfile , tmpfile )
1434
1427
1435
-
1436
- # Similar to the gs_distillier case, ps2pdf does not seem to
1437
- # preserve the bbox of the original file (at least w/ gs
1438
- # 8.61). Thus, the original bbox need to be resotred.
1439
-
1440
- if eps :
1441
- pstoeps (tmpfile , bbox , rotated )
1442
1428
for fname in glob .glob (tmpfile + '.*' ):
1443
1429
os .remove (fname )
1444
1430
1445
-
1446
1431
def get_bbox_header (lbrt , rotated = False ):
1447
1432
"""
1448
1433
return a postscript header stringfor the given bbox lbrt=(l, b, r, t).
0 commit comments