WkHtmlToPdf Google Maps - wkhtmltopdf

Running a command like...
wkhtmltopdf.exe https://maps.google.com goog.pdf
Renders the page with no map in the background. What are the secret command line options to get it to render with the map?
Thanks in advance!

--javascript-delay 3000
May be what your looking for.

Related

Curl progress meter and bar problem. It duplicate data

I have script that final stage is download files with curl. I need to show progress of downloading. When I type on terminal curl -# $url - O it work good. I use it with
while read line
do
"curl code"
done <url
In that case it start filling my screen with #. Default progress meter do that to. It start filling my screen with progress data.
here is picture if you dont understand
progress bar
In curl documentation there writed that they fixed it.
İf I can't solve this problem how I can show only percentage of progress? It can cuted with sed but i don't know how.
Regarding your question
How I can show only percentage of progress?
this seems not to be possible easily according CURL Progress Bar: How to pipe and extract numbers only using grep? or without a wrapper according curl progress - only show percentage.

Wkhtmltopdf cuts off images

So I have had my share of problems with images and wkhtmltopdf. I am trying to convert this html (jsfiddle), to a pdf using wkhtmltopdf (0.12.2.1). However, wkhtmltopdf crops my potato.
Does anyone have an idea how I can make it stop cropping my potato?
I already applied a hack to the html in order to get images to display properly. After extensive research I found that wkhtmltopdf doesn't like clip-path, so I replaced all clip-path's with clip-path="none". Then my images worked, until now that I try to text-align:center them.
Any suggestions are greatly appreciated.
When I found this I hoped I would find the answer to this very issue.
I found the answer at the bottom of this question: wkhtmltopdf + mixed photo colors
Check out #catchdave's response almost 4 years after the OP.
TL&DR, for whatever reason, you need to add opacity: .99 to your image css.
Hope this helps others as I wasted 2 full days debugging this issue before I found the solution!

wkhtmltopdf with full page background image

I've got wkhtmltopdf working with a header and footer image, and everything spaced well. But the task is to use a full page background image which looks like a sort of frame, with the page text in the center. I thought I could place this in the header, but it doesn't work - maybe the use of a full page header doesn't make sense here.
(These are multi-page documents, which could be of any length).
Any ideas of how to do this?
Thanks in advance.
John
I have a similar problem, this is what I understood so far:
It's not possible to center the text vertically on the page simply via CSS+wkhtmltopdf on a multi-page document (might find some complex javascript stuff, but it wasn't worth in my case);
since wkhtmltopdf uses webkit, and webkit doesn't support #page rules, it's not possible to define a "paged" background via CSS
Hence what? You will need a little hack and use pdftk
1. In your CSS define:
body {
background: white;
}
(if you have a body tag in your header.html and footer.html make sure that rule applies to them as well)
2. Create a one-page pdf with your background image (using the same page size as your final pdf)
3. Install pdftk and from command line:
$ pdftk yourfile.pdf background background.pdf output yourfile_b.pdf
4. Enjoy :)
You can use a solution BASED on webkit, like HTM2PDF - you'll be able to add a feature called 'stationary' where you can integrate any image as a full page background.
more info at the documentation from the API page

Why only 1 image out of 2 is correctly read by tesseract?

It's my first experience with tesseract, I'm trying to read the digits contained in these tiff images:
http://imageshack.us/g/703/64553021.png/
As you can see they are in the same format and also same width/height. I don't know why tesseract returns the correct output only for the second image ("150") instead for the first one returns a blank output.
Maybe I should modify them to best fit tesseract? How? I can use Imagemagick if needed.
Thanks in advance.
In the readme they say:
In the executable, page layout analysis is enabled by default. You may need to turn it off to process small images. No command-line control for this yet. Sorry. See tesseractmain.cpp.
I think your images are too small, try editing the code (and recompile).

Creating nice pdfs with ruby

I would like to create pdfs with ruby. One special need is embedding a picture into text (or a textblock), which means I need to be able to let the text flow around the image. E.g. the image should be in the rigth upper corner and the text should start left of the image and continue after the image by using the whole width of the page. How can I do this in ruby? Thank you for any suggestions!
In the past to get print quality PDFs in Ruby, I used rtex.
It's fast too, which is a real bonus.
Prawn to the rescue?
I like the html -> pdf approach. Although it is probably not the best option (prawn is) it makes it easy to design the pdf. See this website. You could also go for the approach documented at jimneath.org.
Good luck
iText is the heavyweight that will allow you to do anything you want with PDFs you can bridge to it with jRuby.
Another option I used was driving open office (it has a ui less option which you can automate from Ruby)
How about having Ruby generate some LaTeX code, then use pdflatex to produce the PDF?
Although I haven't done it myself I've seen people use a headless Open Office. You can control it from Ruby and use it to generate PDF files. You can even use an Open Office template and just fill in some elements into it.

Resources