wkhtmltopdf

Why does PDFKit/wkhtmltopdf hang but renders PDF as expected when Rails app is killed?

六眼飞鱼酱① 提交于 2019-12-17 15:27:58
问题 Background After reading around it seemed to me that Prawn is out and wkhtmltopdf is in. It also seems like the PDFKit and wicked_pdf gems for Rails are the new cool. So I found a screencast by Ryan on how to use PDFKit. I installed everything, tested wkhtmltopdf on the CLI with no problems, fiddled around with Rails settingsto run multiple processes so the asset pipeline works, and all seemed good, except I'm still stuck at the very end of the process (actually getting the PDF response from

pdf page margins with snappy and symfony2

让人想犯罪 __ 提交于 2019-12-14 01:12:35
问题 I am trying to develop a web page that will generate a pdf. I was wondering if there is a way to customize the page margins of the pdf using KnpSnappyBundle for symfony2. I did a cursory search for this and couldn't find any information. Any information is greatly appreciated. 回答1: You can pass options as the second argument of each generating method : $snappy = $this->get('knp_snappy.pdf'); $options = [ 'margin-top' => 50, 'margin-right' => 50, 'margin-bottom' => 50, 'margin-left' => 50, ];

Can wicked_pdf or wkhtmltopdf generate a protected pdf?

自闭症网瘾萝莉.ら 提交于 2019-12-13 20:49:21
问题 So, I have wicked_pdf up and running, now I am wondering if I can password protect the pdf being generated so it is not easily editable. Is this possible? Perhaps a better question is can wkhtmltopdf generate a protected pdf? If not, is there a great rails pdf gem or similar that can take an existing pdf and protect it? Thanks! 回答1: Let me check the usage for wkhtmltopdf (v0.10.0 rc2). Nope, at least not according to it's usage dump. And wicked_pdf just wraps wkhtmltopdf, so you're out of

exec() problem with long command in PHP

∥☆過路亽.° 提交于 2019-12-13 19:39:03
问题 I'm using wkhtmltopdf on my server to transfer HTML document to PDF. It works very well when I'm using short URL like : exec("/opt/wkhtmltopdf/bin/wkhtmltopdf --page-size 'Letter' --orientation 'Portrait' 'http://myurl.com/myPHPfile.php?id=12' '/tmp/myfile.pdf'") The problem occurs when I'm using long command, like : exec("/opt/wkhtmltopdf/bin/wkhtmltopdf --title 'The name of my file' --page-size 'Letter' --orientation 'Portrait' 'http://myurl.com/myPHPfile.php?phpsid

WKHTMLTOPDF and Coldfusion

六眼飞鱼酱① 提交于 2019-12-13 16:17:27
问题 Is it possible to use coldfusion URL variables with WKHTMLTOPDF plugin? I am trying it as follows but only receiving a blank PDF. I'm assuming it's failing because of the URL variables. <cfexecute name="C:\Program Files (x86)\wkhtmltopdf\bin\wkhtmltopdf.exe" arguments="c:\inetpub\wwwroot\serviceticket\reports\dropoff_receipt.cfm?ticket_id=#url.ticketID#&signature_id=#check_signature.id# C:\google.pdf" timeout="10" /> Update 1: Changed the source to a URL, same error though. <cfexecute name="C

WKHTMLTOPDF Not Rendering Base64 Image

夙愿已清 提交于 2019-12-13 13:13:46
问题 I have the following simple HTML page: <html> <head> <title></title> </head> <body> <div> <img id="image" src="data:image/gif;base64,R0lGODlhFwAPAKEAAP///wAAAMzMzLi3tywAAAAAFwAPAAACQIyPqQjtD98RIVpJ66g3hgEYDdVhjThyXSA4aLq2rgp78hxlyY0/ICAIBhu/HrEEKIZUyk4R1Sz9RFEkaIHNFgAAOw==" /> </div> </body> </html> I am trying to get the PDF to render the Base64 encoded GIF using the following: public static byte[] HTMLToPDF(string htmlText) { Process p; ProcessStartInfo psi = new ProcessStartInfo(); psi

add border to pages printed using wkhtmltopdf

左心房为你撑大大i 提交于 2019-12-13 06:49:45
问题 similar to this question: Add borders to each printed page with CSS? how can i print a square border on each page of a multi-page pdf that is rendered using wkhtmltopdf? i create a html page as a variable, and use snappy: https://github.com/KnpLabs/snappy to render it to a pdf. $html = $this->load->view('print/report_baseline_print',$data,TRUE); $snappy = new \Knp\Snappy\Pdf('path to wkhtmltopdf -O landscape'); $tmp = random_temp_file('.pdf'); $snappy->generateFromHtml($html,$tmp); $filename

pdfkit - returns a blank pdf with only requested URL

喜你入骨 提交于 2019-12-13 04:33:32
问题 I'm trying to render a webpage with pdfkit My code: import pdfkit config = pdfkit.configuration(wkhtmltopdf='/Library/Python/2.7/site-packages/wkhtmltopdf/wkhtmltopdf') pdfkit.from_string('http://stackoverflow.com', 'so.pdf', configuration=config) But this just returns a blank pdf with the requested URL at the top. When in terminal I run wkhtmltopdf directly... wkhtmltopdf http://stackoverflow.com so2.pdf It renders fine What am I doing wrong? 回答1: This works fine with me: >>> import pdfkit >

CMS and store hi-resolution images in generated pdf

痞子三分冷 提交于 2019-12-13 04:18:39
问题 I'm looking for good CMS for publishing software manuals. Requirements: publish manual pages as web pages with thumbnails and shows full resolution after click on image, exporting manual pages to a pdf file with full resolution images instead to thumbnails . I found IMHO best wiki system named Tiki Wiki (https://info.tiki.org/) but when I export to pdf then I gets low resolution thumbnail. 回答1: I solve this problem by very simple Tiki Wiki code modification: Modify lib/wiki-plugins/wikiplugin

How to use and improve wakhtmltopdf performance?

旧时模样 提交于 2019-12-13 03:03:23
问题 I have my aspx pages , and some logic is written in code behind to bind the data of aspx pages.Now using wkhtmltopdf i am sending these files to convert into pdf files.Its work very well when the data is smaller in size however when the data comes in larger side for that page the wkhtmltopdf stops working and doesnt create any pdf file. Can you suggest any way to overcome this problem. What i tried was limiting the data.. for example i have repeater control on my page if that controls binds