Closed xmoham closed 1 month ago
Please provide more details, like OS: OS Version: Frappe version: wkhtmltopdf version:
os:ubuntu os version: 20.04 frappe 13.58.21 wkhtmltopdf 0.12.5
First remove wkhtmltopdf
sudo apt remove wkhtmltopdf
Then reinstall using below command
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb && \
sudo dpkg -i wkhtmltox_0.12.6-1.focal_amd64.deb && \
sudo cp /usr/local/bin/wkhtmlto* /usr/bin/ && \
sudo chmod a+x /usr/bin/wk*
sudo rm wk* && \
sudo apt --fix-broken install -y
thanks this point of print to pdf is closed after reinstall wkhtmltopdf but i faced now another point that when select my header-footor it does't generate the pdf
here is the error :
Traceback (most recent call last):
File "apps/frappe/frappe/handler.py", line 65, in execute_cmd
method = get_attr(cmd)
File "apps/frappe/frappe/handler.py", line 226, in get_attr
method = frappe.get_attr(cmd)
File "apps/frappe/frappe/init.py", line 1464, in get_attr
return getattr(get_module(modulename), methodname)
File "apps/frappe/frappe/init.py", line 1206, in get_module
return importlib.import_module(modulename)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "apps/frappe/frappe/app.py", line 66, in application response = frappe.api.handle() File "apps/frappe/frappe/api.py", line 55, in handle return frappe.handler.handle() File "apps/frappe/frappe/handler.py", line 38, in handle data = execute_cmd(cmd) File "apps/frappe/frappe/handler.py", line 67, in executecmd frappe.throw(("Failed to get method for command {0} with {1}").format(cmd, e)) File "apps/frappe/frappe/init.py", line 505, in throw msgprint( File "apps/frappe/frappe/init.py", line 480, in msgprint _raise_exception() File "apps/frappe/frappe/init.py", line 435, in _raise_exception raise raise_exception(msg) frappe.exceptions.ValidationError: Failed to get method for command frappe.utils.print_format.download_pdf with No module named 'pypdf'
Try to run
sudo bench setup requirements
here what i get :
yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... error node-sass@7.0.3: The engine "node" is incompatible with this module. Expected version ">=12". Got "10.19.0" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. ERROR: yarn install --check-files subprocess.CalledProcessError: Command 'yarn install --check-files' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/bench", line 8, in
INFO: A newer version of bench is available: 5.22.6 → 5.22.9
Run the previous command without sudo. If you are still getting an error then create a new issue on GitHub.
On Tue, 24 Sept, 2024, 8:55 pm xmoham, @.***> wrote:
here what i get :
yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... error @.***: The engine "node" is incompatible with this module. Expected version ">=12". Got "10.19.0" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. ERROR: yarn install --check-files subprocess.CalledProcessError: Command 'yarn install --check-files' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/bin/bench", line 8, in sys.exit(cli()) File "/usr/local/lib/python3.8/dist-packages/bench/cli.py", line 132, in cli bench_command() File "/usr/local/lib/python3.8/dist-packages/bench/commands/setup.py", line 230, in setup_requirements bench.setup.requirements(apps=apps) File "/usr/local/lib/python3.8/dist-packages/bench/utils/render.py", line 105, in wrapper_fn return fn(*args, *kwargs) File "/usr/local/lib/python3.8/dist-packages/bench/bench.py", line 464, in requirements app = App(path_to_app, bench=self.bench, to_clone=False).install( File "/usr/local/lib/python3.8/dist-packages/bench/utils/render.py", line 126, in wrapper_fn return fn(args, *kwargs) File "/usr/local/lib/python3.8/dist-packages/bench/app.py", line 254, in install install_app( File "/usr/local/lib/python3.8/dist-packages/bench/app.py", line 920, in install_app bench.run(yarn_install, cwd=app_path) File "/usr/local/lib/python3.8/dist-packages/bench/bench.py", line 48, in run return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise) File "/usr/local/lib/python3.8/dist-packages/bench/utils/init*.py", line 178, in exec_cmd raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd) bench.exceptions.CommandFailedError: yarn install --check-files
INFO: A newer version of bench is available: 5.22.6 → 5.22.9
— Reply to this email directly, view it on GitHub https://github.com/frappe/frappe/issues/27884#issuecomment-2371628886, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDFNDV6HFWQ5W6TVHU6J4TZYGAADAVCNFSM6AAAAABOYDONZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZRGYZDQOBYGY . You are receiving this because you commented.Message ID: @.***>
Do upgrade to later versions of Frappe, should work fine, v13 is not currently supported.
hello ! download to pdf or print to pdf function was working normally until i upgraded wkhtmltopdf i faced some error so i tried to get back to the last version after this i face another error that i can't review any doctype into pdf fromat so this is what happen when i click pdf Traceback (most recent call last): File "apps/frappe/frappe/app.py", line 66, in application response = frappe.api.handle() File "apps/frappe/frappe/api.py", line 55, in handle return frappe.handler.handle() File "apps/frappe/frappe/handler.py", line 38, in handle data = execute_cmd(cmd) File "apps/frappe/frappe/handler.py", line 76, in execute_cmd return frappe.call(method, *frappe.form_dict) File "apps/frappe/frappe/init.py", line 1474, in call return fn(args, **newargs) File "apps/frappe/frappe/utils/print_format.py", line 134, in download_pdf File "apps/frappe/frappe/utils/pdf.py", line 45, in get_pdf
create in-memory binary streams from filedata and create a PdfFileReader object
File "env/lib/python3.8/site-packages/PyPDF2/pdf.py", line 1084, in init self.read(stream) File "env/lib/python3.8/site-packages/PyPDF2/pdf.py", line 1803, in read idnum, generation = self.readObjectHeader(stream) File "env/lib/python3.8/site-packages/PyPDF2/pdf.py", line 1667, in readObjectHeader return int(idnum), int(generation) ValueError: invalid literal for int() with base 10: b'0049>'