combine_pdf 1.0.4 → 1.0.5
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/CHANGELOG.md +12 -0
- data/lib/combine_pdf/pdf_protected.rb +8 -6
- data/lib/combine_pdf/version.rb +1 -1
- 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: aae99be65f85291a4eb366e78d93e015822e1dcd
|
4
|
+
data.tar.gz: b92628654f3a544d3fd54fe3b9e56c344227605c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac30f12f96a4bd58e1290859713f88917639f1ff92ba3d14ab72cfdfbdd70655727cd30a1082374fdf43e0fc8f1f502323a8b35c8f37d8a059a89baf096fb221
|
7
|
+
data.tar.gz: 4e2d3f8609b1f531c95c1e28af217eaf6e93a9a112ee96e2678d562ccb7bc895b5629b56fb90e6631a891ae1fed45985ab6cafab2ec999d52a3c1e7bbfbd11e4
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
***
|
4
4
|
|
5
|
+
#### Change log v.1.0.5
|
6
|
+
|
7
|
+
**Fix**: Fix issue #116 where some PDF objects (the page catalog and some root information data) were written twice to the saved PDF file (or String). Credit to @albertsaave for exposing the issue using GhostScript.
|
8
|
+
|
9
|
+
***
|
10
|
+
|
11
|
+
#### Change log v.1.0.4
|
12
|
+
|
13
|
+
**Fix**: Fix issue #115 where PDF object versioning was being assumed to update the `indirect generation number`, allowing Object Streams to be inflated at the end of the parsed data collection instead of the middle. Fixed the issue by pre-emptive object deletion and by inflating Object Streams in place. Credit to @joshirashmics for exposing the issue.
|
14
|
+
|
15
|
+
***
|
16
|
+
|
5
17
|
#### Change log v.1.0.3
|
6
18
|
|
7
19
|
**Fix**: Fix issue #111 where some fonts would cause `pdf.fonts` to break the PDF. Credit to Pavel Slabý (@paulslaby) for exposing the issue.
|
@@ -16,16 +16,18 @@ module CombinePDF
|
|
16
16
|
# @private
|
17
17
|
# Some PDF objects contain references to other PDF objects.
|
18
18
|
#
|
19
|
-
# this function adds the references contained in
|
19
|
+
# this function adds the references contained in these objects.
|
20
20
|
#
|
21
21
|
# this is used for internal operations, such as injectng data using the << operator.
|
22
|
-
def add_referenced(
|
22
|
+
def add_referenced()
|
23
23
|
# add references but not root
|
24
24
|
dup_pages = nil
|
25
25
|
# an existing object map
|
26
26
|
resolved = {}.dup
|
27
27
|
existing = {}.dup
|
28
|
-
|
28
|
+
should_resolve = [].dup
|
29
|
+
#set all existing objects as resolved and register their children for future resolution
|
30
|
+
@objects.each { |obj| existing[obj] = obj ; resolved[obj.object_id] = obj; should_resolve << obj.values}
|
29
31
|
# loop until should_resolve is empty
|
30
32
|
while should_resolve.any?
|
31
33
|
obj = should_resolve.pop
|
@@ -112,7 +114,7 @@ module CombinePDF
|
|
112
114
|
# inject new catalog and pages objects
|
113
115
|
@objects << @info if @info
|
114
116
|
@objects << catalog_object
|
115
|
-
@objects << pages_object
|
117
|
+
# @objects << pages_object
|
116
118
|
|
117
119
|
# rebuild/rename the forms dictionary
|
118
120
|
if @forms_data.nil? || @forms_data.empty?
|
@@ -156,8 +158,7 @@ module CombinePDF
|
|
156
158
|
catalog = rebuild_catalog
|
157
159
|
page_objects = catalog[:Pages][:referenced_object][:Kids].map { |e| @objects << e[:referenced_object]; e[:referenced_object] }
|
158
160
|
# adds every referenced object to the @objects (root), addition is performed as pointers rather then copies
|
159
|
-
|
160
|
-
add_referenced(@objects.dup)
|
161
|
+
add_referenced()
|
161
162
|
catalog
|
162
163
|
end
|
163
164
|
|
@@ -345,6 +346,7 @@ module CombinePDF
|
|
345
346
|
|
346
347
|
def equal_layers obj1, obj2, layer = 3
|
347
348
|
return true if(layer == 0)
|
349
|
+
return true if obj1.object_id == obj2.object_id
|
348
350
|
if obj1.is_a? Hash
|
349
351
|
return false unless obj2.is_a? Hash
|
350
352
|
keys = obj1.keys;
|
data/lib/combine_pdf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: combine_pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-rc4
|