wkhtmltopdf

Rails 3 + PDFKit Problem: Permission denied (Errno::EACCES)

和自甴很熟 提交于 2019-12-01 12:07:19
I would like to use PDFKit in my Rails 3 application on Windows . I installed wkhtmltopdf and the pdfkit gem. Here is the code that I use to create the PDF: class JobsController < ApplicationController def create_pdf_invoice kit = PDFKit.new("<h1>Hello</h1><p>This is PDF!!!</p>", :page_size => "A4") file = kit.to_file("my_first_pdf") # Error issued here!! ... end end I got the following error: Errno::EACCES in JobsController#create_pdf_invoice Permission denied - "c:\Program Files\wkhtmltopdf" "--page-size" "A4" "--margin-top" "0.75in" "--margin-right" "0.75in" "--margin-bottom" "0.75in" "-

wicked_pdf font size too large in production

守給你的承諾、 提交于 2019-12-01 11:17:15
I am experiencing an issue where the font sizing for rendered PDFs is larger in production . Everything looks great on the PDF generated in development. Here is the rendering from development : Here is the rendering from production : This is making it very difficult for me to format my document for the production server in development. Can you please take a look? HTML Version: http://www.hearingtracker.com/tickets/170 PDF Download: http://www.hearingtracker.com/tickets/170.pdf Here is my controller action: def show @ticket = Ticket.find(params[:id]) respond_to do |format| format.html { render

Rails 3 + PDFKit Problem: Permission denied (Errno::EACCES)

蹲街弑〆低调 提交于 2019-12-01 11:10:24
问题 I would like to use PDFKit in my Rails 3 application on Windows . I installed wkhtmltopdf and the pdfkit gem. Here is the code that I use to create the PDF: class JobsController < ApplicationController def create_pdf_invoice kit = PDFKit.new("<h1>Hello</h1><p>This is PDF!!!</p>", :page_size => "A4") file = kit.to_file("my_first_pdf") # Error issued here!! ... end end I got the following error: Errno::EACCES in JobsController#create_pdf_invoice Permission denied - "c:\Program Files\wkhtmltopdf

Using knp snappy bundle to generate pdf - symfony2

烈酒焚心 提交于 2019-12-01 11:02:34
I'm new to symfony2 and very to use external libraries. I want to use the KNP Snappy Bundle , my first third party bundle. I did exactly that is told in the git link. { "require": { "knplabs/knp-snappy-bundle": "dev-master" } } // app/AppKernel.php public function registerBundles() { $bundles = array( //... new Knp\Bundle\SnappyBundle\KnpSnappyBundle(), app/config/config.yml knp_snappy: pdf: enabled: true binary: /usr/local/bin/wkhtmltopdf options: [] image: enabled: true binary: /usr/local/bin/wkhtmltoimage options: [] Then I added following line in ACME welcome controller to test $this->get(

Using knp snappy bundle to generate pdf - symfony2

感情迁移 提交于 2019-12-01 09:42:09
问题 I'm new to symfony2 and very to use external libraries. I want to use the KNP Snappy Bundle, my first third party bundle. I did exactly that is told in the git link. { "require": { "knplabs/knp-snappy-bundle": "dev-master" } } // app/AppKernel.php public function registerBundles() { $bundles = array( //... new Knp\Bundle\SnappyBundle\KnpSnappyBundle(), app/config/config.yml knp_snappy: pdf: enabled: true binary: /usr/local/bin/wkhtmltopdf options: [] image: enabled: true binary: /usr/local

custom report through python odoo 9

给你一囗甜甜゛ 提交于 2019-12-01 09:23:27
How to pass multiple module data to a QWeb report? Is there something similar to passing dictionary in rendering html from controller? class account(model.Models): _name = 'account.main' name = fields.Char() class accountSub(model.Models): _name = 'account.sub' name = fields.Char() class PrintWizard(model.Models): _name = 'print.report' account = fields.Many2one('erp.account') @api.multi def print_report(self): ctx = self.env.context.copy() ctx.update({'domain':[('name','=',self.account.name)]}) self.with_context(ctx) return {'name': 'Report', 'type': 'ir.actions.report.xml', 'report_name':

NReco PDFGenerator issue

偶尔善良 提交于 2019-12-01 09:02:55
问题 I've been using this tool for about a week, and now, today, it just stopped working. I've reverted the rest of my code back to the previous state and I keep getting the same error. All that I'm getting from the Exception that is thrown is: An exception of type 'System.Exception' occurred in NReco.PdfGenerator.dll but was not handled in user code Additional information: Cannot generate PDF: (exit code: -1073740791) From the Windows Event Log: Faulting application name: wkhtmltopdf.exe, version

custom report through python odoo 9

眉间皱痕 提交于 2019-12-01 06:37:25
问题 How to pass multiple module data to a QWeb report? Is there something similar to passing dictionary in rendering html from controller? class account(model.Models): _name = 'account.main' name = fields.Char() class accountSub(model.Models): _name = 'account.sub' name = fields.Char() class PrintWizard(model.Models): _name = 'print.report' account = fields.Many2one('erp.account') @api.multi def print_report(self): ctx = self.env.context.copy() ctx.update({'domain':[('name','=',self.account.name)

wkhtmltopdf and chinese characters

元气小坏坏 提交于 2019-12-01 06:03:42
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 on a Ubuntu 14.04 desktop system with wkhtmltopdf version "wkhtmltopdf 0.12.1 (with patched qt)". I

Executing wkhtmltopdf from PHP fails

一世执手 提交于 2019-12-01 05:12:21
There have been a few topics similar to mine, but they did not help me. Maybe something new will come up. Problem: I can't execute wkhtmltopdf form PHP. My basic code is: exec('wkhtmltopdf http://somesite.com /home/user/file.pdf'); Now a few things I already checked: the same command works when executed from console safe_mode is disabled - I can execute commands in PHP, for example exec('ls'); works fine path to wkhtmltopdf can be found and I can run the program itself, for example exec('wkhtmltopdf -V'); works fine and outputs versioning info the output path is writable, it has 777