Skip to content

Instantly share code, notes, and snippets.

@kitplummer
Created December 11, 2009 22:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitplummer/254556 to your computer and use it in GitHub Desktop.
Save kitplummer/254556 to your computer and use it in GitHub Desktop.
require 'pdftohtmlr'
require 'nokogiri'
include PDFToHTMLR
file = PdfFilePath.new("test.pdf", # source pdf file path
nil, # target html file path - not implemented
nil, # user password
nil # owner password
)
string = file.convert
puts string
doc = file.convert_to_document
puts doc.to_s
# Can now fetch a remote file, and convert (as of 0.3.1)
remote = PdfFileUrl.new("http://somesite.com/test.pdf")
string2 = remote.convert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment