printmyblog icon indicating copy to clipboard operation
printmyblog copied to clipboard

Save as Microsoft Word Doc

Open mnelson4 opened this issue 4 years ago • 3 comments

Despite me, the people want an MS Word doc of their blog. Here is some simple JavaScript to get started on it: https://www.codeproject.com/Articles/7341/Dynamically-generate-a-MS-Word-document-using-HTML It also seems Word might be ok opening HTML files.

mnelson4 avatar May 23 '20 19:05 mnelson4

really helpful: https://sebsauvage.net/wiki/doku.php?id=word_document_generation similar project: https://github.com/aadel112/googoose

mnelson4 avatar May 10 '22 16:05 mnelson4

  • [x] creates ms word docs
  • [x] pagebreaks before each article
  • [x] toc
  • [x] limit image sizes
  • [x] handle external images
  • [x] add description of design
  • [x] only offer to pro licenses
  • [x] beta test
  • [x] option: convert to data urls (no work with google docs)
  • [x] remove image lazy loading
  • [x] optionally convert internal hyperlinks because they don’t work when exported to pdf: https://answers.microsoft.com/en-us/msoffice/forum/all/word-to-pdf-causes-internal-hyperlinks-to-fail/59fede88-2934-4d94-b4fc-f3d04ee01cc5 and https://answers.microsoft.com/en-us/msoffice/forum/all/hyperlinks-in-word-not-working-once-saved-as-pdf/5408f645-9832-4eea-a79d-62a7bccbae05
  • [x] Also, check headers are headers in MS Word: https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-import-an-html-file-into-ms-word-and-have/d69b7cd8-3cc7-41b4-9b7c-032232c147bf
  • [ ] after save, file reverted to web view (whereas HTML file made in word keeps whatever set last in word)
  • [ ] how to: remove item from TOC (don't make it a heading)

mnelson4 avatar May 11 '22 17:05 mnelson4

Document:

  • to use as an Amazon ebook, first save as docx
  • to use as an Amazon printed book, it can't be too long
  • On Mac, save as docs to view images
  • Export as pdf for real preview
  • Before manual formatting, verify Word can export to PDF ok
  • Also verify generated PDF will meet requirements of publisher (eg Amazon self-publishing)

mnelson4 avatar Jul 28 '22 22:07 mnelson4