我想在 Windows 上的 Rails 3 应用程序中使用PDFKit。
我安装wkhtmltopdf
了pdfkit
gem。
这是我用来创建 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
我收到以下错误:
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" "--margin-left" "0.75in"
"--encoding" "UTF-8" "--quiet" "-" "my_first_pdf"
有任何想法吗 ?