-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML/CSS to PDF plugins #13
Comments
I am not sure we are talking of a specific technology, as this is already possible using a print media css. Rather I think this would probably be more of a starter html/css template that we might be able to pipe the markdown files into. But I am sure there are interesting solutions to combine out there, for example, reveal.js has an export to PDF option. |
Is it important for it to maintain the same look and feel as the site? There are many markdown to pdf options, but, from what I've read, the output won't look like the sleek site design, which I think is fine. |
We would like to create a CSS file especially for that print template. Ideally we would have a good starting point that already prints from .md based on a basic css file. I can then take it from there and apply the styles for print based on the ones for the site. Does that make sense? |
From looking around it seems like everything is pointing in the direction of wkhtmltopdf and its multiple offsprings like PDFKit and WeasyPrint. |
and Bootstrap provides a few specific print classes for hiding or revealing elements based on whether it's printed or on screen. |
Running wkhtmltopdf on the Risk Mapping page gives us [this pdf]. I think it looks really good.(https://s3.amazonaws.com/f.cl.ly/items/3C401M2k442Z2t3G2s3N/Risk-Mapping.pdf). @mushon were you thinking that we should produce all pdf's for the content once it is ready and link it to the Download PDF button? If they update the text, this would make the linked PDF irrelevant. In that case, they would need to print the page instead. |
oops… missed this one. |
Stack Overflow says you can't really know for sure how a page will print: |
The print preview is #toomanyvariables, but wkhtmltopdf removes that variable from the equation. Flip side, you'd need to run it preiodically to see results in real time. Although I guess once you map it to "print PDF button" it's a question of one click? |
@tingeber @mushon I am still looking into font and other style changes, but the content is there! |
That’s great progress. Thanks! |
@mushon Apparently custom fonts are not available yet. See parallax/jsPDF#115. |
I've pushed the changes to the button to the site. Some things to note:
|
As I discussed with Tin, I think the auto-generation of PDFs should be a nice-to-have at this point and should not be a deal breaker. If we can form a single long page template that includes all the cards and have a big fat PRINT button at the top we could almost as easily send to PDF or directly to a printer. So if the HTML2PDF solutions become too complicated to maintain and patch around, I suggest we find ways around them. |
I've been doing some work on HTML to PDF the CSS way with some success and some failure. So it seems we will need to print the PDFs for the covers and the inlets separately, which might still make sense, because assuming you don't have a two side printer you want to do the batch of covers and then the batch of inlets. Note: different printers would pile the printed papers differently, so that's another thing we need to account for. Generally, I'm concerned about the limits of CSS when it comes to designing for print. We might need to get more creative with this like breaking it to two files, or simply taking care of generating the PDFs ourselves rather than expect it to be done by anyone without our intervention. |
ok, made some progress with the rotated page. You can now see the page prints to PDF well (on Firefox). I still get an extra empty third page, but I'm not going to worry about it right now. Moving on. |
Look into existing plugins, snippets, widgets that transform a website into printable material - PDFs. Besides basic CSS print stylesheets, we're hoping there are solutions out there that would make the integration between print and web versions seamless, so changes only need to be done once and the plugin renders PDFs from HTML/CSS
The text was updated successfully, but these errors were encountered: