wkhtmltopdf

How to receive the height of DOM element when printing with wkhtmltopdf library?

橙三吉。 提交于 2021-01-06 04:48:06
问题 When I try to get offsetHeight or of any DOM element with Javascript when printing with wkhtmltopdf library, the height is never determined and is always equal to 0. When I execute the same JS code in any browser it works correctly and results in a specific height of element. I googled for a long time and I found out that it might be related with wkhtmltopdf in which the width and height of document and window are equal to 0. I tried to override the size of the body tag with CSS and override

wkhtmltopdf (pdfkit) Could not connect to any X display

…衆ロ難τιáo~ 提交于 2021-01-01 04:58:30
问题 I am trying to use wkhtmltopdf with Django ,nginx,uwsgi it works perfectly on development env running using manage.py runserver but when serving with nginx ans uwsgi i get this error: wkhtmltopdf exited with non-zero code 1. error: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-isp' qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display. Exception Location: /home/isp/Env/isp/lib/python3.6/site-package/pdfkit/pdfkit.py in to_pdf,

wkhtmltopdf (pdfkit) Could not connect to any X display

ⅰ亾dé卋堺 提交于 2021-01-01 04:57:46
问题 I am trying to use wkhtmltopdf with Django ,nginx,uwsgi it works perfectly on development env running using manage.py runserver but when serving with nginx ans uwsgi i get this error: wkhtmltopdf exited with non-zero code 1. error: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-isp' qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display. Exception Location: /home/isp/Env/isp/lib/python3.6/site-package/pdfkit/pdfkit.py in to_pdf,

Page break for long table

…衆ロ難τιáo~ 提交于 2020-12-08 06:42:30
问题 I have a long table which shows rows on several pages. When a page ends, the row is printed half on one page and half on the next page. How can I make sure that the rows is printed completely on the new page? 回答1: CSS property: page-break-inside: avoid; on HTML tr element does it. Tested with: wkhtmltopdf 0.12.3 provided for Linux (Ubuntu Trusty) 32-bit / 64-bit built on Ubuntu 14.04.2 as provided at: http://wkhtmltopdf.org/downloads.html#stable A quick and dirty test may look like: <tr style

Page break for long table

萝らか妹 提交于 2020-12-08 06:42:10
问题 I have a long table which shows rows on several pages. When a page ends, the row is printed half on one page and half on the next page. How can I make sure that the rows is printed completely on the new page? 回答1: CSS property: page-break-inside: avoid; on HTML tr element does it. Tested with: wkhtmltopdf 0.12.3 provided for Linux (Ubuntu Trusty) 32-bit / 64-bit built on Ubuntu 14.04.2 as provided at: http://wkhtmltopdf.org/downloads.html#stable A quick and dirty test may look like: <tr style

完美快速安装ODOO14在腾讯云服务器UBUNTU 20.04上

核能气质少年 提交于 2020-10-19 18:15:05
最新版ODOO14运行在最新版UBUNTU20.04服务器上, 速度很快, 下面是详细安装步骤: 一, 先配置Ubuntu系统: 1, 租用的云服务器上是全新系统。 需先设root密码。 远程登录进入系统, 输入: sudo passwd 输入新密码,重复输入密码,最后提示passwd:password updated sucessfully 此时已完成root密码的设置 ====================== 2, 国内访问AWS,GITHUB下载文件很慢, 需要修改HOST文件: 先切换用户到root su root 打开HOST文件 sudo vi /etc/hosts 然后自己使用方向上下键调整到需要修改的位置,在光标处按“i”或者“insert”键,即可开始修改操作添加: # GitHub Start# 52.74.223.119 github.com 192.30.253.119 gist.github.com 54.169.195.247 api.github.com 185.199.111.153 assets-cdn.github.com 151.101.76.133 raw.githubusercontent.com 151.101.108.133 user-images.githubusercontent.com 151.101.76.133 gist