Skip to content
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

Export to pdf #33

Closed
jackycute opened this issue Oct 2, 2015 · 15 comments
Closed

Export to pdf #33

jackycute opened this issue Oct 2, 2015 · 15 comments
Labels
enhancement Wants to improvide an existing feature feature Wants to add a new feature Hacktoberfest help wanted We want you to help us with this! import/export Related to importing or exporting from or to HackMD in some format

Comments

@jackycute
Copy link
Member

Support export to pdf is important.
Previous research the result is not very satisfied.
But we found gitprint and it's opensource, might try that again.

https://github.com/adamburmister/gitprint.com
https://github.com/alanshaw/markdown-pdf

@amigrave
Copy link
Contributor

amigrave commented Nov 7, 2015

Why not using wkhtml2pdf on the generated html ?

@jackycute
Copy link
Member Author

I don't know wkhtml2pdf before, looks good and will give it a try.
But see from the https://github.com/wkhtmltopdf/wkhtmltopdf/issues
It has lots of issue not solved.

Anyway, thanks for help!

@jackycute
Copy link
Member Author

Use markdown-pdf right now, not bad.

@jackycute jackycute added the enhancement Wants to improvide an existing feature label Jan 19, 2016
@jvoisin
Copy link

jvoisin commented Feb 22, 2016

What about pandoc (#48) ;)

@amigrave
Copy link
Contributor

Pandoc will export to pdf using it's renderer which is not aware of all the extra components supported by hackmd (eg: mathjax, diagram, google emojis, ... )

Converting the generated html to pdf is the best bet if we want to support all the javascript exotic features. and as a bonus, it will give you the same look/styles that you actually see in hackmd versus a custom renderer which would render with different styles.

@vincfleurette
Copy link

Could you add a way to integrate the summary in the pdf export ?

@jackycute
Copy link
Member Author

Hi @vincfleurette,
Could you tell more about "the summary" ?

@amlwwalker
Copy link

What could be nice is adding a PDF export button for something like https://docraptor.com/ for those who are happy to pay for the conversion. PDF generation is always tedious from things like markdown, but as HTML export is already implemented, it could be a simple solution? Example code on their website on how to POST HTML to docraptor, and get back a PDF, which you then offer to the user via download... Just a thought...

@jackycute
Copy link
Member Author

jackycute commented Aug 29, 2016

@amlwwalker good point!
I found out how dillinger did their PDF export yesterday, we might be able to do this too.
https://github.com/joemccann/dillinger/blob/b28fd80445ac02739548d99d79ea6490ac4c7d2d/plugins/core/server.js#L109

@ChihChengLiang
Copy link

ChihChengLiang commented Dec 16, 2016

Dear maintainers,

Thanks for this awesome project. Was googling for how to export slides to pdf and end up finding this discussion here. Would like a feature that can do this, but after went through some issue discussion here I understand lots of works are still going on. For anyone want to export slides to pdf, here I offer a workaround for you.

  1. Modify the url by appending ?print-pdf after it. For example, change from https://hackmd.io/p/slide-example#/ to https://hackmd.io/p/slide-example?print-pdf. Note that ?print-pdf must be put before #/

  2. Select print in the right-click menu. If you only intend to send it as pdf, check the background graphics option and you are in business.

screen shot 2016-12-16 at 11 16 02 am

  1. If you want to print it and find a dark background too ink costly, you might want to uncheck the background graphics and use a black font color. Open your browser developer console and enter the following command $("h1, h2, p").css("color", "black"), then you are good to print. For example, in Chrome browser and Mac OS you press opt + cmd +j to open the developer console and paste the magic spell.

screen shot 2016-12-16 at 11 25 27 am

Cheers,
Chih-Cheng

@Yukaii Yukaii added this to the Backlog milestone Feb 27, 2017
@tigercosmos
Copy link

Shall we work on this to land the function to export PDF?

@SISheogorath SISheogorath added feature Wants to add a new feature help wanted We want you to help us with this! Hacktoberfest labels Oct 6, 2017
@ccoenen ccoenen added the import/export Related to importing or exporting from or to HackMD in some format label Oct 6, 2017
@SISheogorath
Copy link
Contributor

@tigercosmos Pull Requests are welcome :)

In general, we have currently a way to export the documents as PDF on self-hosted instances.

Exporting the Slides as PDF would be another nice feature. If you want to implement that feel free to do so. We would love it!

@komikoni
Copy link

The "?Print-pdf" feature of the slide no longer works properly.
Now, only the first page can be printed, and the second and subsequent pages can not be printed.

@jackycute
Copy link
Member Author

jackycute commented Feb 21, 2018

@komikoni Sorry about that. It's an issue of HackMD.io, CE can use ?print-pdf properly.
And we've moved all our EE and HackMD.io issues here:
https://github.com/hackmdio/hackmd-io-issues/issues
Please check there.

@fabioperrella
Copy link

I've just noticed the export to PDF works much better in Chrome compared to Firefox!

I'm using Ubuntu 16.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Wants to improvide an existing feature feature Wants to add a new feature Hacktoberfest help wanted We want you to help us with this! import/export Related to importing or exporting from or to HackMD in some format
Projects
None yet
Development

No branches or pull requests