combine_pdf 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/combine_pdf/combine_pdf_parser.rb +1 -1
- data/lib/combine_pdf/combine_pdf_pdf.rb +12 -3
- 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: 882c3cbaa5d88da789bcaea83b70092ed318b566
|
4
|
+
data.tar.gz: 0670e7d2bb00e7b348cae105ff4f0b3a9f9327e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 665ace02cacbc19a0fc3b782ac0e21e87d63bfab9a59ae74340ed57e833cda0f7d0ebfb7163772621ff74691f8e7a3b4a10d62fa7a04ad514160eaa462909e26
|
7
|
+
data.tar.gz: 6891d293f8a2ebab0f84cfb7e99dd7578b3ff14f7971d63c3dabde41bff4aa1007bc44deb394611b9eb62a89ea534d8d35e9e7283891273bd6d41a5e8489deae
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
***
|
4
4
|
|
5
|
+
Change log v.0.1.12
|
6
|
+
|
7
|
+
**fix**: fix for page rotation inheritance.
|
8
|
+
|
9
|
+
**fix**: fix for the issue reported by Diyei Gomi that showed how certain PDF files, when stamped one on top of the other, can result in a malformed PDF being Rendered. The issue was probably caused by parsing errors introduced while parsing hex strings (a case sensitive method was used by mistake and this is now corrected). This release contains a patch, but it is yet unknown if the issue is fully fxed.
|
10
|
+
|
11
|
+
***
|
12
|
+
|
5
13
|
Change log v.0.1.11
|
6
14
|
|
7
15
|
**fix**: fixed a bug where Page Resources and ColorSpace data wouldn't be inherited correctly from the Catalog and Pages parent objects. This issue could cause pages to render without all their content intact. This issue is now fixed (although more testing should be done for multiple inheritance).
|
@@ -176,7 +176,7 @@ module CombinePDF
|
|
176
176
|
##########################################
|
177
177
|
## parse a Hex String
|
178
178
|
##########################################
|
179
|
-
when str = @scanner.scan(/<[0-9a-
|
179
|
+
when str = @scanner.scan(/<[0-9a-fA-F]+>/)
|
180
180
|
# warn "Found a hex string"
|
181
181
|
out << [str[1..-2]].pack('H*')
|
182
182
|
##########################################
|
@@ -216,9 +216,16 @@ module CombinePDF
|
|
216
216
|
end
|
217
217
|
else
|
218
218
|
unless catalogs[:Type] == :Page
|
219
|
-
# set inheritance, when applicable
|
219
|
+
# # set inheritance, when applicable, and delete older data
|
220
|
+
# inheritance_hash[:MediaBox] = catalogs.delete(:MediaBox) if catalogs[:MediaBox]
|
221
|
+
# inheritance_hash[:CropBox] = catalogs.delete(:CropBox) if catalogs[:CropBox]
|
222
|
+
# inheritance_hash[:Rotate] = catalogs.delete(:Rotate) if catalogs[:Rotate]
|
223
|
+
# (inheritance_hash[:Resources] ||= {}).update( ( catalogs[:Resources][:referenced_object] ? catalogs.delete(:Resources)[:referenced_object] : catalogs.delete(:Resources) ), &self.class.method(:hash_update_proc_for_new) ) if catalogs[:Resources]
|
224
|
+
# (inheritance_hash[:ColorSpace] ||= {}).update( ( catalogs[:ColorSpace][:referenced_object] ? catalogs.delete(:ColorSpace)[:referenced_object] : catalogs.delete(:ColorSpace) ), &self.class.method(:hash_update_proc_for_new) ) if catalogs[:ColorSpace]
|
225
|
+
# old - set inheritance, when applicable
|
220
226
|
inheritance_hash[:MediaBox] = catalogs[:MediaBox] if catalogs[:MediaBox]
|
221
227
|
inheritance_hash[:CropBox] = catalogs[:CropBox] if catalogs[:CropBox]
|
228
|
+
inheritance_hash[:Rotate] = catalogs[:Rotate] if catalogs[:Rotate]
|
222
229
|
(inheritance_hash[:Resources] ||= {}).update( (catalogs[:Resources][:referenced_object] || catalogs[:Resources]), &self.class.method(:hash_update_proc_for_new) ) if catalogs[:Resources]
|
223
230
|
(inheritance_hash[:ColorSpace] ||= {}).update( (catalogs[:ColorSpace][:referenced_object] || catalogs[:ColorSpace]), &self.class.method(:hash_update_proc_for_new) ) if catalogs[:ColorSpace]
|
224
231
|
end
|
@@ -245,13 +252,15 @@ module CombinePDF
|
|
245
252
|
# inheritance
|
246
253
|
catalogs[:MediaBox] ||= inheritance_hash[:MediaBox] if inheritance_hash[:MediaBox]
|
247
254
|
catalogs[:CropBox] ||= inheritance_hash[:CropBox] if inheritance_hash[:CropBox]
|
255
|
+
catalogs[:Rotate] ||= inheritance_hash[:Rotate] if inheritance_hash[:Rotate]
|
248
256
|
(catalogs[:Resources] ||= {}).update( inheritance_hash[:Resources], &( self.class.method(:hash_update_proc_for_old) ) ) if inheritance_hash[:Resources]
|
249
257
|
(catalogs[:ColorSpace] ||= {}).update( inheritance_hash[:ColorSpace], &( self.class.method(:hash_update_proc_for_old) ) ) if inheritance_hash[:ColorSpace]
|
250
258
|
|
251
259
|
|
252
|
-
# avoide references on MediaBox and
|
260
|
+
# avoide references on MediaBox, CropBox and Rotate
|
253
261
|
catalogs[:MediaBox] = catalogs[:MediaBox][:referenced_object][:indirect_without_dictionary] if catalogs[:MediaBox].is_a?(Hash) && catalogs[:MediaBox][:referenced_object].is_a?(Hash) && catalogs[:MediaBox][:referenced_object][:indirect_without_dictionary]
|
254
262
|
catalogs[:CropBox] = catalogs[:CropBox][:referenced_object][:indirect_without_dictionary] if catalogs[:CropBox].is_a?(Hash) && catalogs[:CropBox][:referenced_object].is_a?(Hash) && catalogs[:CropBox][:referenced_object][:indirect_without_dictionary]
|
263
|
+
catalogs[:Rotate] = catalogs[:Rotate][:referenced_object][:indirect_without_dictionary] if catalogs[:Rotate].is_a?(Hash) && catalogs[:Rotate][:referenced_object].is_a?(Hash) && catalogs[:Rotate][:referenced_object][:indirect_without_dictionary]
|
255
264
|
|
256
265
|
page_list << catalogs
|
257
266
|
when :Pages
|
@@ -375,7 +384,7 @@ module CombinePDF
|
|
375
384
|
# - :start_at a Fixnum that sets the number for first page number. also accepts a letter ("a") for letter numbering. defaults to 1.
|
376
385
|
# - :margin_from_height a number (PDF points) for the top and buttom margins. defaults to 45.
|
377
386
|
# - :margin_from_side a number (PDF points) for the left and right margins. defaults to 15.
|
378
|
-
# the options Hash can also take all the options for PDFWriter
|
387
|
+
# the options Hash can also take all the options for PDFWriter#textbox.
|
379
388
|
# defaults to font: :Helvetica, font_size: 12 and no box (:border_width => 0, :box_color => nil).
|
380
389
|
def number_pages(options = {})
|
381
390
|
opt = {
|
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: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-rc4
|