Browse Source

Fix convert to gs

middleware_test
Jonas Havelka 4 years ago
parent
commit
795ab34714
  1. 19
      seminar/models.py

19
seminar/models.py

@ -602,13 +602,18 @@ class Cislo(SeminarModelBase):
png_filename = pathlib.Path(tempfile.mkdtemp(), 'nahled.png') png_filename = pathlib.Path(tempfile.mkdtemp(), 'nahled.png')
subprocess.run([ subprocess.run([
"convert", "gs",
"-density", "300x300", "-sstdout=%stderr",
"-geometry", "{}x{}".format(VYSKA, sirka), "-dSAFER",
"-background", "white", "-dNOPAUSE",
"-flatten", "-dBATCH",
"{}[0]".format(self.pdf.path), # titulní strana "-dNOPROMPT",
png_filename "-sDEVICE=pngalpha",
"-r{}x{}".format(VYSKA, sirka),
"-dFirstPage=1d",
"-dLastPage=1d",
"-sOutputFile=" + str(png_filename),
"-f%s" % self.pdf.path
], ],
check=True, check=True,
capture_output=True capture_output=True

Loading…
Cancel
Save