combine_pdf 0.2.35 → 0.2.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +64 -57
- data/lib/combine_pdf/pdf_protected.rb +7 -3
- data/lib/combine_pdf/version.rb +1 -1
- data/test/automated +5 -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: 24cff4ff99e59aebbf23e9152c38d16d43d5ef02
|
4
|
+
data.tar.gz: 346ebee7f019ec072d5aa794fa4c9329a831ecbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c7858197bb0e1da9f3467c602580a0d8d10e6f19156ac8d43b3a1b22f93d004d4fb6b7bc7074847e1b82ffdcd540848911b196b0fefb35b7ba17427bea5ddd3
|
7
|
+
data.tar.gz: cf7a0d9e5e77a6e94815de3fdc3e7cf29c82ee1e33dfc832351c1784a4a44c33c40cf729d55aea184371563a839baf8b067b634bce2a4361af2abc61c55c4344
|
data/CHANGELOG.md
CHANGED
@@ -1,23 +1,30 @@
|
|
1
|
-
#Change Log
|
1
|
+
# Change Log
|
2
2
|
|
3
3
|
***
|
4
4
|
|
5
|
-
Change log v.0.2.
|
5
|
+
#### Change log v.0.2.36 (Release Candidate)
|
6
6
|
|
7
|
-
**
|
7
|
+
**Fix**: Fix for [issue #104](https://github.com/boazsegev/combine_pdf/issues/104). Credit to @tomascharad for exposing the issue.
|
8
8
|
|
9
9
|
**Release**: This gem had been using a development versioning scheme for far too long. The API is stable enough to switch to a production versioning scheme. This version is expected to be the last 0.x version. Assuming this version will be stable enough, it is expected to be re-released as v.1.0.
|
10
10
|
|
11
11
|
|
12
12
|
***
|
13
13
|
|
14
|
-
Change log v.0.2.
|
14
|
+
#### Change log v.0.2.35
|
15
|
+
|
16
|
+
**Update**: Updated / upgraded our RC4 and AES PDF encryption support (for non-password protected PDFs). Credit to Gyuchang Jun (@gyuchang) for his work on providing CombinePDF with this extra encryption support. I have no idea what magic he used to make this happen, but it's beautiful!
|
17
|
+
|
18
|
+
|
19
|
+
***
|
20
|
+
|
21
|
+
#### Change log v.0.2.34
|
15
22
|
|
16
|
-
**Fix**: issue #44 for wkhtmltopdf compatibility and PDF v.1.2 use of named destinations. Credit to Devin Wadsworth (@daymun) for exposing the issue.
|
23
|
+
**Fix**: [fixed issue #44 for wkhtmltopdf compatibility](https://github.com/boazsegev/combine_pdf/issues/44) and PDF v.1.2 use of named destinations. Credit to Devin Wadsworth (@daymun) for exposing the issue.
|
17
24
|
|
18
25
|
***
|
19
26
|
|
20
|
-
Change log v.0.2.33
|
27
|
+
#### Change log v.0.2.33
|
21
28
|
|
22
29
|
**Update**: Fix #97 to allow javascript support for interactive objects. Credit to @joshirashmics for exposing the issue.
|
23
30
|
|
@@ -27,7 +34,7 @@ Change log v.0.2.33
|
|
27
34
|
|
28
35
|
***
|
29
36
|
|
30
|
-
Change log v.0.2.32
|
37
|
+
#### Change log v.0.2.32
|
31
38
|
|
32
39
|
**Update**: Better errors when encryption related exceptions occur. Credit to Paul Shumeika ( @pshumeika ).
|
33
40
|
|
@@ -35,7 +42,7 @@ Change log v.0.2.32
|
|
35
42
|
|
36
43
|
***
|
37
44
|
|
38
|
-
Change log v.0.2.31
|
45
|
+
#### Change log v.0.2.31
|
39
46
|
|
40
47
|
**Broke**: Broke the fix for issue #65 so that Radio buttons data might be lost... working on a fix.
|
41
48
|
|
@@ -47,25 +54,25 @@ Change log v.0.2.31
|
|
47
54
|
|
48
55
|
***
|
49
56
|
|
50
|
-
Change log v.0.2.30
|
57
|
+
#### Change log v.0.2.30
|
51
58
|
|
52
59
|
**Fix**: Fixed an issue where HTTP artifacts before the beginning of a PDF file / string would prevent the PDF from being parsed. This should fix issue #78 reported by @robvitaro.
|
53
60
|
|
54
61
|
***
|
55
62
|
|
56
|
-
Change log v.0.2.29
|
63
|
+
#### Change log v.0.2.29
|
57
64
|
|
58
65
|
**Fix**: Fixed an issue where updating a page's rotation might raise a `NoMethodError` exception. Credit to Danny (@dikond) both for discovering the issue and for PR #77 that fixes this.
|
59
66
|
|
60
67
|
***
|
61
68
|
|
62
|
-
Change log v.0.2.28
|
69
|
+
#### Change log v.0.2.28
|
63
70
|
|
64
71
|
**Fix**: Fixed an issue related to page stumping, which was introduced when the Rubocop beautification changed the logic of an `if` statement in the Resource merger. Credit to Leon Miller-Out (@sbleon) for noticing the issue, testing and opening PR #76.
|
65
72
|
|
66
73
|
***
|
67
74
|
|
68
|
-
Change log v.0.2.27
|
75
|
+
#### Change log v.0.2.27
|
69
76
|
|
70
77
|
**Fix**: Fixed an issue where a `nil` outline count would cause PDF merger to fail.
|
71
78
|
|
@@ -75,19 +82,19 @@ Change log v.0.2.27
|
|
75
82
|
|
76
83
|
***
|
77
84
|
|
78
|
-
Change log v.0.2.26
|
85
|
+
#### Change log v.0.2.26
|
79
86
|
|
80
87
|
**Fix**: Merged PR #72, fixing a typo in the parser that caused incorrect byte substitution to corrupt certain PDF data (adversely effecting encrypted PDFs). Credit to Gyuchang Jun (@gyuchang) for the fix.
|
81
88
|
|
82
89
|
***
|
83
90
|
|
84
|
-
Change log v.0.2.25
|
91
|
+
#### Change log v.0.2.25
|
85
92
|
|
86
93
|
**Fix**: Fixed issue #71, merging PDF outline that exist but have 0 entries fails and raises an exception. Credit to @Kagetsuki for exposing the issue.
|
87
94
|
|
88
95
|
***
|
89
96
|
|
90
|
-
Change log v.0.2.24
|
97
|
+
#### Change log v.0.2.24
|
91
98
|
|
92
99
|
**Fix**: Fixed an issue with PDF Catalog and PDF Page property inheritance that could cause corrupted PDF output (invalid PDF data). Credit to @Kagetsuki for opening an issue that let to this discovery.
|
93
100
|
|
@@ -97,13 +104,13 @@ Change log v.0.2.24
|
|
97
104
|
|
98
105
|
***
|
99
106
|
|
100
|
-
Change log v.0.2.23
|
107
|
+
#### Change log v.0.2.23
|
101
108
|
|
102
109
|
**Fix**: fixed an issue introduced in v.0.2.22, where name dictionary conflict resolution would result in corrupted PDF files. The issue was caused because the name conflict resolution wasn't updated to handle the changes in the new reference linking algorithm used by the parser. During this fix, the whole name dictionary algorithm was re-written, providing better support for named destinations, links and (future feature) ToCs. Credit to Kevin Shen (@kevshin2) for exposing the issue.
|
103
110
|
|
104
111
|
***
|
105
112
|
|
106
|
-
Change log v.0.2.22 (yanked)
|
113
|
+
#### Change log v.0.2.22 (yanked)
|
107
114
|
|
108
115
|
**Fix**: fixed an issue with PDF font importing (registering).
|
109
116
|
|
@@ -119,55 +126,55 @@ Change log v.0.2.22 (yanked)
|
|
119
126
|
|
120
127
|
***
|
121
128
|
|
122
|
-
Change log v.0.2.21
|
129
|
+
#### Change log v.0.2.21
|
123
130
|
|
124
131
|
**Fix**: fix for issue #54 and #59 (duplicate), discovered by @iggant (Anton Kolodii), related to name conflict resolution and page resources. The issue would cause and error (exception) to occur when attempting to merge pages with specific resource structures. Credit to @cw6365 (Chris Ward) and @DenKey (Den) as well.
|
125
132
|
|
126
133
|
***
|
127
134
|
|
128
|
-
Change log v.0.2.20
|
135
|
+
#### Change log v.0.2.20
|
129
136
|
|
130
137
|
**Fix**: fix for issue #56, discovered by @LeptonHeavy, regarding errors caused by the new PDF form support feature.
|
131
138
|
|
132
139
|
***
|
133
140
|
|
134
|
-
Change log v.0.2.19 (yanked)
|
141
|
+
#### Change log v.0.2.19 (yanked)
|
135
142
|
|
136
143
|
**Partial fix**: unconfirmed fix for issue #56, discovered by @LeptonHeavy, regarding errors caused by the new PDF form support feature.
|
137
144
|
|
138
145
|
***
|
139
146
|
|
140
|
-
Change log v.0.2.18 (yanked)
|
147
|
+
#### Change log v.0.2.18 (yanked)
|
141
148
|
|
142
149
|
**Feature**: added minor (read: initial and incomplete) PDF forms support, in an attempt to preserve form data when combining PDF files.
|
143
150
|
|
144
151
|
***
|
145
152
|
|
146
|
-
Change log v.0.2.17
|
153
|
+
#### Change log v.0.2.17
|
147
154
|
|
148
155
|
**Feature**: added the `page#crop` method to easily crop a PDF file in accordance with the GWG industry association recommendations (updating the `MediaBox` property rather then the `CropBox`). Credit to @wingleungchoi for this feature.
|
149
156
|
|
150
157
|
***
|
151
158
|
|
152
|
-
Change log v.0.2.16
|
159
|
+
#### Change log v.0.2.16
|
153
160
|
|
154
161
|
**Fix**: Fix for issue #49 where specific PDF files containing junk data after the %%EOF marker couldn't be opened (as they were invalid files). The issue was fixed by scanning any trailing data before continuing to parse any PDF file beyond the first %%EOF markers (multiple markers are common when using the PDF format). Credit to @wingleungchoi for providing an example for the issue.
|
155
162
|
|
156
163
|
***
|
157
164
|
|
158
|
-
Change log v.0.2.15
|
165
|
+
#### Change log v.0.2.15
|
159
166
|
|
160
167
|
**Fix**: Fix for issue #22 where specific PDF files with nested references could cause page stamping to fail, raising an exception. Credit to @tomascharad for finding the issue.
|
161
168
|
|
162
169
|
***
|
163
170
|
|
164
|
-
Change log v.0.2.14
|
171
|
+
#### Change log v.0.2.14
|
165
172
|
|
166
173
|
**Fix**: Fix for issue #39, where certain comments could have caused the object after the comments to be ignored, resulting in parsing errors. Credit to @lgn21st for identifying the issue.
|
167
174
|
|
168
175
|
***
|
169
176
|
|
170
|
-
Change log v.0.2.13
|
177
|
+
#### Change log v.0.2.13
|
171
178
|
|
172
179
|
**Fix** fixed issue # 37 reported by @sega (thank you for reporting!), regarding the insability to stamp one PDF page over another when one PDF page used a resource directory propegated with data and another page used a resource directory propegated with references. This was now resolved by checking for references before merging the data.
|
173
180
|
|
@@ -177,31 +184,31 @@ Change log v.0.2.13
|
|
177
184
|
|
178
185
|
***
|
179
186
|
|
180
|
-
Change log v.0.2.12
|
187
|
+
#### Change log v.0.2.12
|
181
188
|
|
182
189
|
**Compatability**: fixed issue #36 reported by @vitstradal (thank you for reporting!) regarding PDF files composed by PaperPort. PaperPort (at least version 12) has an issue where PDF data will be placed within a PDF comment. PDF comments start with a "%" sign and end with an EOL marker ("\r" or "\n"). PaperPort ommitted the EOL marker, placing critical data within the comment. A work-around was found by parsing the comment's data and attempting to salvage the misplaced data. This workaround assumes that comments would not contain PDF parsable data at the very end of the comment's line... which is an unsafe assumption. hence, **please let me know if you find _any_ PDF files that worked before the workaround was introduced**.
|
183
190
|
|
184
191
|
***
|
185
192
|
|
186
|
-
Change log v.0.2.11
|
193
|
+
#### Change log v.0.2.11
|
187
194
|
|
188
195
|
**Fix**: fix for issue #35 , which was caused by the broken fix for issue #34. Credit to Davek Rupinski for pointing out the issue.
|
189
196
|
|
190
197
|
***
|
191
198
|
|
192
|
-
Change log v.0.2.10
|
199
|
+
#### Change log v.0.2.10
|
193
200
|
|
194
201
|
**Fix**: fixed page stamping when the page's content was a referenced object instead or a direct array of content references. Credit to vitstradal for discovering the issue.
|
195
202
|
|
196
203
|
***
|
197
204
|
|
198
|
-
Change log v.0.2.9
|
205
|
+
#### Change log v.0.2.9
|
199
206
|
|
200
207
|
**Fix** hopefully fixed issue #33 ([NoMethodError undefined method `[]` for nil:NilClass](https://github.com/boazsegev/combine_pdf/issues/33)).
|
201
208
|
|
202
209
|
***
|
203
210
|
|
204
|
-
Change log v.0.2.8
|
211
|
+
#### Change log v.0.2.8
|
205
212
|
|
206
213
|
* **Fix/Feature**: (related to [issue #32](https://github.com/boazsegev/combine_pdf/issues/32))
|
207
214
|
|
@@ -215,7 +222,7 @@ Change log v.0.2.8
|
|
215
222
|
|
216
223
|
***
|
217
224
|
|
218
|
-
Change log v.0.2.7
|
225
|
+
#### Change log v.0.2.7
|
219
226
|
|
220
227
|
**Fix**: Fixed an issue where a malformed PDF String could cause the parser to hang.
|
221
228
|
|
@@ -225,7 +232,7 @@ Change log v.0.2.7
|
|
225
232
|
|
226
233
|
***
|
227
234
|
|
228
|
-
Change log v.0.2.6
|
235
|
+
#### Change log v.0.2.6
|
229
236
|
|
230
237
|
**fixed**: Hasan Iskandar fixed issue #30 - Output file cannot be saved from Adobe Reader with "Save As optimizes for Fast Web View" preference enabled. Thank you Hasan.
|
231
238
|
|
@@ -233,7 +240,7 @@ Change log v.0.2.6
|
|
233
240
|
|
234
241
|
***
|
235
242
|
|
236
|
-
Change log v.0.2.5
|
243
|
+
#### Change log v.0.2.5
|
237
244
|
|
238
245
|
**feature**: circumvents an issue with 'wkhtmltopdf', where sometimes the `endobj` keyword would be missing, causing malformed PDF data. The parser will now attempt to auto-fix any `endobj` missing keywords.
|
239
246
|
|
@@ -241,7 +248,7 @@ Change log v.0.2.5
|
|
241
248
|
|
242
249
|
***
|
243
250
|
|
244
|
-
Change log v.0.2.4
|
251
|
+
#### Change log v.0.2.4
|
245
252
|
|
246
253
|
**fixed**: Fixed the default page sizes which weren't as described in the documentation and now default to US Letter. The documentation was also fixed. No major version bump is declered since the defaults were faulty and weren't as described (fixed a bug, not changed the API).
|
247
254
|
|
@@ -249,7 +256,7 @@ Change log v.0.2.4
|
|
249
256
|
|
250
257
|
***
|
251
258
|
|
252
|
-
Change log v.0.2.3
|
259
|
+
#### Change log v.0.2.3
|
253
260
|
|
254
261
|
**update**: a better general error message for CombinePDF.new
|
255
262
|
|
@@ -261,7 +268,7 @@ Change log v.0.2.3
|
|
261
268
|
|
262
269
|
***
|
263
270
|
|
264
|
-
Change log v.0.2.2
|
271
|
+
#### Change log v.0.2.2
|
265
272
|
|
266
273
|
**fix**: fixed the default value for the :location attribute of PDF#stamp_pages(String, options). Now, instead of the default stamp being written at [:top, :bottom], it's default location will be set to [:center].
|
267
274
|
|
@@ -269,7 +276,7 @@ Change log v.0.2.2
|
|
269
276
|
|
270
277
|
***
|
271
278
|
|
272
|
-
Change log v.0.2.1
|
279
|
+
#### Change log v.0.2.1
|
273
280
|
|
274
281
|
**fix**: better page stamping... or, at least more secure (we hope).
|
275
282
|
|
@@ -281,7 +288,7 @@ Change log v.0.2.1
|
|
281
288
|
|
282
289
|
***
|
283
290
|
|
284
|
-
Change log v.0.2.0
|
291
|
+
#### Change log v.0.2.0
|
285
292
|
|
286
293
|
Refractoring of code and API overhall.
|
287
294
|
|
@@ -293,31 +300,31 @@ Any code relying on inner/advanced API calls might be broken.
|
|
293
300
|
|
294
301
|
***
|
295
302
|
|
296
|
-
Change log v.0.1.23
|
303
|
+
#### Change log v.0.1.23
|
297
304
|
|
298
305
|
**fix**: @kruszczynski fixed an issue with CombinePDF::PDF#number_pages where the page numbering margines were ignored and only the default values were used. Thank you @kruszczynski .
|
299
306
|
|
300
307
|
***
|
301
308
|
|
302
|
-
Change log v.0.1.22
|
309
|
+
#### Change log v.0.1.22
|
303
310
|
|
304
311
|
**fix**: a tested fix for issue #19, where Acrobat Reader would raise an error if page objects in the Catalog were copied by reference instead of copied in full and each was assigned different a unique object id. (possibly an Acrobat Reader Issue workaround) The issue was resolved by exempting page objects from the duplication reduction algorithm, and in this way, forcing duplicates to be copied rather then referenced in the Catalog object.
|
305
312
|
|
306
313
|
***
|
307
314
|
|
308
|
-
Change log v.0.1.21
|
315
|
+
#### Change log v.0.1.21
|
309
316
|
|
310
317
|
**fix**: an attempted fix for issue #19, where the xref table wasn't read on Acrobat Reader, probably due to a double EOL marker at the end of each entry.
|
311
318
|
|
312
319
|
***
|
313
320
|
|
314
|
-
Change log v.0.1.20
|
321
|
+
#### Change log v.0.1.20
|
315
322
|
|
316
323
|
**fix**: due to some PDF files not conforming to the required EOL marker in the endstream object specifications, the parser is now back to a non-strict parsing mode for PDF Stream Objects. Conforming files weren't found to be effected and although it is unlikely, it is possible that they might be effected if the stream object would contain the 'endstream' keyword without the required EOL marker and without intending to end the stream object.
|
317
324
|
|
318
325
|
***
|
319
326
|
|
320
|
-
Change log v.0.1.19
|
327
|
+
#### Change log v.0.1.19
|
321
328
|
|
322
329
|
**fix**: merged @espinosa's fix for issue #16 which affected windows machines.
|
323
330
|
|
@@ -327,13 +334,13 @@ Change log v.0.1.19
|
|
327
334
|
|
328
335
|
***
|
329
336
|
|
330
|
-
Change log v.0.1.18
|
337
|
+
#### Change log v.0.1.18
|
331
338
|
|
332
339
|
**fix**: Thank to Stefan, who reported issue #15 , we discovered that in some cases PDF files presented the wrong PDF standard version, causing an error while attempting to parse their data. The issue has been fixed by allowing the parser to search for PDF Object Streams even when the PDF file claims a PDF version below 1.5.
|
333
340
|
|
334
341
|
***
|
335
342
|
|
336
|
-
Change log v.0.1.17
|
343
|
+
#### Change log v.0.1.17
|
337
344
|
|
338
345
|
**feature**: Although it was possible to create and add empty PDF pages (at any location), it is now even easier with one method call to add empty pages at the end of a PDF object. It's also possible to add text to these empty pages or stamp them with different content.
|
339
346
|
|
@@ -343,19 +350,19 @@ Change log v.0.1.17
|
|
343
350
|
|
344
351
|
***
|
345
352
|
|
346
|
-
Change log v.0.1.16
|
353
|
+
#### Change log v.0.1.16
|
347
354
|
|
348
355
|
**fix?**: Compatability reports came in showing that some email servers convery new-line (\n) characters to CRLF (\r\n) - corrupting the binary code in the PDF files. This version attemps to fix this by adding more binary characters to the first comment line of the PDF file (right after the header). Most email programs and Antivirus programs should preserve the original EOL character once they recognize the file as binary.
|
349
356
|
|
350
357
|
***
|
351
358
|
|
352
|
-
Change log v.0.1.15
|
359
|
+
#### Change log v.0.1.15
|
353
360
|
|
354
361
|
**features**: added new PDF#Page API to deal with page rotation and orientation. see the docs for more info.
|
355
362
|
|
356
363
|
***
|
357
364
|
|
358
|
-
Change log v.0.1.14
|
365
|
+
#### Change log v.0.1.14
|
359
366
|
|
360
367
|
**changes**: changed the way the PDF Page objects are 'injected' with their methods, so that the PDF#pages method is faster and more methods can be injected into the Hash object. For instance, textbox can now be called on an existing page without creating a PDFWriter object and 'stumping' the new data.
|
361
368
|
|
@@ -363,20 +370,20 @@ Change log v.0.1.14
|
|
363
370
|
|
364
371
|
***
|
365
372
|
|
366
|
-
Change log v.0.1.13
|
373
|
+
#### Change log v.0.1.13
|
367
374
|
|
368
375
|
**fix**: fix for Acrobat Reader compatablity (by removing color-space declarations). Should solve issue #13 , reported originaly by Imanol and Diyei Gomi.
|
369
376
|
|
370
377
|
***
|
371
378
|
|
372
|
-
Change log v.0.1.12
|
379
|
+
#### Change log v.0.1.12
|
373
380
|
|
374
381
|
**fix**: fix for page rotation inheritance.
|
375
382
|
|
376
383
|
**fix**: fix for the issue was discovered while observing issue #13, reported originaly by Imanol and Diyei Gomi. 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).
|
377
384
|
***
|
378
385
|
|
379
|
-
Change log v.0.1.11
|
386
|
+
#### Change log v.0.1.11
|
380
387
|
|
381
388
|
**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).
|
382
389
|
|
@@ -384,31 +391,31 @@ Change log v.0.1.11
|
|
384
391
|
|
385
392
|
***
|
386
393
|
|
387
|
-
Change log v.0.1.10
|
394
|
+
#### Change log v.0.1.10
|
388
395
|
|
389
396
|
**fix**: fixed a typo that prevented access to the CombinePDF::VERSION constant.
|
390
397
|
|
391
398
|
***
|
392
399
|
|
393
|
-
Change log v.0.1.9
|
400
|
+
#### Change log v.0.1.9
|
394
401
|
|
395
402
|
**fix**: possible fix for bug reported by lamphuongha, regarding PDF 1.5 streams. I await confirmation that the fix actually works, as I cannot seem to reproduce the whole spectrum of the bug on my system...
|
396
403
|
|
397
404
|
***
|
398
405
|
|
399
|
-
Change log v.0.1.8
|
406
|
+
#### Change log v.0.1.8
|
400
407
|
|
401
408
|
**fix**: Fixed an [issue reported by Saba](https://github.com/boazsegev/combine_pdf/issues/8), where PDF files that were written using bad practices (namely, without wrapping their content streams correctly) would not be stamped correctly due to changes in the space matrix (CTM). Fixed by wrapping all existing streams before stamping.
|
402
409
|
|
403
410
|
***
|
404
411
|
|
405
|
-
Change log v.0.1.7
|
412
|
+
#### Change log v.0.1.7
|
406
413
|
|
407
414
|
**fix**: PDF `insert` had a typo in the code that would cause failure when unsupported object insertion was attempted - fixed by Nathan Keyes (nkeyes).
|
408
415
|
|
409
416
|
***
|
410
417
|
|
411
|
-
Change log v.0.1.6
|
418
|
+
#### Change log v.0.1.6
|
412
419
|
|
413
420
|
**fix**: added Mutex to font library (which was shared by all PDFWriter objects) - now fonts are thread safe (PDF objects are NOT thread safe by design).
|
414
421
|
|
@@ -221,14 +221,18 @@ module CombinePDF
|
|
221
221
|
end
|
222
222
|
|
223
223
|
# @private
|
224
|
-
# this method reviews a Hash
|
224
|
+
# this method reviews a Hash and updates it by merging Hash data,
|
225
225
|
# preffering the new over the old.
|
226
226
|
def self.hash_merge_new_no_page(_key, old_data, new_data)
|
227
|
-
|
228
|
-
|
227
|
+
return old_data unless new_data
|
228
|
+
if old_data.is_a?(Hash) && new_data.is_a?(Hash)
|
229
|
+
return old_data if (old_data[:Type] == :Page)
|
229
230
|
old_data.merge(new_data, &(@hash_merge_new_no_page_proc ||= method(:hash_merge_new_no_page)))
|
230
231
|
elsif old_data.is_a? Array
|
232
|
+
new_data = [new_data] unless new_data.is_a? Array
|
231
233
|
old_data + new_data
|
234
|
+
elsif new_data.is_a? Array
|
235
|
+
new_data + [old_data]
|
232
236
|
else
|
233
237
|
new_data
|
234
238
|
end
|
data/lib/combine_pdf/version.rb
CHANGED
data/test/automated
CHANGED
@@ -24,6 +24,11 @@ i = 0
|
|
24
24
|
pdf.pages.each { |pg| pg << pdf2.pages[i] }
|
25
25
|
pdf.save '03_check_font_conflict.pdf'
|
26
26
|
|
27
|
+
pdf = CombinePDF.load './Ruby/test pdfs/nil_1.pdf'
|
28
|
+
pdf2 = CombinePDF.load './Ruby/test pdfs/nil_2.pdf'
|
29
|
+
pdf << pdf2
|
30
|
+
pdf.save '03_01_nil_value_conflict.pdf'
|
31
|
+
|
27
32
|
pdf = CombinePDF.load './Ruby/test pdfs/names_go_haywire_0.pdf'
|
28
33
|
pdf << CombinePDF.load('./Ruby/test pdfs/names_go_haywire_1.pdf')
|
29
34
|
pdf.save '04_check_view_and_names_reference.pdf'
|
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.2.
|
4
|
+
version: 0.2.36
|
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-03-
|
11
|
+
date: 2017-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-rc4
|