Fix convert to gs

This commit is contained in:
Jonas Havelka 2021-04-06 23:11:22 +02:00
parent aa8bb6dde4
commit 795ab34714

View file

@ -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