
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.