Ejemplo n.º 1
0
def generate_pdfa(pdf_pages, pdfmark, output_file, compression, pdf_version, pdfa_part):
    with patch('ocrmypdf._exec.ghostscript.run', new=raise_gs_fail):
        ghostscript.generate_pdfa(
            pdf_pages=pdf_pages,
            pdfmark=pdfmark,
            output_file=output_file,
            compression=compression,
            pdf_version=pdf_version,
            pdfa_part=pdfa_part,
        )
        return output_file
Ejemplo n.º 2
0
def generate_pdfa(pdf_pages, pdfmark, output_file, compression, pdf_version,
                  pdfa_part):
    with patch('ocrmypdf._exec.ghostscript.run', new=run_append_stderr):
        ghostscript.generate_pdfa(
            pdf_pages=pdf_pages,
            pdfmark=pdfmark,
            output_file=output_file,
            compression=compression,
            pdf_version=pdf_version,
            pdfa_part=pdfa_part,
            progressbar_class=None,
        )
        return output_file
Ejemplo n.º 3
0
def generate_pdfa(pdf_pages, pdfmark, output_file, compression, pdf_version,
                  pdfa_part):
    with patch('ocrmypdf._exec.ghostscript.run_polling_stderr') as mock:
        mock.side_effect = run_append_stderr
        ghostscript.generate_pdfa(
            pdf_pages=pdf_pages,
            pdfmark=pdfmark,
            output_file=output_file,
            compression=compression,
            pdf_version=pdf_version,
            pdfa_part=pdfa_part,
            progressbar_class=None,
        )
        mock.assert_called_once()
    return output_file