pdf-core 0.5.1 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ad75dd976f2668839c982efd24ce49e3b699752
4
- data.tar.gz: e93711787ed30c984b053d75c6ed64d4f26ad336
3
+ metadata.gz: c17934d0dd01097acf6f4a8d21292f757789a764
4
+ data.tar.gz: 1346b740ad17366f04d21833f219dc93f853c90b
5
5
  SHA512:
6
- metadata.gz: fd65e2ad057716601050e53cbb8b9e409cd5be8049c1dc54ad687d84b2f1311abe00b8d31b0542d2fd61cb36393be6044e0a4de2659b8eb444e8daf9faf861ad
7
- data.tar.gz: 482df3ef1bb811625319b8098c51738218da5a2db3e22ca7dcdfdd14285c456d1bc35ed66d551b89eb861e841cbfde9bc69b346c50004314d5a653cac7077888
6
+ metadata.gz: d90a6816c593568693df87dd12c522db167e9e8b2b51822c87581d912e3aa758ce16b952f90e9b7ae27c1bb28446a03dbe9f43677dc10c3694ded4acf5f8b568
7
+ data.tar.gz: 5916ac32c1a4a26f77b979ce025c16914e71c42df274319f4c16072afe8a19521fb1d90997682b8270f718b8e95bb850fc2d6dfd8b95b8b9a46686a2e85a0846
@@ -5,7 +5,7 @@ module PDF
5
5
  normalize_metadata(options)
6
6
 
7
7
  if options[:print_scaling]
8
- @store = PDF::Core::ObjectStore.new(:info => options[:info],
8
+ @store = PDF::Core::ObjectStore.new(:info => options[:info],
9
9
  :print_scaling => options[:print_scaling])
10
10
  else
11
11
  @store = PDF::Core::ObjectStore.new(:info => options[:info])
@@ -14,7 +14,7 @@ module PDF
14
14
  @version = 1.3
15
15
  @pages = []
16
16
  @page = nil
17
- @trailer = {}
17
+ @trailer = options.fetch(:trailer, {})
18
18
  @compress = options.fetch(:compress, false)
19
19
  @encrypt = options.fetch(:encrypt, false)
20
20
  @encryption_key = options[:encryption_key]
@@ -71,6 +71,7 @@ module PDF
71
71
  ref.object)
72
72
  end
73
73
  end
74
+
74
75
  end
75
76
  end
76
77
  end
@@ -0,0 +1,30 @@
1
+ require_relative "spec_helper"
2
+
3
+ describe "PDF Document State" do
4
+ before { @state = PDF::Core::DocumentState.new({}) }
5
+
6
+ describe "initialization" do
7
+ it { expect(@state.compress).to eq(false) }
8
+ it { expect(@state.encrypt).to eq(false) }
9
+ it { expect(@state.skip_encoding).to eq(false) }
10
+ it { expect(@state.trailer).to eq({}) }
11
+ end
12
+
13
+ describe "normalize_metadata" do
14
+ it { expect(@state.store.info.data[:Creator]).to eq("Prawn") }
15
+ it { expect(@state.store.info.data[:Producer]).to eq("Prawn") }
16
+ end
17
+
18
+ describe "given a trailer ID with two values" do
19
+ before do
20
+ @state = PDF::Core::DocumentState.new({
21
+ trailer: { :ID => ["myDoc","versionA"] }
22
+ })
23
+ end
24
+
25
+ it "should contain the ID entry with two values in trailer" do
26
+ expect(@state.trailer[:ID].count).to eq(2)
27
+ end
28
+ end
29
+
30
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdf-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Brown
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-03-12 00:00:00.000000000 Z
15
+ date: 2015-07-16 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: pdf-reader
@@ -123,6 +123,7 @@ files:
123
123
  - lib/pdf/core/text.rb
124
124
  - pdf-core.gemspec
125
125
  - spec/decimal_rounding_spec.rb
126
+ - spec/document_state_spec.rb
126
127
  - spec/filters_spec.rb
127
128
  - spec/name_tree_spec.rb
128
129
  - spec/object_store_spec.rb
@@ -152,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
153
  version: 1.3.6
153
154
  requirements: []
154
155
  rubyforge_project: prawn
155
- rubygems_version: 2.2.2
156
+ rubygems_version: 2.4.5
156
157
  signing_key:
157
158
  specification_version: 4
158
159
  summary: PDF::Core is used by Prawn to render PDF documents