wkhtmltopdf

wkhtmltopdf error in apache log

余生颓废 提交于 2019-12-19 04:59:26
问题 exec("wkhtmltopdf test.html output.pdf"); In the php command line it works but if I try to call it from apache it doesn't create the pdf file and the log show this: $ tail -f /var/log/apache2/error.log wkhtmltopdf: cannot connect to X server 回答1: You can use Xvfb to emulate a x-environment <?php exec("xvfb-run -a wkhtmltopdf test.html output.pdf"); OR <?php exec("startx -- `which Xvfb` :1 -screen 0 800x600x24 && DISPLAY=:1 && wkhtmltopdf test.html output.pdf"); I made this script for myself

wkhtmltopdf.exe System.Security.SecurityException on cloud web server. How can i override server security policy

戏子无情 提交于 2019-12-19 04:00:32
问题 I want to have a feature for my website which can print the page contents as PDF. I tried a few option for this but the best match was wkhtmltopdf as it also handle multilingual characters. I got it working on my local server but when I uploaded it on a cloud web server for hosting now it is giving me the following error Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please

wkhtmltopdf outputstream & download - diaglog

自作多情 提交于 2019-12-19 03:17:07
问题 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

wkhtmltopdf RuntimeError (Location of wkhtmltopdf unknown)

爷,独闯天下 提交于 2019-12-18 16:33:07
问题 I am using Ubuntu 11.04 to develop an app in Ruby on Rails. In the app I need to generate pdf documents. So I am using the wicked_pdf and wkhtmltopdf-binary gems. In the development environment in my system everything is working fine. But once I deployed the app in production on CentOS 5.6 using Phusion Passenger, when I try to generate pdfs on the fly its giving me the following error: RuntimeError (Location of wkhtmltopdf unknown) I am using Ruby1.9.2.p136 Rails 3.1.1 Any help will be much

wkhtmltopdf RuntimeError (Location of wkhtmltopdf unknown)

血红的双手。 提交于 2019-12-18 16:32:14
问题 I am using Ubuntu 11.04 to develop an app in Ruby on Rails. In the app I need to generate pdf documents. So I am using the wicked_pdf and wkhtmltopdf-binary gems. In the development environment in my system everything is working fine. But once I deployed the app in production on CentOS 5.6 using Phusion Passenger, when I try to generate pdfs on the fly its giving me the following error: RuntimeError (Location of wkhtmltopdf unknown) I am using Ruby1.9.2.p136 Rails 3.1.1 Any help will be much

wkhtmltopdf - convert html code to pdf directly in C#

那年仲夏 提交于 2019-12-18 16:31:33
问题 I know this tool looks up on a url and converts the repsponse to pdf. How do I convert a <html> content.. </html> into a pdf? I was looking at the help files on wkhtml2pdf and looks like it provides an option of stdin but I can't really figure out how to emulate stdin. Also if you know a tool which does a better job, please suggest me some. Thanks a lot! 回答1: wkhtmltopdf is a free tool, but it's not written in .NET and it could be kind of hard to integrate into your asp.net application. you

Azure websites and wkhtmltopdf

主宰稳场 提交于 2019-12-18 12:18:33
问题 So after beginning my azure websites-adventure, I have been encountering disappointment after disappointment to the point of 'almost' regretting taking the azure route..the latest: my app uses wkhtmltopdf(Rotativa) for all its PDF generation. And as I discovered now during my staging testing...that doesnt work. According to most info on the web, azure websites cannot run .exe's. However, most info I've seen is by now 2 years old and I know Azure development is going fast. Is there by now a

Creating PDFs with django (wkhtmltopdf)

孤者浪人 提交于 2019-12-17 23:39:45
问题 Could someone please provide me with a comprehensive example of how to get a view in django to return a PDF using wkhtmltopdf . There are limited number of examples that come with django-wkhtmltopdf and they presume a level of knowledge I just don't have. I have looked through the source code but I can't make heads or tails of how to use it (for example whats the difference between PDFTemplateView and PDFTemplateResponse ?!?) I would be very grateful for any help. BTW(I'm using templates for

Generate PDF Behind Authentication Wall

北慕城南 提交于 2019-12-17 18:54:17
问题 I'm trying to generate a PDF using WKHTMLTOPDF that requires me to first log in. There's some on this on the internet already but I can't seem to get mine working. I'm in Terminal - nothing fancy. I've tried (among a whole lot of other stuff): /usr/bin/wkhtmltopdf --post username=myusername --post password=mypassword "URL to Generate" test.pdf /usr/bin/wkhtmltopdf --username myusername --password mypassword "URL to Generate" test.pdf /usr/bin/wkhtmltopdf --cookie-jar my.jar --post username

how to pass html as a string using wkhtmltopdf?

故事扮演 提交于 2019-12-17 17:27:33
问题 how to pass html as a string instead of url in wkhtmltopdf using asp.net, c#? 回答1: STDIn and STDOut have been redirected in this example, so you shouldn't need files at all. public static class Printer { public const string HtmlToPdfExePath = "wkhtmltopdf.exe"; public static bool GeneratePdf(string commandLocation, StreamReader html, Stream pdf, Size pageSize) { Process p; StreamWriter stdin; ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = Path.Combine(commandLocation,