wkhtmltoimage

How to print bitmap without zoom from MVC controller in Debian

前提是你 提交于 2020-01-14 06:52:09
问题 Document is printed from MVC controller to Debian Squeeze Linux server printer using code below in Mono. Page in printer is A4. Printed text in paper is too big and unsharp. Rightmost part of text is not visible since it does not fit to page. If printed from Windows from .NET to HP Laserjet, output is correct. So it looks like Mono or Samsung ML-331x Series printer zooms bitmap for unknown reason which causes too big and unsharp output. How to fix this so that bitmap is printed like in

How to print bitmap without zoom from MVC controller in Debian

杀马特。学长 韩版系。学妹 提交于 2020-01-14 06:52:00
问题 Document is printed from MVC controller to Debian Squeeze Linux server printer using code below in Mono. Page in printer is A4. Printed text in paper is too big and unsharp. Rightmost part of text is not visible since it does not fit to page. If printed from Windows from .NET to HP Laserjet, output is correct. So it looks like Mono or Samsung ML-331x Series printer zooms bitmap for unknown reason which causes too big and unsharp output. How to fix this so that bitmap is printed like in

How to run custom Javascript on Wkhtmltopdf/wkhtmltoimage?

十年热恋 提交于 2019-12-21 04:49:12
问题 I want to run a javascript on a website, but when I do it, nothing changes, I get the pdf as if I run no result of the javascript on it, this is an example of what I do: xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltoimage --run-script "javascript:(\$(function(){ \$("div").hide() ;}))" google.com google.png I have also scripts without jquery like: xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf --run-script "javascript:(function(){ document.write(

How to deal with ContentNotFoundError when using wkhtmltopdf?

心已入冬 提交于 2019-12-06 21:55:20
问题 Can someone tell me how to resolve following issues? wkhtmltopdf don't have option to pass proxy info (-p or --proxy) unlike in previous versions and its not using system $http_proxy and $https_proxy env variable too. wkhtmltopdf not working with HTTPS/SSL even though i set LD_LIBRARY_PATH for libssl.so and libcrypto.so [deploy@localhost ~]$ wkhtmltopdf https://www.google.co.in google.pdf loaded the Generic plugin Loading page (1/2) Error: Failed loading page https://www.google.co.in

How to deal with ContentNotFoundError when using wkhtmltopdf?

梦想与她 提交于 2019-12-05 01:41:42
Can someone tell me how to resolve following issues? wkhtmltopdf don't have option to pass proxy info (-p or --proxy) unlike in previous versions and its not using system $http_proxy and $https_proxy env variable too. wkhtmltopdf not working with HTTPS/SSL even though i set LD_LIBRARY_PATH for libssl.so and libcrypto.so [deploy@localhost ~]$ wkhtmltopdf https://www.google.co.in google.pdf loaded the Generic plugin Loading page (1/2) Error: Failed loading page https://www.google.co.in (sometimes it will work just to ignore this error with --load-error-handling ignore) Exit with code 1 due to

wkhtmltoimage开源工具的基本应用

*爱你&永不变心* 提交于 2019-12-04 01:20:19
读大学时,微博兴起,由于140个字有限,于是有人开发了长微博,当时但想着开发一个长微博的应用。试用了几款长微博工具,大部分都是只能输入文字和插件一两张图片,这种长微博工具实现不难。但如果想在长微博中支持富文本,例如插件表格之类的( http://www.changweibo.com/ ),那就没那么简单了。 实现支持富文本的长微博,原理如下: 1.客户端提供一个富文本输入框(CKeditor,Ueditor之类的) 2.把在输入框中输入的html代码发送到服务端,服务端解析html代码,生成图片返回客户端 重点要解决的问题是后台如何解析html代码并生成图片。一个最初的想法是用htmlparse解析html代码,对于简单的html代码这个方法可行,但如果html代码的结构混乱就麻烦了。另一个想法是在后台用一个浏览器渲染这段html代码,然后利用浏览器的功能把图片导出。基于这个想法,用了javafx2.0里面的Webview,Webview实质上就是一个浏览器,它用的是WebKit内核,用它可以渲染html和执行javascript。用Webview生成图片的代码如下: import java.io.File; import java.io.IOException; import javafx.application.Application; import javafx.beans

How to run custom Javascript on Wkhtmltopdf/wkhtmltoimage?

↘锁芯ラ 提交于 2019-12-03 14:15:35
I want to run a javascript on a website, but when I do it, nothing changes, I get the pdf as if I run no result of the javascript on it, this is an example of what I do: xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltoimage --run-script "javascript:(\$(function(){ \$("div").hide() ;}))" google.com google.png I have also scripts without jquery like: xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf --run-script "javascript:(function(){ document.write("AHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"); ;})" google.com p2.pdf But as I said, no effect on the pdf or the png (because I have tried

wkhtmltoimage CSS3 gradient rendering in Snapshots

梦想的初衷 提交于 2019-11-30 22:36:36
I am using wkhtmltoimage to render a snapshot for my website which contains a background gradient but it doesn't show up in the generated snapshot. I tried using on Ubuntu and Windows but am not able to find the error. I even tried using the simplest command without any parameters. wkhtmltoimage.exe <website_link> <image_name> My original page looks same in all major browsers Here is the screen print And here is the one generated by wkhtmltoimage I am not sure what exactly is the problem. I tried looking at their existing issues as well but couldn't find anything. Interlated Did you check your

wkhtmltoimage CSS3 gradient rendering in Snapshots

瘦欲@ 提交于 2019-11-30 05:31:22
问题 I am using wkhtmltoimage to render a snapshot for my website which contains a background gradient but it doesn't show up in the generated snapshot. I tried using on Ubuntu and Windows but am not able to find the error. I even tried using the simplest command without any parameters. wkhtmltoimage.exe <website_link> <image_name> My original page looks same in all major browsers Here is the screen print And here is the one generated by wkhtmltoimage I am not sure what exactly is the problem. I