
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
document_to_rich_html
Advanced tools
DocumentToRichHtml is a powerful Ruby gem that converts various document formats (PDF, Word, Excel, and images) to rich HTML format compatible with the Trix editor. It preserves formatting, styles, and embedded images, making it ideal for applications that need to import and display formatted content.
The convert
method returns a string containing the rich HTML representation of the document, which can be used directly with the Trix editor or other rich text editors.
You can configure the maximum file size limit by setting an environment variable:
export MAX_FILE_SIZE=10000000
Add this line to your application's Gemfile:
gem 'document_to_rich_html'
And then execute:
bundle install
```bash
gem install document_to_rich_html
require 'document_to_rich_html'
html = DocumentToRichHtml.convert('path/to/your/document.pdf')
puts html
Convert a PDF file
rich_html = DocumentToRichHtml.convert('path/to/your/document.pdf')
Convert a Word document
rich_html = DocumentToRichHtml.convert('path/to/your/document.docx')
Convert an Excel spreadsheet
rich_html = DocumentToRichHtml.convert('path/to/your/spreadsheet.xlsx')
Convert an image
rich_html = DocumentToRichHtml.convert('path/to/your/image.jpg')
The convert
method returns a string containing the rich HTML representation of the document, which can be used directly with the Trix editor or other rich text editors.
Bug reports and pull requests are welcome on GitHub at https://github.com/yourusername/document_to_rich_html. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the DocumentToRichHtml project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that document_to_rich_html demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.