Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ricn/pdf2htmlex
Convert PDF docs to beautiful HTML files without losing text or format.
https://github.com/ricn/pdf2htmlex
Last synced: about 1 month ago
JSON representation
Convert PDF docs to beautiful HTML files without losing text or format.
- Host: GitHub
- URL: https://github.com/ricn/pdf2htmlex
- Owner: ricn
- License: mit
- Created: 2015-06-30T19:22:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-13T11:40:59.000Z (almost 9 years ago)
- Last Synced: 2024-11-01T08:34:05.976Z (about 1 month ago)
- Language: Elixir
- Homepage: https://github.com/ricn/pdf2htmlex
- Size: 173 KB
- Stars: 88
- Watchers: 5
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Convert PDF docs to beautiful HTML files without losing text or format. (PDF)
- fucking-awesome-elixir - pdf2htmlex - Convert PDF docs to beautiful HTML files without losing text or format. (PDF)
- awesome-elixir - pdf2htmlex - Convert PDF docs to beautiful HTML files without losing text or format. (PDF)
README
Pdf2htmlex
==========
Elixir library to convert PDF documents to HTML without losing text or format.[![Build Status](https://travis-ci.org/ricn/pdf2htmlex.png?branch=master)](https://travis-ci.org/ricn/pdf2htmlex)
[![Hex.pm](https://img.shields.io/hexpm/v/pdf2htmlex.svg)](https://hex.pm/packages/pdf2htmlex)
[![Inline docs](http://inch-ci.org/github/ricn/pdf2htmlex.svg?branch=master)](http://inch-ci.org/github/ricn/pdf2htmlex)## Requirements
The command line tool [pdf2htmlex](http://coolwanglu.github.io/pdf2htmlEX/) must be installed on your system and the binary must be on your PATH.
## Installation
Add this to your `mix.exs` file, then run `mix do deps.get, deps.compile`:
```elixir
{:pdf2htmlex, "~> 0.1"}
```## Examples
```elixir
import Pdf2htmlex
# Simplest conversion possible.
open("/Users/ricn/pdfs/sample.pdf") |> convert_to!("/Users/ricn/html")# Set zoom ratio to 150 % and set horizontal and vertical dpi to 96 for images.
open("/Users/ricn/pdfs/sample.pdf")
|> zoom(1.5)
|> hdpi(96)
|> vdpi(96)
|> convert_to!("/Users/ricn/html")# Set the maximum width to 640 pixels and maximum height to 480 pixels
open("/Users/ricn/pdfs/sample.pdf")
|> fit_width(640)
|> fit_height(480)
|> convert_to!("/Users/ricn/html")# Converts only page 1 to 10
open("/Users/ricn/pdfs/sample.pdf")
|> first_page(1)
|> last_page(10)
|> convert_to!("/Users/ricn/html")# For more options see the documentation
```## Credits
The following people have contributed ideas, documentation, or code to Pdf2htmlex:
* Richard Nyström
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request