pdf_writing_tools 0.0.18 → 0.0.19
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/lib/pdf_writing_tools.rb +27 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c9eda846aa608aa060dfcdf248785641d8157fd11a6854ca7bb28190ecff249
|
4
|
+
data.tar.gz: '09d6d26696ae73858b17c6cd41a5b228e021f661d9d8d6c8182be07b0dbe3ea9'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b3ee0196bc304ad36c7b4c08af7083b6a9b92a786b3f1a5dd500dae85278362c875822fdddb13950d232d3ba2af35794bb4491b9cdf83deb732736f523912ba
|
7
|
+
data.tar.gz: 3f315a5b62258ebdb244d4b7da40135047932a5626ec2401ddcf5bb4b24e5ad74b5104fdba7909498695e2681743cd65f27792526ebbd9b3c636ff75987a9379
|
data/lib/pdf_writing_tools.rb
CHANGED
@@ -263,6 +263,8 @@ module PdfWritingTools
|
|
263
263
|
|
264
264
|
new_y = pdf_margin_top
|
265
265
|
|
266
|
+
overflowed = false
|
267
|
+
|
266
268
|
loop do
|
267
269
|
max_cell_height = 0
|
268
270
|
|
@@ -298,6 +300,11 @@ module PdfWritingTools
|
|
298
300
|
|
299
301
|
r = draw_cell_auto_height(pdf, draw_simulation = true, x+offset, y, width, texts[i], cell_opts, auto_y)
|
300
302
|
|
303
|
+
if r[:overflow] && r[:overflow] == ""
|
304
|
+
overflowed = true
|
305
|
+
end
|
306
|
+
|
307
|
+
|
301
308
|
if r[:height] > max_cell_height
|
302
309
|
max_cell_height = r[:height]
|
303
310
|
end
|
@@ -308,9 +315,16 @@ module PdfWritingTools
|
|
308
315
|
# Non voglio che la riga ecceda il margine di pagina, quindi se così fosse
|
309
316
|
# ricalcolo l'altezza di riga per non superare tale margine
|
310
317
|
if y + max_cell_height > pdf_height - pdf_margin_bottom
|
311
|
-
|
318
|
+
overflowed = true
|
319
|
+
#max_cell_height = pdf_height - pdf_margin_bottom - y
|
312
320
|
end
|
313
321
|
|
322
|
+
|
323
|
+
if overflowed
|
324
|
+
pdf.start_new_page
|
325
|
+
y = pdf_margin_top # Posiziono il cursore ad inizio della nuova pagina
|
326
|
+
end
|
327
|
+
|
314
328
|
# A seguito della simulazione, ho ottenuto l'altezza di riga...
|
315
329
|
# ... ora passo al disegno vero e proprie delle celle...
|
316
330
|
offset = 0
|
@@ -353,16 +367,18 @@ module PdfWritingTools
|
|
353
367
|
|
354
368
|
texts = rtexts
|
355
369
|
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
370
|
+
if false
|
371
|
+
# Se nei testi residui, sono presenti solo stringhe vuote, posso uscire dal
|
372
|
+
# loop, altrimenti, devo cambiare pagina e disegnare una nuova riga con i
|
373
|
+
# testi rimanenti
|
374
|
+
if !check_no_empty_string_presence(texts)
|
375
|
+
new_y = y + max_cell_height
|
376
|
+
break
|
377
|
+
else
|
378
|
+
pdf.start_new_page
|
379
|
+
y = pdf_margin_top # Posiziono il cursore ad inizio della nuova pagina
|
380
|
+
end
|
381
|
+
end
|
366
382
|
end
|
367
383
|
|
368
384
|
pdf.y = (pdf_height - new_y)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdf_writing_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JSalvo1978
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Plugin for write pdf in a simplified manner, using prawn as backend
|
14
14
|
email:
|