impression_hp: pdfinfo ne plante pas si warnings
This commit is contained in:
parent
13d8829e0d
commit
4c20f02f73
1 changed files with 3 additions and 2 deletions
|
@ -233,8 +233,9 @@ class impression(object):
|
|||
raise FichierInvalide, ("Le fichier ne semble pas etre un PDF", path_to_pdf)
|
||||
|
||||
# on compte les pages et on regarde le format
|
||||
pdfinfo = Popen(["pdfinfo",self._fichier],stdout=PIPE,stderr=PIPE).communicate()
|
||||
if pdfinfo[1] <> '':
|
||||
proc = Popen(["pdfinfo",self._fichier],stdout=PIPE,stderr=PIPE)
|
||||
pdfinfo = proc.communicate()
|
||||
if proc.returncode:
|
||||
raise FichierInvalide(u"pdfinfo n'arrive pas a lire le fichier (il est peut-etre corrompu ou protege par un mot de passe), https://wiki.crans.org/VieCrans/ImpressionReseau#Format_des_fichiers",path_to_pdf)
|
||||
self._pages = -1
|
||||
for line in pdfinfo[0].split('\n'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue