converting html into word doc or pdf preserving styles (or how to use git for word documents)

2

2

So initially I thought maybe it would be good idea to keep the history of changes to my resúmé. I thought: "Source-control! Git!" but then I realized that my resúmé is not a simple .txt file, it's a Word document. You still can manage keeping digital copies in git repo, although it will make difficult to see changes line by line, merge and compare.

So I thought maybe I could find a way to preserve text, styles, fonts and indentations in some form of textual document, maybe html. But often you need a word or pdf copy to send someone.

So can you guys enlighten me - what's the best way to deal with that?

Should I create html and find an easy way to convert it into .doc, .docx and .pdf document corectly (is it even possible), or there's a better way to deal with that?

iLemming

Posted 2013-09-10T20:51:04.517

Reputation: 507

Have you figured out a solution for this? – Chetan Sachdev – 2019-08-09T07:46:31.493

1My intuition screams "use Tex" ;-) LaTeX to HTML or to PDF works fine. But it has a steep learning curve and it does not match the [ms office] tag. – Hennes – 2013-09-10T23:16:29.353

Answers

1

Pandoc is probably your most flexible option for converting between formats... It handles html, docx, latex, pdf, markdown, and restructured text.

EDIT: I am pondering this same issue, so don't have a final answer, but... Other than LaTeX, Rich-Text Format and Markdown seem to be the formats that give the best combination of formatting and good version tracking. RTF has an issue that the formatting metacharacters can get moved around between edits. Markdown would give you less control over item-by-item formatting, and would probably be best with an accompanying style-sheet, implemented by whatever program you use to render/preview it.

beroe

Posted 2013-09-10T20:51:04.517

Reputation: 881

Pandoc can convert to all of those formats (and more), but it can't take docx or pdf as input. – evilsoup – 2013-09-11T20:28:35.727

Good point, but it should work for the OP task of HTML -> PDF at the command line. – beroe – 2013-09-12T04:30:14.277

Yeah, I misread the OP, I thought it was about converting .doc to html. However, the default pandoc LaTeX template isn't really suitable for CVs (for PDF, pandoc actually converts the input to LaTeX and then passes it on to a LaTeX engine), so the OP would have to do some investigation into creating a decent template (or possibly they could find one ready-made online). – evilsoup – 2013-09-12T09:22:31.713

0

HTML to PDF is quite simple, you can use a WebBrowser to print the opened webpage as PDF.

edi9999

Posted 2013-09-10T20:51:04.517

Reputation: 109

I mean automatically.. – iLemming – 2013-09-10T21:19:18.703

So you mean automatically using one command line ? – edi9999 – 2013-09-10T21:38:00.727

yeah, that's what I mean – iLemming – 2013-09-10T22:23:53.673