wicked-pdf

Page break for long table

…衆ロ難τιáo~ 提交于 2020-12-08 06:42:30
问题 I have a long table which shows rows on several pages. When a page ends, the row is printed half on one page and half on the next page. How can I make sure that the rows is printed completely on the new page? 回答1: CSS property: page-break-inside: avoid; on HTML tr element does it. Tested with: wkhtmltopdf 0.12.3 provided for Linux (Ubuntu Trusty) 32-bit / 64-bit built on Ubuntu 14.04.2 as provided at: http://wkhtmltopdf.org/downloads.html#stable A quick and dirty test may look like: <tr style

Page break for long table

萝らか妹 提交于 2020-12-08 06:42:10
问题 I have a long table which shows rows on several pages. When a page ends, the row is printed half on one page and half on the next page. How can I make sure that the rows is printed completely on the new page? 回答1: CSS property: page-break-inside: avoid; on HTML tr element does it. Tested with: wkhtmltopdf 0.12.3 provided for Linux (Ubuntu Trusty) 32-bit / 64-bit built on Ubuntu 14.04.2 as provided at: http://wkhtmltopdf.org/downloads.html#stable A quick and dirty test may look like: <tr style

WickedPDF in Docker sometimes fails generating a PDF attachment

时光毁灭记忆、已成空白 提交于 2020-03-25 16:01:41
问题 I have a local Rails app that utilizes WickedPDF for some PDF generation in a Sidekiq job. When I run my app locally, it works just fine and all my RSpec tests pass. When I try to spin up the app in a Docker container, there's some strange behavior: The Sidekiq jobs occassionally fail with an error and go back in to the "retry" queue. Over time, they all eventually get successfully processed, but it takes a lot of failed (expensive) attempts to do so. Is there any way to fix the error below,

WickedPDF in Docker sometimes fails generating a PDF attachment

我与影子孤独终老i 提交于 2020-03-25 16:00:11
问题 I have a local Rails app that utilizes WickedPDF for some PDF generation in a Sidekiq job. When I run my app locally, it works just fine and all my RSpec tests pass. When I try to spin up the app in a Docker container, there's some strange behavior: The Sidekiq jobs occassionally fail with an error and go back in to the "retry" queue. Over time, they all eventually get successfully processed, but it takes a lot of failed (expensive) attempts to do so. Is there any way to fix the error below,

Wicked PDF not making AJAX / JS calls

て烟熏妆下的殇ゞ 提交于 2020-03-03 08:59:11
问题 I am currently using JS and Ajax requests to edit some HTML tags depending on certain controller method results. This is all working fine until I want to Generate a PDF, I have been doing some research and have found some "solutions" to this using the javascript_delay and window-status but was unsuccessful. Following the guide of wkhtmltopdf I am using the wicked_pdf_javascript_include_tag to load the JS file and this is being written and saved, but I dont know if the Javascript is being

How do I get total pages in wkhtmltopdf body?

我只是一个虾纸丫 提交于 2020-03-01 01:45:21
问题 Is it possible to access the "topage" variable within the main content body? I know you can do it in headers and footers but in this specific use case, I need to put a sentence within the body that says: "This document contains XX pages". 回答1: This works to me. But need to be in the header (ou footer) In the body I think it is not possible, like they said in the GitHub http://github.com/wkhtmltopdf/wkhtmltopdf/issues/1889 To put this info in the footer you can see @Unixmonkey in this link:

XMLhttprequest returning empty responseText and readyState == 4 (WickedPF)

筅森魡賤 提交于 2020-02-04 01:18:06
问题 So we have this HTTP request call in our rails project which is working good, everything is fine. it calls the controller method and returns the value from that controller (in this case is going to be "true" or "false") var httpRequest; if (window.XMLHttpRequest) { // Mozilla, Safari, ... httpRequest = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP");

XMLhttprequest returning empty responseText and readyState == 4 (WickedPF)

扶醉桌前 提交于 2020-02-04 01:18:03
问题 So we have this HTTP request call in our rails project which is working good, everything is fine. it calls the controller method and returns the value from that controller (in this case is going to be "true" or "false") var httpRequest; if (window.XMLHttpRequest) { // Mozilla, Safari, ... httpRequest = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP");

wicked_pdf create hyperlinks to local files

折月煮酒 提交于 2020-01-25 09:42:05
问题 I wan't to create a PDF document, which contains hyperlinks to local files. E.g. when the PDF is downloaded, along with some files, the PDF contains hyperlinks to these files. Is this possible to achieve, and if so, how? 回答1: You could try the following. This method works in general for linking local files to HTML documents. <a href="file:///C:\Programs\sort.mw">Link 1</a> <a href="file:///C:\Your File Location">Link 2</a> Notice the file:/// (3 slashes) before the location. 来源: https:/

Wicked PDF - Wait for AJAX request to finish

寵の児 提交于 2020-01-05 07:40:17
问题 I'm trying to generate a PDF using WickedPDF and all of my static HTML/CSS is loading. I have a few elements on the page that are populated using AJAX requests, but they are not showing up in the PDF. I know :redirect_delay can be passed as a parameter, but this does not help in the case of waiting for my AJAX calls to finish. Since I didn't see any mention of Wicked PDF and pages generated from AJAX calls, I figured I'd ask: Is what I'm trying to do possible with Wicked PDF (or other