Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I convert HTML into document form?
    primarykey
    data
    text
    <p>I'd like to be able to convert HTML to either <a href="https://github.com/bagilevi/docx_builder" rel="nofollow">docx</a> or <a href="https://github.com/thechrisoshow/rtf/" rel="nofollow">RTF</a>. There are plenty of Ruby gems for creating docx and RTF docs, but they are just for <em>creating</em> an empty document, which you can then programmatically add stuff to. </p> <p>The issue with those gems is there is no way to accurately convert the format of a webpage to be the same/similar on a printable page. There are a lot of complexities with HTML tags, and the position of those tags due to their CSS attributes. </p> <p>With my current knowledge of the gems out there for <a href="https://github.com/thechrisoshow/rtf/" rel="nofollow">RTF</a> and <a href="https://github.com/bagilevi/docx_builder" rel="nofollow">Word</a> creation, I'd have to write an HTML parser and convert all the HTML tags to similar openXML tags, such as bold, and italic, but then position things based on the CSS, but due to <code>position: relative/absolute</code> rendering a document page would be extremely difficult.</p> <p>I'm wondering if there are any recent developments, or if there is some soon-to-be-released gem or service or tool to be able to handle this conversion.</p> <p>There is a gem that is supposed to convert Word to and from HTML, but, it has no documentation, and can only be found at <a href="https://www.ruby-toolbox.com/gems/word_parsing" rel="nofollow">https://www.ruby-toolbox.com/gems/word_parsing</a> and on rubygems. And, I've been unsuccessful installing it on my local machine, due to dependency issues. Since there is no documentation, there is no mention how to fix the dependencies. </p> <p>There are services out there that will convert PDF to "word", and converting HTML to PDF has already been solved by multiple people or gems. This service: <a href="http://www.pdftoword.com/" rel="nofollow">http://www.pdftoword.com/</a> converts PDF to RTF, and even separates out the images in the resulting document. Their issue is that it runs on a Windows server -- I need something cross platform, because the app I'm working on is Ruby on Rails running on Unix based servers.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload