pdf2image 0.0.1 → 0.0.2
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 +13 -3
- data/lib/pdf2image.rb +3 -6
- data/lib/pdf2image/version.rb +1 -1
- data/pdf2image.gemspec +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03b9ab538e5ed682a6526461e4d46a757e5485f4
|
4
|
+
data.tar.gz: 3e17c380fe33de11c0bbe538a132450c9ac6f5c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05cf913649eee5e9f39ea816bbdfa56fe743c5bb558f3702d430c4574334d95bc4df620ec4a3e399cfceda47b16fc1b508f7aa65e64e587f0adb8de34ecc0e7b
|
7
|
+
data.tar.gz: 22390d2acbdbb67307a77f834b94bc26986eebaa4792bc76eaed93d2016aa94ef2a0a229630f7595421634054cd143393267639ce1b5ec8e1b5fd52e3e2b2b3b
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Pdf2image
|
2
2
|
|
3
|
-
Welcome to
|
3
|
+
Welcome to pdf2image gem.
|
4
4
|
|
5
|
-
|
5
|
+
pdf2image accepts pdf file path as input string and it will convert pdf file into a jpeg image format.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -22,7 +22,17 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
pdf2image gem usage is very simple. you just need to require it into your code using
|
26
|
+
|
27
|
+
require 'pdf2image'
|
28
|
+
|
29
|
+
## Just to make sure pdf2image is loaded or not
|
30
|
+
$ Pdf2image.welcome
|
31
|
+
You are using Pdf2image Gem!!
|
32
|
+
|
33
|
+
## to convert pdf file into image
|
34
|
+
$ Pdf2image.convert("sample pdf path")
|
35
|
+
|
26
36
|
|
27
37
|
## Development
|
28
38
|
|
data/lib/pdf2image.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require "pdf2image/version"
|
2
2
|
require 'rmagick'
|
3
3
|
|
4
|
+
# converts pdf to jpeg
|
4
5
|
module Pdf2image
|
5
6
|
|
7
|
+
|
6
8
|
def self.welcome
|
7
9
|
puts "You are using Pdf2image Gem!!"
|
8
10
|
end
|
@@ -11,16 +13,11 @@ module Pdf2image
|
|
11
13
|
filepath = File.dirname(path)
|
12
14
|
extn = File.extname path
|
13
15
|
filename = File.basename path, extn
|
14
|
-
puts "Name" + filename
|
15
16
|
|
16
17
|
pdf = Magick::ImageList.new(path)
|
17
18
|
if pdf.format == "PDF"
|
18
|
-
puts pdf.format.inspect
|
19
|
-
puts pdf.class.inspect
|
20
19
|
pdf.write(filepath + "/" + filename + ".jpg")
|
21
|
-
|
22
|
-
# puts "hello"
|
23
|
-
# pdf.write(filename + ".pdf")
|
20
|
+
STDOUT.put "\033[107;31m Your file saved in #{filepath}\033[0m"
|
24
21
|
else
|
25
22
|
raise StandardError, "Please enter valid PDF file path!"
|
26
23
|
end
|
data/lib/pdf2image/version.rb
CHANGED
data/pdf2image.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = %q{Converts pdf to image}
|
13
13
|
spec.description = %q{pdf2image accepts pdf file path as input and converts into a jpeg image}
|
14
|
-
spec.homepage = ""
|
14
|
+
spec.homepage = "https://github.com/kishor557/pdf2image"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdf2image
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Venkat
|
@@ -78,7 +78,7 @@ files:
|
|
78
78
|
- lib/pdf2image.rb
|
79
79
|
- lib/pdf2image/version.rb
|
80
80
|
- pdf2image.gemspec
|
81
|
-
homepage:
|
81
|
+
homepage: https://github.com/kishor557/pdf2image
|
82
82
|
licenses:
|
83
83
|
- MIT
|
84
84
|
metadata: {}
|
@@ -103,4 +103,3 @@ signing_key:
|
|
103
103
|
specification_version: 4
|
104
104
|
summary: Converts pdf to image
|
105
105
|
test_files: []
|
106
|
-
has_rdoc:
|