def create_pdf(in_html_file=None, out_pdf_file=None, quality=None):
    pathtowk = 'C:/wkhtmltopdf/bin/wkhtmltopdf.exe {0} {1} {2}'
if quality == 1:
    args_str = (
        """--encoding utf-8 --disable-smart-shrinking --no-pdf-compression --page-size A4 --zoom 1 -q -T 15.24mm -L 25.4mm -B 20.32mm  -R 33.02mm"""
        )
elif quality == 2:
    args_str = (
        """--encoding utf-8 --disable-smart-shrinking --page-size A4 --zoom 1 -q -T 15.24mm -L 25.4mm -B 20.32mm  -R 33.02mm"""
        )
How to generate pdf documents page-by-page in background tasks on App Engine