zestsoftware / collective.sendaspdf Goto Github PK
View Code? Open in Web Editor NEWA Plone product that allows downloading the current page as a PDF and also sending it by e-mail
A Plone product that allows downloading the current page as a PDF and also sending it by e-mail
There's any motivation about the reason that the JavaScript source use:
?
When installing collective.sendaspdf
at the Plone products page, jquery.pyproxy
is also listed, but is not installed.
collective.sendaspdf
version 2.9
This has worked fine for a long time as far as I know. But today downloading an https page as pdf misses all styles. Somehow the styles (plus presumably any images) cannot be loaded.
It may be due to this stackoverflow question: http://stackoverflow.com/questions/26529863/how-do-i-configure-wkhtmltopdf-to-request-https-pages-by-url-not-ip-on-windows-8
Possibly a recent openssl update on the server causes this, but that is a guess.
It does not matter whether wkhtmltopdf itself is running on the server that hosts the https website, or locally on my laptop. This gets executed:
parts/wkhtmltopdf/wkhtmltopdf --disable-javascript --toc-header-text Inhoudsopgave --margin-right 10 --margin-left 10 --margin-bottom 10 --margin-top 10 --print-media-type file:///tempfile.html /tmp/tempfile.pdf
Any https links in tempfile.html cannot be loaded. When I replace https with http, it works just fine:
cat tempfile.html | sed "s/https/http/g" > newfile.html
I tried just now with running wkhtmltopdf on https://google.com, but that looks fine. So there may be something wrongly configured on the server.
Workaround that I did on the server to fix it: I edited transforms/wk.py and in the html_to_pdf function I added a line source = source.replace('https://', 'http://')
. (Yes, I did that by editing the collective.sendaspdf distribution on the server. I am bad.)
Hello,
wkhtmltopdf has moved the downloads provider from SourceForge to gna.org. As mentioned in the linked message, all earlier downloads have been removed from SourceForge and you are strongly advised to migrate to the new URLs. The following files in your repository will need to be updated:
It is recommended to either subscribe to the mailing list or Twitter feed to receive updates on new releases and further changes.
Thanks,
wkhtmltopdf maintainer
This works:
(Pdb) extract_from_url('http://.../pgTimePrint/OpenBareForm?ref=562a&to_date=2013-12-31', context_url)
('OpenBareForm', {'ref': '562a', 'to_date': '2013-12-31'})
This does not:
(Pdb) extract_from_url('http://.../pgTimePrint/OpenBareForm?ref=562a&to_date=2013-12-31 00:00', context_url)
(None, None)
In the second case, the to_date
parameter includes a time (00:00
). The parsing chokes on the :
.
It also chokes on urlencoded parameters, e.g.
(Pdb) extract_from_url('http://.../pgTimePrint/OpenBareForm?ref=562a&to_date=2013-12-31+00%3A00', context_url)
(None, None)
Perhaps extract_from_url
could be changed to use urlparse.parse_qs
instead of regex-parsing the URL.
I'm trying to run collective.sendaspdf on a server with wkhtmltopdf 0.12.1 installed.
This fails because of the option "--toc-header-text", whose syntax has apparently changed. The exact same setup works fine on another server with wkhtmltopdf 0.9.9
I'm able to get it to work by simply dropping 'toc-header-text' from the variable 'valued_options' in transforms/wk.py. However, this doesn't seem very elegant and given this error string:
Please check that you use a version compatible with your OS and the version is 0.9.
should collective.sendaspdf be considered "locked" to wkhtml 0.9.*? Are there plans to support later versions like 0.12+ at some point?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.