![]() I also see that you have passed a variable called pages. Or use the correct parameter names: result = convert(input_path=input_file, output_path=output_file) To fix this, either get rid of the names altogether: result = convert(input_file, output_file) You are passing parameters into the convert method like this: result = convert(docx_file=input_file, pdf_file=output_file, pages=pages)īut the docx2pdf convert method is defined like this: def convert(input_path, output_path=None, keep_active=False):Īs you can see, there is no parameter called docx_file, so you get the error that this parameter was unexpected. There are two templates called index.html and docx.html in Templates directory, this is how it looks in Pycharm:ĭoes anyone have an idea where i made an mistake? Thanks Return send_file(lis, as_attachment=True) Return render_template("docx.html", variable=lis) Print("\n".join("".format(i, j) for i, j in ems()))įile.save(os.path.join(app.config, file.filename)) "File": input_file, "Pages": str(pages), "Output File": output_file Result = convert(docx_file=input_file, pdf_file=output_file, pages=pages) Im an begginer in programming and i dont know how to fix it, below i paste python code: from flask import Flaskįrom flask import request, render_template, redirect, url_for, send_fileĪpp.config = methods=)ĭef docx2pdf(input_file: str, output_file: str, pages: Tuple = None): I'm making a doc to pdf converter program, and i have occured an error as below:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |