Fix #1617 (pdftrim bad error checking)

This commit is contained in:
Kovid Goyal 2009-01-14 12:44:10 -08:00
parent 0a1b6ccd26
commit a1a86d8e13

View File

@ -50,12 +50,16 @@ def main(args=sys.argv):
except: except:
print "Unable to read input" print "Unable to read input"
return 2 return 2
info = input_pdf.getDocumentInfo() title = _('Unknown')
title = 'Unknown' author = _('Unknown')
author = 'Unknown' try:
if info.title: info = input_pdf.getDocumentInfo()
title = info.title if info.title:
author = info.author title = info.title
if info.author:
author = info.author
except:
pass
if opts.bounding != None: if opts.bounding != None:
try: try:
bounding = open( opts.bounding , 'r' ) bounding = open( opts.bounding , 'r' )