Skip to content

Commit

Permalink
Fail on broken PDF files
Browse files Browse the repository at this point in the history
Related to #2010.
  • Loading branch information
liZe committed Nov 25, 2023
1 parent e975d4c commit 9979f37
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ def document_write_png(self, target=None, resolution=96, antialiasing=1,
with NamedTemporaryFile(delete=False) as pdf:
pdf.write(self.write_pdf(zoom=zoom))
command = [
'gs', '-q', '-dNOPAUSE', '-dBATCH', f'-dTextAlphaBits={antialiasing}',
f'-dGraphicsAlphaBits={antialiasing}', '-sDEVICE=png16m',
f'-r{resolution / zoom}', '-sOutputFile=-', pdf.name]
'gs', '-q', '-dNOPAUSE', '-dBATCH', '-dPDFSTOPONERROR',
f'-dTextAlphaBits={antialiasing}', f'-dGraphicsAlphaBits={antialiasing}',
'-sDEVICE=png16m', f'-r{resolution / zoom}', '-sOutputFile=-',
pdf.name]
pngs = run(command, stdout=PIPE).stdout
os.remove(pdf.name)

Expand Down

0 comments on commit 9979f37

Please sign in to comment.