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')
subprocess.run([
"convert",
"-density", "300x300",
"-geometry", "{}x{}".format(VYSKA, sirka),
"-background", "white",
"-flatten",
"{}[0]".format(self.pdf.path), # titulní strana
png_filename
"gs",
"-sstdout=%stderr",
"-dSAFER",
"-dNOPAUSE",
"-dBATCH",
"-dNOPROMPT",
"-sDEVICE=pngalpha",
"-r{}x{}".format(VYSKA, sirka),
"-dFirstPage=1d",
"-dLastPage=1d",
"-sOutputFile=" + str(png_filename),
"-f%s" % self.pdf.path
],
check=True,
capture_output=True

Loading…
Cancel
Save