Run final ghostscript in multithreaded mode

This step is serialized so all cores are not busy at this stage.
This commit is contained in:
James R. Barlow
2015-07-30 23:20:04 -07:00
parent 9918c4020e
commit 454ee029c8
+2 -1
View File
@@ -31,13 +31,14 @@ def rasterize_pdf(input_file, output_file, xres, yres, raster_device, log):
log.error('Ghostscript rendering failed')
def generate_pdfa(pdf_pages, output_file):
def generate_pdfa(pdf_pages, output_file, threads=1):
with NamedTemporaryFile(delete=True) as gs_pdf:
args_gs = [
"gs",
"-dQUIET",
"-dBATCH",
"-dNOPAUSE",
'-dNumRenderingThreads=' + str(threads),
"-sDEVICE=pdfwrite",
"-sColorConversionStrategy=/RGB",
"-sProcessColorModel=DeviceRGB",