Skip to content
Convert PDF docs to beautiful HTML files without losing text or format.
Branch: master
Clone or download

Latest commit

Latest commit e4a90b6 Jan 13, 2016


Type Name Latest commit message Commit time
Failed to load latest commit information.
config First commit Jun 30, 2015
lib Prepend to lists instead Jan 13, 2016
test Better error reporting from the command line tool Jul 18, 2015
.gitignore Do not include generated docs Jul 3, 2015
.travis.yml Use Erlang 18.2 on Travis Jan 13, 2016
LICENSE Added license Jul 4, 2015 Added version badge Jul 4, 2015
mix.exs Updated all deps Jan 13, 2016
mix.lock Updated all deps Jan 13, 2016


Elixir library to convert PDF documents to HTML without losing text or format.

Build Status Inline docs


The command line tool pdf2htmlex must be installed on your system and the binary must be on your PATH.


Add this to your mix.exs file, then run mix do deps.get, deps.compile:

  {:pdf2htmlex, "~> 0.1"}


  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.
  |> 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
  |> fit_width(640)
  |> fit_height(480)
  |> convert_to!("/Users/ricn/html")

  # Converts only page 1 to 10
  |> first_page(1)
  |> last_page(10)
  |> convert_to!("/Users/ricn/html")

  # For more options see the documentation


The following people have contributed ideas, documentation, or code to Pdf2htmlex:

  • Richard Nyström


  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
You can’t perform that action at this time.