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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8f76428237b693ba33bc3c3f73482fa769ac19e
4
- data.tar.gz: 948f9868b24deee695115999875b2bccddc915be
3
+ metadata.gz: c0f341affb16b502cf583da55707054d02a9cb91
4
+ data.tar.gz: beabdca581b5d8c9575504a11c109b5664798622
5
5
  SHA512:
6
- metadata.gz: dc2545b699bb2f8b16e4372434eb2a2c7c0a71c99eceb94353c09726b8a9e8bda8ed02f608f29775ec668cfc877e8190bfdde6907de62bb78819a8146e8bbe8d
7
- data.tar.gz: da77e75e8435285efaef20bafcbb7fdcf2247560ef753727084d7e09f1472396080ab14f0e49c3af896bee8f378a070a09ef6a3b8318ff1e773431db505dd289
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 by running: `wget 'http://assets.documentcloud.org/pdfium/libpdfium-dev_20151024.163326_amd64.deb'`
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
- `sudo dpkg -i libpdfium-dev_20151024.163326_amd64.deb` (where `libpdfium-dev_20151024.163326_amd64.deb` is the name of the file you just downloaded)
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/45606ddde3fdd657655208be0fb1a065e142a4f1/Library/Formula/pdfium.rb`
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`)
@@ -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
- LIB_FILES= %w[
40
- javascript
41
- bigint
42
- fx_freetype
43
- fx_agg
44
- fx_lcms2
45
- fx_libjpeg
46
- fx_libopenjpeg
47
- fx_zlib
48
- fxedit
49
- fxcrt
50
- fxcodec
51
- fxge
52
- fpdfdoc
53
- fpdftext
54
- formfiller
55
- pdfwindow
56
- fpdfdoc
57
- fdrm
58
- fpdfapi
59
- pdfium
60
- pthread
61
- freeimage
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 | lib |
65
- have_library(lib) or abort "Couldn't find library lib#{lib} in #{LIB_DIRS.join(', ')}"
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"
@@ -1,3 +1,4 @@
1
1
  module PDFShaver
2
- VERSION='0.0.2'
2
+ VERSION='0.0.3'
3
+ VERSION_RELEASED='2015-12-07'
3
4
  end
@@ -5,6 +5,7 @@ require 'pdfshaver/version'
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'pdfshaver'
7
7
  s.version = PDFShaver::VERSION
8
+ s.date = PDFShaver::VERSION_RELEASED
8
9
  s.licenses = ['MIT']
9
10
  s.summary = "Shave pages off of PDFs as images"
10
11
  s.description = <<-DESCRIPTION
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.2
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-10-29 00:00:00.000000000 Z
12
+ date: 2015-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler