pdftohtml 0.2.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +29 -1
- data/lib/pdftohtml.rb +6 -2
- data/lib/pdftohtml/version.rb +1 -1
- data/pdftohtml.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 453ad8317072fa31527a050f6d361bdd29f8ec57
|
4
|
+
data.tar.gz: 1ad71159091f1cc2e88b47222e36f89274c34e2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0ce4b8708f0aa3c960f016c10e73e4e34e456ade6938b1215a5e0ab12815da50efa8cb80ed9ed0ead57822e360a52027abf4e59c546a370034b18f282c406f6
|
7
|
+
data.tar.gz: 9f9bf15a1b28bc563b863a1cd939e0864751bcf6a01612ee414e2abc64f7419b75eb4d2dba5df783e5b18849661cf0c9da247a302ad54a3266695a92b0aa8304
|
data/README.md
CHANGED
@@ -1,8 +1,36 @@
|
|
1
1
|
# PDF To HTML
|
2
2
|
|
3
|
-
Simplistic wrapper around poppler's
|
3
|
+
Simplistic wrapper around poppler's *pdftohtml* utility.
|
4
4
|
Allows conversion of PDF files into HTML documents.
|
5
5
|
|
6
|
+
## Presentation
|
7
|
+
|
8
|
+
This library provides an easy-to-use interface to the *pdftohtml* utility provided by the [Poppler](https://poppler.freedesktop.org/) package.
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
### Gemfile
|
13
|
+
```ruby
|
14
|
+
gem 'pdftohtml'
|
15
|
+
```
|
16
|
+
|
17
|
+
### Terminal
|
18
|
+
```bash
|
19
|
+
gem install -V pdftohtml
|
20
|
+
```
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Converting a PDF document is as simple as:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
Pdftohtml.convert 'example.pdf'
|
28
|
+
# => { 1 => ["<!DOCTYPE html>", "<html>", ...] }
|
29
|
+
```
|
30
|
+
|
31
|
+
The output of the *convert* method is a hash of pages from the PDF file: { 1 => [...], 2 => [...] }
|
32
|
+
Each page is an array of lines.
|
33
|
+
|
6
34
|
## License
|
7
35
|
|
8
36
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/pdftohtml.rb
CHANGED
@@ -4,10 +4,14 @@
|
|
4
4
|
# External Includes
|
5
5
|
require 'fileutils'
|
6
6
|
|
7
|
-
# PDF To HTML Module
|
7
|
+
# PDF To HTML Module:
|
8
|
+
# Root Module for Pdftohtml.
|
8
9
|
module Pdftohtml
|
9
10
|
|
10
|
-
# Convert PDF to HTML
|
11
|
+
# Convert PDF to HTML:
|
12
|
+
# Converts the file pointed to by pdf_file into a hash of HTML pages.
|
13
|
+
# @param [String] pdf_file Path to a PDF file
|
14
|
+
# @return [Hash] A hash of HTML Pages { 0 => ['Line0', 'Line1', ...], 1 => ['Line0', 'Line1', ...], ... }
|
11
15
|
def self.convert pdf_file
|
12
16
|
|
13
17
|
# Generate Output Directory
|
data/lib/pdftohtml/version.rb
CHANGED
data/pdftohtml.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdftohtml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eresse
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: Simplistic wrapper around poppler's pdftohtml utility
|
42
56
|
email:
|
43
57
|
- eresse@eresse.net
|