wkhtmltopdf

wkhtmltopdf and chinese characters

给你一囗甜甜゛ 提交于 2019-12-01 04:00:08
问题 Trying to generate a PDF with wkhtmltopdf but it gives me a lot of trouble displaying all the characters. Some of characters work - e.g. when printing "Invoice No (付款编号)" Chinese character no 1, 2 and 4 are correctly printed but character no 3 just displays an empty space in the PDF. "Customer no (客户编号)" Chinese character no 1 and 4 are correctly displayed but character no 2 and 3 aren't displayed in the PDF. "Total (总额)" none of the Chinese characters are displayed in the generated PDF. I'm

wkhtmltopdf Log in to asp.net web app

僤鯓⒐⒋嵵緔 提交于 2019-12-01 03:42:36
Having a problem with wkhtmltopdf. I'm using it to take pdf snapshots of pages on a website that has a username/password page. When the .exe runs, I end up with a snapshot of the login page (running the exe from my own ASP.NET app). Does anybody know how I would get wkhtmltopdf to log into the site so that it can access the page it needs to take a snapshot of? wkhtmltopdf is installed in the program files directory on the server and is being called via: public void HtmlToPdf(string website, string destinationFile) { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName =

Launching wkhtmltopdf from Runtime.getRuntime().exec(): never terminates?

爱⌒轻易说出口 提交于 2019-12-01 03:38:59
I'm launching wkhtmltopdf from within my Java app (part of a Tomcat server, running in debug mode within Eclipse Helios on Win7 64-bit): I'd like to wait for it to complete, then Do More Stuff. String cmd[] = {"wkhtmltopdf", htmlPathIn, pdfPathOut}; Process proc = Runtime.getRuntime().exec( cmd, null ); proc.waitFor(); But waitFor() never returns. I can still see the process in the Windows Task Manager (with the command line I passed to exec(): looks fine). AND IT WORKS. wkhtmltopdf produces the PDF I'd expect, right where I'd expect it. I can open it, rename it, whatever, even while the

wkhtmltopdf - encoding issue

烈酒焚心 提交于 2019-12-01 02:26:06
I'm using wkhtmltopdf to export html pages to pdf, but it seems it has a problem with Czech characters... I load whole html into variable, then I change encoding and run wkhtmltopdf like this: $html = ob_get_clean(); $html = iconv("UTF-8","Windows-1250", $html); file_put_contents('../export.php', $html); $commandString = WKHTML_LIB.'http://www.estiroad.com/export.php sestava.pdf'; exec($commandString); The .html file has the right encoding, but even when I set --encoding windows-1250 parameter to command string, its just not working... Thanks for any ideas... EDIT: I solved the issue! The

wkhtmltopdf Log in to asp.net web app

岁酱吖の 提交于 2019-12-01 00:50:11
问题 Having a problem with wkhtmltopdf. I'm using it to take pdf snapshots of pages on a website that has a username/password page. When the .exe runs, I end up with a snapshot of the login page (running the exe from my own ASP.NET app). Does anybody know how I would get wkhtmltopdf to log into the site so that it can access the page it needs to take a snapshot of? wkhtmltopdf is installed in the program files directory on the server and is being called via: public void HtmlToPdf(string website,

wicked_pdf: Is it possible to have the header only show on the first page & the footer only on the last?

喜夏-厌秋 提交于 2019-12-01 00:29:22
Right now I have :header => {:html => {:template => "layouts/pdf_header.html.erb"}} setting things up. Is there something I can pass in that will only show the header on the first page of the document? Can I do this for the footer as well? It's almost more important here, because I can't really think of any other way to get a footer to dynamically stick to the bottom of the page when it's going to be different lengths and different numbers of pages every time. Some quick javascript can take care of this. Follow the boilerplate laid out under 'Footers And Headers' on wkhtmltopdf These are your

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

wkhtmltopdf - encoding issue

本小妞迷上赌 提交于 2019-11-30 22:01:06
问题 I'm using wkhtmltopdf to export html pages to pdf, but it seems it has a problem with Czech characters... I load whole html into variable, then I change encoding and run wkhtmltopdf like this: $html = ob_get_clean(); $html = iconv("UTF-8","Windows-1250", $html); file_put_contents('../export.php', $html); $commandString = WKHTML_LIB.'http://www.estiroad.com/export.php sestava.pdf'; exec($commandString); The .html file has the right encoding, but even when I set --encoding windows-1250

wkhtmltopdf outputstream & download - diaglog

南楼画角 提交于 2019-11-30 20:49:23
is it possible to get a pdf stream created by wkhtmltopdf from any html file and popup a download dialog in IE/Firefox/Chrome etc.? At the moment I get my outputstream by this code: public class Printer { public static MemoryStream GeneratePdf(StreamReader Html, MemoryStream pdf, Size pageSize) { Process p; StreamWriter stdin; ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = @"C:\PROGRA~1\WKHTML~1\wkhtmltopdf.exe"; // run the conversion utility psi.UseShellExecute = false; psi.CreateNoWindow = true; psi.RedirectStandardInput = true; psi.RedirectStandardOutput = true; psi

Create pdf with wkhtmltopdf and rendering javascript

浪子不回头ぞ 提交于 2019-11-30 19:36:01
I'm attempting to create a PDF of a javascript chart that I have in a model window (my chart is a combination of javascript and css in an .aspx view). The only thing in the rendered PDF file is the static content from the window, the actual javascript chart is not there. My call to create the PDF is as follows: public byte[] WKHtmlToPdf(string url) { var fileName = " - "; var wkhtmlDir = "C:\\Temp\\wkhtml"; var wkhtml = "C:\\Temp\\wkhtml\\wkhtmltopdf.exe"; var p = new Process(); p.StartInfo.CreateNoWindow = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError =