documents_with_footer_to_pdf 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +8 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +8 -8
- data/README.md +111 -111
- data/lib/documents_with_footer_to_pdf/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a89fdfade0679a15c4c35d7717406f5f7e66843d296f31807b15e4a36ddb0b0f
|
4
|
+
data.tar.gz: bd4b43bb3c31ddc7b2fba5106f78adcd02e02a516ba00b06a1f20efc70aa2de4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8497f3f19dfbb904581e6e563122816fc76641ec90990431d14b1545f6c74c43a5bc7f9439c84a71d49d43d4191dede8c2027f47e80272cecddf10bdae250e3
|
7
|
+
data.tar.gz: e4acde7089ac9d74352f907209cfe0196ab9676fe05d44562b7802096f0390cfcd9db14e65ded998afed1315d981adaffc100fbc919d395608c5f77e9857c5f6
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -3,7 +3,7 @@ PATH
|
|
3
3
|
specs:
|
4
4
|
documents_with_footer_to_pdf (0.1.2)
|
5
5
|
combine_pdf (~> 1.0.21)
|
6
|
-
fileutils
|
6
|
+
fileutils (~> 1.5.0)
|
7
7
|
local_path_builder (~> 0.1.1)
|
8
8
|
prawn (~> 2.4.0)
|
9
9
|
|
@@ -16,32 +16,32 @@ GEM
|
|
16
16
|
fileutils (1.5.0)
|
17
17
|
local_path_builder (0.1.1)
|
18
18
|
fileutils (~> 1.5.0)
|
19
|
-
parallel (1.
|
20
|
-
parser (3.0.
|
19
|
+
parallel (1.21.0)
|
20
|
+
parser (3.0.2.0)
|
21
21
|
ast (~> 2.4.1)
|
22
22
|
pdf-core (0.9.0)
|
23
23
|
prawn (2.4.0)
|
24
24
|
pdf-core (~> 0.9.0)
|
25
25
|
ttfunk (~> 1.7)
|
26
26
|
rainbow (3.0.0)
|
27
|
-
rake (13.0.
|
27
|
+
rake (13.0.6)
|
28
28
|
regexp_parser (2.1.1)
|
29
29
|
rexml (3.2.5)
|
30
|
-
rubocop (1.
|
30
|
+
rubocop (1.22.1)
|
31
31
|
parallel (~> 1.10)
|
32
32
|
parser (>= 3.0.0.0)
|
33
33
|
rainbow (>= 2.2.2, < 4.0)
|
34
34
|
regexp_parser (>= 1.8, < 3.0)
|
35
35
|
rexml
|
36
|
-
rubocop-ast (>= 1.
|
36
|
+
rubocop-ast (>= 1.12.0, < 2.0)
|
37
37
|
ruby-progressbar (~> 1.7)
|
38
38
|
unicode-display_width (>= 1.4.0, < 3.0)
|
39
|
-
rubocop-ast (1.
|
39
|
+
rubocop-ast (1.12.0)
|
40
40
|
parser (>= 3.0.1.1)
|
41
41
|
ruby-progressbar (1.11.0)
|
42
42
|
ruby-rc4 (0.1.5)
|
43
43
|
ttfunk (1.7.0)
|
44
|
-
unicode-display_width (2.
|
44
|
+
unicode-display_width (2.1.0)
|
45
45
|
|
46
46
|
PLATFORMS
|
47
47
|
x86_64-darwin-20
|
data/README.md
CHANGED
@@ -1,115 +1,114 @@
|
|
1
1
|
<a href="#table-of-contents">
|
2
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/documents-with-footer-to-pdf.svg" height="
|
2
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/documents-with-footer-to-pdf.svg" height="45px" name="headline" alt="# Documents with Footer to .pdf for Ruby">
|
3
3
|
</a>
|
4
4
|
|
5
5
|
Add a footer to each document and create a single .pdf file all in one command.
|
6
|
+
|
6
7
|
<br>
|
7
|
-
|
8
|
-
<br>
|
8
|
+
|
9
9
|
<a href="#table-of-contents">
|
10
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/examples.svg" height="
|
11
|
-
</a>
|
10
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/examples.svg" height="38px" name="examples" alt="Examples"></a>
|
12
11
|
|
13
|
-
### Example 1
|
14
12
|
|
15
|
-
**
|
16
|
-
```5--HEADING--Subheadline.png```
|
13
|
+
**Options:** ```HEADLINE, TIMESTAMP, PAGE_CURRENT```<br>
|
17
14
|
|
18
15
|
```ruby
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
16
|
+
{
|
17
|
+
footer__table__left__top__text: '<<--ENUMERATOR_INTEGER-->>. <<--HEADLINE-->>',
|
18
|
+
footer__table__left__bottom__text: '<<--TIMESTAMP-->>',
|
19
|
+
footer__table__center__top__text: '',
|
20
|
+
footer__table__center__bottom__text: '',
|
21
|
+
footer__table__right__top__text: '<<--PAGE_CURRENT-->>',
|
22
|
+
footer__table__right__bottom__text: '',
|
23
|
+
}
|
27
24
|
```
|
28
25
|
|
29
26
|
**Output**
|
30
27
|
|
31
|
-
<
|
32
|
-
|
28
|
+
<a src="">
|
29
|
+
<img src="https://github.com/a6b8/a6b8/blob/main/docs/documents-with-footer-to-pdf/readme/examples/a.jpg?raw=true"></a>
|
33
30
|
|
34
|
-
|
31
|
+
<br><br>
|
35
32
|
|
36
|
-
**
|
37
|
-
```5--HEADING--Subheadline.png```
|
33
|
+
**Options:** ```HEADLINE, SUBHEADING, text, PAGE_CURRENT, PAGE_TOTAL, timestamp_strf```
|
38
34
|
|
39
35
|
```ruby
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
36
|
+
{
|
37
|
+
footer__table__left__top__text: '<<--ENUMERATOR_ROMAN-->>. <<--HEADLINE-->>',
|
38
|
+
footer__table__left__bottom__text: '<<--SUBHEADING-->>',
|
39
|
+
footer__table__center__top__text: 'Application',
|
40
|
+
footer__table__center__bottom__text: 'John Doe',
|
41
|
+
footer__table__right__top__text: '<<--TIMESTAMP-->>',
|
42
|
+
footer__table__right__bottom__text: '<<--PAGE_CURRENT-->> of <<--PAGE_TOTAL-->>',
|
43
|
+
selectors__timestamp__strf: '%A, %e %B %Y'
|
44
|
+
}
|
49
45
|
```
|
50
46
|
**Output**
|
51
47
|
|
52
|
-
<
|
53
|
-
|
48
|
+
<a src="">
|
49
|
+
<img src="https://github.com/a6b8/a6b8/blob/main/docs/documents-with-footer-to-pdf/readme/examples/b.jpg?raw=true"></a>
|
54
50
|
|
55
|
-
|
51
|
+
<br>
|
56
52
|
|
57
|
-
**
|
58
|
-
```5--HEADING--Subheadline.png```
|
53
|
+
**Options:** ```TIMESTAMP, ENUMERATOR_CHAR, HEADLINE, PAGE_CURRENT```
|
59
54
|
|
60
55
|
```ruby
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
56
|
+
{
|
57
|
+
footer__table__left__top__text: '<<--TIMESTAMP-->>',
|
58
|
+
footer__table__left__bottom__text: '',
|
59
|
+
footer__table__center__top__text: '<<--ENUMERATOR_CHAR-->> <<--HEADLINE-->>',
|
60
|
+
footer__table__center__bottom__text: '',
|
61
|
+
footer__table__right__top__text: '<<--PAGE_CURRENT-->>',
|
62
|
+
footer__table__right__bottom__text: '',
|
63
|
+
}
|
69
64
|
```
|
70
65
|
|
66
|
+
<a src="">
|
71
67
|
<img src="https://github.com/a6b8/a6b8/blob/main/docs/documents-with-footer-to-pdf/readme/examples/c.jpg?raw=true">
|
68
|
+
</a>
|
72
69
|
|
73
|
-
<br>
|
74
|
-
|
75
|
-
<a href="#
|
76
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/table-of-contents.svg" height="
|
70
|
+
<br><br>
|
71
|
+
|
72
|
+
<a href="#headline">
|
73
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/table-of-contents.svg" height="38px" name="table-of-contents" alt="Table of Contents">
|
77
74
|
</a>
|
78
75
|
<br>
|
79
76
|
|
80
77
|
1. [Quickstart](#quickstart)<br>
|
81
|
-
2. [
|
82
|
-
3. [
|
83
|
-
4. [
|
84
|
-
5. [
|
85
|
-
6. [
|
86
|
-
7. [
|
87
|
-
8. [
|
88
|
-
9. [
|
89
|
-
10. [
|
78
|
+
2. [Setup](#setup)<br>
|
79
|
+
3. [Methods](#methods)<br>
|
80
|
+
4. [Options](#options)<br>
|
81
|
+
5. [Selectors](#selectors-main)<br>
|
82
|
+
6. [Contributing](#contributing)<br>
|
83
|
+
7. [Limitations](#limitations)<br>
|
84
|
+
8. [Credits](#credits)<br>
|
85
|
+
9. [License](#license)<br>
|
86
|
+
10. [Code of Conduct](#code-of-conduct)<br>
|
87
|
+
11. [Support my Work](#support-my-work)<br>
|
90
88
|
|
91
89
|
<br>
|
92
|
-
|
90
|
+
|
93
91
|
<a href="#table-of-contents">
|
94
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/quickstart.svg" height="
|
92
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/quickstart.svg" height="38px" name="quickstart" alt="Quickstart">
|
95
93
|
</a>
|
96
94
|
|
97
95
|
```ruby
|
98
|
-
|
96
|
+
require 'documents_with_footer_to_pdf'
|
99
97
|
|
100
98
|
|
101
|
-
|
99
|
+
your_folder = './1-test/'
|
102
100
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
101
|
+
DocumentsWithFooterToPdf.generate(
|
102
|
+
your_folder,
|
103
|
+
:short,
|
104
|
+
{}
|
107
105
|
)
|
108
106
|
```
|
107
|
+
|
109
108
|
<br>
|
110
|
-
|
109
|
+
|
111
110
|
<a href="#table-of-contents">
|
112
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/local-path-builder-for-ruby/readme/headlines/setup.svg" height="
|
111
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/local-path-builder-for-ruby/readme/headlines/setup.svg" height="38px" name="setup" alt="Setup">
|
113
112
|
</a>
|
114
113
|
|
115
114
|
Add this line to your application's Gemfile:
|
@@ -132,29 +131,29 @@ On Rubygems:
|
|
132
131
|
- Profile: https://rubygems.org/profiles/a6b8
|
133
132
|
|
134
133
|
<br>
|
135
|
-
|
134
|
+
|
136
135
|
<a href="#table-of-contents">
|
137
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/methods.svg" height="
|
136
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/methods.svg" height="38px" name="methods" alt="Methods">
|
138
137
|
</a>
|
139
138
|
|
140
139
|
### .get_options()
|
141
140
|
```ruby
|
142
|
-
|
141
|
+
require 'documents_with_footer_to_pdf'
|
143
142
|
|
144
|
-
|
145
|
-
|
143
|
+
hash = DocumentsWithFooterToPdf.get_options()
|
144
|
+
# => { path:
|
146
145
|
```
|
147
146
|
|
148
147
|
|
149
148
|
### .generate()
|
150
149
|
```ruby
|
151
|
-
|
150
|
+
require 'documents_with_footer_to_pdf'
|
152
151
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
152
|
+
hash = DocumentsWithFooterToPdf.generate(
|
153
|
+
folder,
|
154
|
+
console_mode,
|
155
|
+
options
|
156
|
+
)
|
158
157
|
```
|
159
158
|
|
160
159
|
**Input**
|
@@ -166,11 +165,11 @@ On Rubygems:
|
|
166
165
|
|
167
166
|
**Return**<br>
|
168
167
|
Boolean
|
168
|
+
|
169
169
|
<br>
|
170
|
-
|
171
|
-
<br>
|
170
|
+
|
172
171
|
<a href="#table-of-contents">
|
173
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/options.svg" height="
|
172
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/options.svg" height="38px" name="options" alt="Options">
|
174
173
|
</a>
|
175
174
|
|
176
175
|
### Path
|
@@ -221,16 +220,13 @@ More Information on ```strf``` format: https://apidock.com/ruby/DateTime/strftim
|
|
221
220
|
| D.5. | Search Suffixs |:params__search__suffixs | `["jpg", "png", "pdf"]` | Array | Types of suffixes which are included (Supported jpg, png, pdf) |
|
222
221
|
| D.6. | Console Length |:params__console__length | `50` | Integer | Change length of console output |
|
223
222
|
</a>
|
223
|
+
|
224
224
|
<br>
|
225
|
-
|
225
|
+
|
226
226
|
<a href="#table-of-contents">
|
227
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/selectors.svg" height="
|
227
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/selectors.svg" height="38px" name="selectors-main" alt="Selectors">
|
228
228
|
</a>
|
229
229
|
|
230
|
-
Filename: ```C--HEADING--Subheadline.png```
|
231
|
-
|
232
|
-
> Use double hyphens '--' as limiter
|
233
|
-
|
234
230
|
| Selector | Example | Description |
|
235
231
|
| :--- | :--- | :--- |
|
236
232
|
| ```"<<--TIMESTAMP-->>"``` | 24.05.2021 | Show current Timestamp, to change for format use option: :selectors__timestamp__strf |
|
@@ -245,60 +241,64 @@ Filename: ```C--HEADING--Subheadline.png```
|
|
245
241
|
| ```"<<--HEADLINE-->>"``` | ```"HEADING"``` | Show Headline |
|
246
242
|
| ```"<<--SUBHEADING-->>"``` | ```"Subheading"``` | Show Subheading |
|
247
243
|
|
244
|
+
### Filename Selectors
|
245
|
+
Use double hyphens '--' as limiter
|
246
|
+
|
247
|
+
**Struct**:
|
248
|
+
```#{SINGLE DIGIT/CHAR}```--```#{HEADLINE}```--```#{SUBHEADING}```.suffix
|
249
|
+
|
250
|
+
**Example Filename**: ```C--HEADING--Subheadline.png```
|
251
|
+
|
248
252
|
<br>
|
249
|
-
|
253
|
+
|
250
254
|
<a href="#table-of-contents">
|
251
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/contributing.svg" height="
|
255
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/contributing.svg" height="38px" name="contributing" alt="Contributing">
|
252
256
|
</a>
|
253
257
|
|
254
258
|
Bug reports and pull requests are welcome on GitHub at https://github.com/a6b8/documents-with-footer-to-pdf. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/a6b8/documents-with-footer-to-pdf/blob/master/CODE_OF_CONDUCT.md).
|
259
|
+
|
255
260
|
<br>
|
256
|
-
|
257
|
-
<br>
|
261
|
+
|
258
262
|
<a href="#table-of-contents">
|
259
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/limitations.svg" height="
|
263
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/limitations.svg" height="38px" name="limitations" alt="Limitations">
|
260
264
|
</a>
|
265
|
+
|
261
266
|
- Made for local usage
|
262
267
|
- Some pdf fonts are not supported.
|
263
|
-
|
268
|
+
|
264
269
|
<br>
|
265
270
|
|
266
271
|
<a href="#table-of-contents">
|
267
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/credits.svg" height="
|
272
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/credits.svg" height="38px" name="credits" alt="Credits">
|
268
273
|
</a>
|
269
274
|
|
270
275
|
This gem depend on following gems:
|
271
|
-
-
|
272
|
-
|
273
|
-
-
|
274
|
-
|
275
|
-
-
|
276
|
-
|
277
|
-
- **prawn** <br>
|
278
|
-
https://github.com/prawnpdf/prawn <br>
|
279
|
-
- **image magick** <br>
|
280
|
-
https://imagemagick.org/script/convert.php
|
281
|
-
<br>
|
276
|
+
- [local_path_builder](https://github.com/a6b8/local-path-builder-for-ruby) <br>
|
277
|
+
- [FileUtils](https://ruby-doc.org/stdlib-2.4.1/libdoc/fileutils/rdoc/FileUtils.html) <br>
|
278
|
+
- [combine_pdf](https://github.com/boazsegev/combine_pdf) <br>
|
279
|
+
- [prawn](https://github.com/prawnpdf/prawn) <br>
|
280
|
+
- [image magick](https://imagemagick.org/script/convert.php)
|
281
|
+
|
282
282
|
<br>
|
283
283
|
|
284
284
|
<a href="#table-of-contents">
|
285
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/license.svg" height="
|
285
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/license.svg" height="38px" name="license" alt="License">
|
286
286
|
</a>
|
287
287
|
|
288
288
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
289
|
+
|
289
290
|
<br>
|
290
|
-
|
291
|
-
<br>
|
291
|
+
|
292
292
|
<a href="#table-of-contents">
|
293
|
-
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/code-of-conduct.svg" height="
|
293
|
+
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/code-of-conduct.svg" height="38px" name="code-of-conduct" alt="Code of Conduct">
|
294
294
|
</a>
|
295
295
|
|
296
296
|
Everyone interacting in the documents-with-footer-to-pdf project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/a6b8/documents-with-footer-to-pdf/blob/master/CODE_OF_CONDUCT.md).
|
297
|
+
|
297
298
|
<br>
|
298
|
-
|
299
|
-
<br>
|
299
|
+
|
300
300
|
<a href="#table-of-contents">
|
301
|
-
<img href="#table-of-contents" src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/support-my-work.svg" height="
|
301
|
+
<img href="#table-of-contents" src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/documents-with-footer-to-pdf/readme/headlines/support-my-work.svg" height="38px" name="support-my-work" alt="Support my Work">
|
302
302
|
</a>
|
303
303
|
|
304
304
|
Donate by [https://www.paypal.com](https://www.paypal.com/donate?hosted_button_id=XKYLQ9FBGC4RG)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: documents_with_footer_to_pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- a6b8
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: local_path_builder
|
@@ -74,6 +74,7 @@ executables: []
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- ".circleci/config.yml"
|
77
78
|
- ".gitignore"
|
78
79
|
- ".rubocop.yml"
|
79
80
|
- CHANGELOG.md
|