pdfshaver 0.0.2 → 0.0.3
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 +7 -8
- data/ext/pdfium_ruby/extconf.rb +37 -25
- data/lib/pdfshaver/version.rb +2 -1
- data/pdfshaver.gemspec +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0f341affb16b502cf583da55707054d02a9cb91
|
4
|
+
data.tar.gz: beabdca581b5d8c9575504a11c109b5664798622
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89d55bb5a0908de9430d4b50d208db159724f0ad65776f15801bd76182b640fefa892b02970eb4dced6b79a54df2b3ec67dcdde92c385f271d9bc0d815e2b7b0
|
7
|
+
data.tar.gz: 094b4d097b981d54f1640bf882446593032a007f8742e07252230552480464731a5c18f86af79d378d9c1db9dfbd3779f4e644522d4a05e72290eee972a52680
|
data/Readme.md
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# PDFShaver
|
2
2
|
|
3
|
-
# N.B. THIS IS A WORK IN PROGRESS
|
4
|
-
|
5
3
|
Shave pages off of PDFs as images.
|
6
4
|
|
7
5
|
### Examples
|
@@ -27,11 +25,12 @@ PDFShaver depends on [Google Chrome's `PDFium` library][pdfium], and, for now, i
|
|
27
25
|
|
28
26
|
#### On Ubuntu/Debian
|
29
27
|
|
30
|
-
We've built a .deb that you can download
|
31
|
-
|
32
|
-
Once you have downloaded the file, you can install it like this:
|
28
|
+
We've built a .deb that you can download and install like so:
|
33
29
|
|
34
|
-
|
30
|
+
```sh
|
31
|
+
wget 'https://assets.documentcloud.org/pdfium/libpdfium-dev_20151208.015427_amd64.deb'
|
32
|
+
sudo dpkg -i libpdfium-dev_20151208.015427_amd64.deb
|
33
|
+
```
|
35
34
|
|
36
35
|
And install FreeImage and FreeType:
|
37
36
|
|
@@ -41,7 +40,7 @@ And install FreeImage and FreeType:
|
|
41
40
|
|
42
41
|
You can use homebrew to install pdfium's current code using our Homebrew formula:
|
43
42
|
|
44
|
-
`brew install --HEAD https://raw.githubusercontent.com/knowtheory/homebrew/
|
43
|
+
`brew install --HEAD https://raw.githubusercontent.com/knowtheory/homebrew/c35937bc14e9829d2e94100b9120273b1c496474/Library/Formula/pdfium.rb`
|
45
44
|
|
46
45
|
Then install FreeImage:
|
47
46
|
|
@@ -57,4 +56,4 @@ Sorry we don't have a release for your OS but we'd be happy to talk to you about
|
|
57
56
|
|
58
57
|
### Install PDFShaver
|
59
58
|
|
60
|
-
`gem install pdfshaver` (you may have to use `sudo gem` instead of just `gem`)
|
59
|
+
`gem install pdfshaver` (you may have to use `sudo gem` instead of just `gem`)
|
data/ext/pdfium_ruby/extconf.rb
CHANGED
@@ -36,33 +36,45 @@ HEADER_DIRS = append_search_paths_to header_dirs, header_paths
|
|
36
36
|
dir_config("pdfium", HEADER_DIRS, LIB_DIRS)
|
37
37
|
|
38
38
|
# lib order needs to be in dependency loaded order, or will not link properly.
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
39
|
+
# this is a nested list of basic alternatives.
|
40
|
+
LIB_FILES= [
|
41
|
+
['javascript'],
|
42
|
+
['bigint'],
|
43
|
+
['fx_freetype'],
|
44
|
+
['fx_agg'],
|
45
|
+
['fx_lcms2'],
|
46
|
+
['fx_libjpeg', 'jpeg'],
|
47
|
+
['fx_libopenjpeg'],
|
48
|
+
['fx_zlib'],
|
49
|
+
['fxedit'],
|
50
|
+
['fxcrt'],
|
51
|
+
['fxcodec'],
|
52
|
+
['fxge'],
|
53
|
+
['fpdfdoc'],
|
54
|
+
['fpdftext'],
|
55
|
+
['formfiller'],
|
56
|
+
['pdfwindow'],
|
57
|
+
['fpdfdoc'],
|
58
|
+
['fdrm'],
|
59
|
+
['fpdfapi'],
|
60
|
+
['pdfium'],
|
61
|
+
['pthread'],
|
62
|
+
['freeimage']
|
62
63
|
]
|
63
64
|
|
64
|
-
LIB_FILES.each do |
|
65
|
-
|
65
|
+
LIB_FILES.each do | alternatives |
|
66
|
+
|
67
|
+
# produce plain english error message
|
68
|
+
lib_names = if alternatives.size > 1
|
69
|
+
lib_list = alternatives.map{|name|"lib#{name}"}
|
70
|
+
last_element = lib_list.pop
|
71
|
+
"any of #{lib_list.join(", ")}, or #{last_element}"
|
72
|
+
else
|
73
|
+
"lib#{alternatives.first}"
|
74
|
+
end
|
75
|
+
message = "\nCould not find #{lib_names} in:\n\t#{LIB_DIRS.join("\n\t")}\n\n"
|
76
|
+
|
77
|
+
abort(message) unless alternatives.any?{ |lib| have_library(lib) }
|
66
78
|
end
|
67
79
|
|
68
80
|
$CPPFLAGS += " -fPIC -std=c++11 -Wall"
|
data/lib/pdfshaver/version.rb
CHANGED
data/pdfshaver.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdfshaver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ted Han
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-12-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|