wkhtmltopdf

How to overlay HTML generated PDF on top of existing PDF?

最后都变了- 提交于 2019-12-28 19:34:08
问题 I'm looking to start with an initial PDF file, one that has graphics and text, and then take some html code which has dynamic values for some user input, generate that as a PDF, hopefully either using the initial PDF as a background, OR somehow running a PHP script afterwards to "merge" both PDF where one acts as a background to another. I have some code that renders an HTML formatted PDF: (using DOMPDF) $initialpdf = file_get_contents('file_html.html'); $initialpdf = str_replace(array( '

wkhtmltopdf linux 乱码解决【python】

别来无恙 提交于 2019-12-27 20:25:18
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1.下载字体库或从Windows中上传 Windows的字体库的位置在:C盘——WINDOWS文件夹——fonts 选择需要的字体文件 2.进入Linux目录 cd /usr/share/fonts 没有可创建 通过rz 命令上传 3.测试 /usr/local/bin/wkhtmltopdf 1.html 1.pdf 来源: oschina 链接: https://my.oschina.net/songms/blog/3148365

jruby IO.popen read hangs in action when requests are made to the local dev server

大城市里の小女人 提交于 2019-12-25 04:06:47
问题 I just want to send the output of wkhtmltopdf to the user. It shouldn't be so hard. def it send_pdf "file.pdf" end def send_pdf(file) url= url_for(params) # Example: http://localhost:3000/report/it webkit= Rails.root.join('app', 'bin', 'wkhtmltopdf', 'current') cmd= "#{webkit} -q \"#{url_for(params)}\" -" data= IO.popen(cmd).read ############### HANGS HERE ################### send_data(data, type: "application/pdf", filename: file) end Why does it hang and how to fix it? 回答1: I think the clue

Report formatting not working in Odoo 8 Qweb Reports

别说谁变了你拦得住时间么 提交于 2019-12-25 03:38:07
问题 All the default reports and the new reports that I am generating are being printed towards the left of the page. This only happens when the report is generated in PDF format. In HTML format the report is displayed fine. I did some research and found that downgrading the wkhtmltox to version 0.21.1 would solve this problem. I did that, but the problem still persists. 回答1: There is one small configuration Go to settings --> Technical --> Parameters --> System Parameters --> Click on Create and

How to pass laravel session to wkhtmlltopdf

二次信任 提交于 2019-12-24 20:24:20
问题 I'm trying to print pages, using wkhtmltopdf, that are protected by auth filter in Laravel. I'm using the standard session cookie -- in config/session.php: 'driver' => 'cookie', 'cookie' => 'laravel_session', But passing the session cookie does nothing, i.e: $ wkhtmltopdf --cookie laravel_session [cookie value] http://myurl.com/protected test1.pdf just prints the login page. Anyone know if there is some special stuff that needs to be done when passing auth cookies to laravel, or what else i

cfpdf merge error when trying to merge multiple pdf files

纵然是瞬间 提交于 2019-12-24 13:52:52
问题 I'm using CFPDF to merge multiple PDFs together. The PDFs were created using wkhtmltopdf 0.12.1. In most cases the code works fine, but 2 of my documents error whenever merged together. My online searches came up empty and I'm really at a loss. Any help is greatly appreciated. <cfpdf action="merge" destination="#outputFile#" overwrite="yes"> <cfloop index="i" from="1" to="#arrayLen(pdfFiles)#"> <cfpdfparam source="#pdfFiles[i]#"> </cfloop> </cfpdf> The error occurs on line 173 <cfpdfparam

Rails views helper don't seems to work with render_to_string

大憨熊 提交于 2019-12-24 06:28:14
问题 I try to convert rails views into pdf with the gem wicked_pdf. But when I do a render_to_string like this ActionController::Base.new.render_to_string(template: "templates/pdf_meteo.html.erb", locals: {communaute_meteo_id: id}, layout: 'pdf') Methods like user_path don't work and return undefined method error... (note that the page work properly if I render it in html) If someone can help me ! 回答1: Unfortunately, using render_to_string will not give you access to Rails URL helpers. One

Rails views helper don't seems to work with render_to_string

空扰寡人 提交于 2019-12-24 06:28:13
问题 I try to convert rails views into pdf with the gem wicked_pdf. But when I do a render_to_string like this ActionController::Base.new.render_to_string(template: "templates/pdf_meteo.html.erb", locals: {communaute_meteo_id: id}, layout: 'pdf') Methods like user_path don't work and return undefined method error... (note that the page work properly if I render it in html) If someone can help me ! 回答1: Unfortunately, using render_to_string will not give you access to Rails URL helpers. One

wkhtmltopdf style table of contents

你。 提交于 2019-12-24 06:11:28
问题 I'm wondering how i can go about reducing the font size on the generated table of contents. I've read and reread their documentation here: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt The bit i'm confused on is: The generated XML document can be viewed by dumping it to a file using the --dump-outline switch. For example: wkhtmltopdf --dump-outline toc.xml http://qt-project.org/doc/qt-4.8/qstring.html qstring.pdf I'm having difficulty understanding how to translate to my own project, and what

wkhtmltopdf style table of contents

痞子三分冷 提交于 2019-12-24 06:11:00
问题 I'm wondering how i can go about reducing the font size on the generated table of contents. I've read and reread their documentation here: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt The bit i'm confused on is: The generated XML document can be viewed by dumping it to a file using the --dump-outline switch. For example: wkhtmltopdf --dump-outline toc.xml http://qt-project.org/doc/qt-4.8/qstring.html qstring.pdf I'm having difficulty understanding how to translate to my own project, and what