{"id":26241593,"url":"https://github.com/a6b8/documents-with-footer-to-pdf-for-ruby","last_synced_at":"2025-03-13T08:32:15.693Z","repository":{"id":56844325,"uuid":"378882032","full_name":"a6b8/documents-with-footer-to-pdf-for-ruby","owner":"a6b8","description":"Add a footer to each document and create a single .pdf file all in one command.","archived":false,"fork":false,"pushed_at":"2022-01-21T02:03:48.000Z","size":13145,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-17T07:59:49.166Z","etag":null,"topics":["footer","pdf-converter","pdf-document","pdf-document-processor","pdf-generation","prawn-pdf"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a6b8.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-21T09:47:37.000Z","updated_at":"2022-01-01T18:16:05.000Z","dependencies_parsed_at":"2022-09-07T09:00:20.106Z","dependency_job_id":null,"html_url":"https://github.com/a6b8/documents-with-footer-to-pdf-for-ruby","commit_stats":null,"previous_names":["a6b8/documents-with-footer-to-pdf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a6b8%2Fdocuments-with-footer-to-pdf-for-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a6b8%2Fdocuments-with-footer-to-pdf-for-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a6b8%2Fdocuments-with-footer-to-pdf-for-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a6b8%2Fdocuments-with-footer-to-pdf-for-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a6b8","download_url":"https://codeload.github.com/a6b8/documents-with-footer-to-pdf-for-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243369761,"owners_count":20280068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["footer","pdf-converter","pdf-document","pdf-document-processor","pdf-generation","prawn-pdf"],"created_at":"2025-03-13T08:32:14.789Z","updated_at":"2025-03-13T08:32:15.632Z","avatar_url":"https://github.com/a6b8.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/custom/documents-with-footer-to-.pdf-for-ruby.svg\" height=\"45px\" name=\"# Documents with Footer to .pdf for Ruby\" alt=\"Documents with Footer to .pdf for Ruby\"\u003e\n\u003c/a\u003e\n\nAdd a footer to each document and create a single .pdf file all in one command.\n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/examples.svg\" height=\"45px\" name=\"examples\" alt=\"Examples\"\u003e\u003c/a\u003e\n\n\n**Options:** ```HEADLINE, TIMESTAMP, PAGE_CURRENT```\u003cbr\u003e\n\n```ruby\n{ \n    footer__table__left__top__text: '\u003c\u003c--ENUMERATOR_INTEGER--\u003e\u003e. \u003c\u003c--HEADLINE--\u003e\u003e',\n    footer__table__left__bottom__text: '\u003c\u003c--TIMESTAMP--\u003e\u003e',\n    footer__table__center__top__text: '',\n    footer__table__center__bottom__text: '',\n    footer__table__right__top__text: '\u003c\u003c--PAGE_CURRENT--\u003e\u003e',\n    footer__table__right__bottom__text: '',\n}\n```\n\n**Output**\n\n\u003ca src=\"\"\u003e\n\u003cimg src=\"https://github.com/a6b8/a6b8/blob/main/assets/additional/documents-with-footer-to-pdf/examples/a.jpg?raw=true\"\u003e\u003c/a\u003e\n\n\u003cbr\u003e\u003cbr\u003e\n\n**Options:** ```HEADLINE, SUBHEADING, text, PAGE_CURRENT, PAGE_TOTAL, timestamp_strf```\n\n```ruby\n{ \n    footer__table__left__top__text: '\u003c\u003c--ENUMERATOR_ROMAN--\u003e\u003e. \u003c\u003c--HEADLINE--\u003e\u003e',\n    footer__table__left__bottom__text: '\u003c\u003c--SUBHEADING--\u003e\u003e',\n    footer__table__center__top__text: 'Application',\n    footer__table__center__bottom__text: 'John Doe',\n    footer__table__right__top__text: '\u003c\u003c--TIMESTAMP--\u003e\u003e',\n    footer__table__right__bottom__text: '\u003c\u003c--PAGE_CURRENT--\u003e\u003e of \u003c\u003c--PAGE_TOTAL--\u003e\u003e',\n    selectors__timestamp__strf: '%A, %e %B %Y'\n}\n```\n**Output**\n\n\u003ca src=\"\"\u003e\n\u003cimg src=\"https://github.com/a6b8/a6b8/blob/main/assets/additional/documents-with-footer-to-pdf/examples/b.jpg?raw=true\"\u003e\u003c/a\u003e\n\n\u003cbr\u003e\n\n**Options:** ```TIMESTAMP, ENUMERATOR_CHAR, HEADLINE, PAGE_CURRENT```\n\n```ruby\n{ \n    footer__table__left__top__text: '\u003c\u003c--TIMESTAMP--\u003e\u003e',\n    footer__table__left__bottom__text: '',\n    footer__table__center__top__text: '\u003c\u003c--ENUMERATOR_CHAR--\u003e\u003e \u003c\u003c--HEADLINE--\u003e\u003e',\n    footer__table__center__bottom__text: '',\n    footer__table__right__top__text: '\u003c\u003c--PAGE_CURRENT--\u003e\u003e',\n    footer__table__right__bottom__text: '',\n}\n```\n\n\u003ca src=\"\"\u003e\n\u003cimg src=\"https://github.com/a6b8/a6b8/blob/main/assets/additional/documents-with-footer-to-pdf/examples/c.jpg?raw=true\"\u003e\n\u003c/a\u003e\n\n\u003cbr\u003e\u003cbr\u003e\n\n\u003ca href=\"#headline\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/table-of-contents.svg\" height=\"45px\" name=\"table-of-contents\" alt=\"Table of Contents\"\u003e\n\u003c/a\u003e\n\u003cbr\u003e\n\n1. [Quickstart](#quickstart)\u003cbr\u003e\n2. [Setup](#setup)\u003cbr\u003e\n3. [Methods](#methods)\u003cbr\u003e\n4. [Options](#options)\u003cbr\u003e\n5. [Selectors](#selectors-main)\u003cbr\u003e\n6. [Contributing](#contributing)\u003cbr\u003e\n7. [Limitations](#limitations)\u003cbr\u003e\n8. [Credits](#credits)\u003cbr\u003e\n9. [License](#license)\u003cbr\u003e\n10. [Code of Conduct](#code-of-conduct)\u003cbr\u003e\n11. [Support my Work](#support-my-work)\u003cbr\u003e\n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/quickstart.svg\" height=\"45px\" name=\"quickstart\" alt=\"Quickstart\"\u003e\n\u003c/a\u003e\n\n```ruby\nrequire 'documents_with_footer_to_pdf'\n\n\nyour_folder = './1-test/'\n\nDocumentsWithFooterToPdf.generate( \n    your_folder, \n    :short, \n    {}\n) \n```\n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/setup.svg\" height=\"45px\" name=\"setup\" alt=\"Setup\"\u003e\n\u003c/a\u003e\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'documents_with_footer_to_pdf'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install documents_with_footer_to_pdf\n\n\nOn Rubygems: \n- Gem: https://rubygems.org/gems/test\n- Profile: https://rubygems.org/profiles/a6b8\n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/methods.svg\" height=\"45px\" name=\"methods\" alt=\"Methods\"\u003e\n\u003c/a\u003e\n\n### .get_options()\n```ruby\nrequire 'documents_with_footer_to_pdf'\n\nhash = DocumentsWithFooterToPdf.get_options() \n# =\u003e { path: \n```\n\n\n### .generate()\n```ruby\nrequire 'documents_with_footer_to_pdf'\n\nhash = DocumentsWithFooterToPdf.generate( \n    folder, \n    console_mode,  \n    options \n)\n```\n\n**Input**\n| **Type** | **Required** | **Description** | **Example** | **Description** |\n|------:|:------|:------|:------|:------| \n| **headline** | ```String``` | Yes | \"./test/\" | Define path to folder |\n| **console mode** | ```Symbol``` | Yes | ```:hash``` | Set test console output mode. Use ```:silent```, ```:short```, or ```:detail``` |\n| **options** | ```'Hash'``` | No | ```{}``` | Change defaut options, please refer: \u003ca href=\"#options\"\u003eOptions\u003c/a\u003e for more info |\n\n**Return**\u003cbr\u003e\nBoolean   \n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/options.svg\" height=\"45px\" name=\"options\" alt=\"Options\"\u003e\n\u003c/a\u003e\n\n### Path\n| Nr | Name | Key | Default | Type | Description |\n| :-- | :-- | :-- | :-- | :-- | :-- |\n| A.1. | Children Tmp Name |:path__children__tmp__name | `\"tmp-{{SALT}}\"` | String | Change temporary folder name, {{SALT}} will replaced with current unix timestamp |\n| A.2. | Children Pdf_combined Name |:path__children__pdf_combined__name | `\"0-result-{{SALT}}\"` | String | Change result folder name, {{SALT}} will replaced with current unix timestamp |\n\n\n### Footer\n| Nr | Name | Key | Default | Type | Description |\n| :-- | :-- | :-- | :-- | :-- | :-- |\n| B.1. | Position Top |:footer__position__top | `[0, 20]` | Array | Set footer position top. |\n| B.2. | Position Bottom |:footer__position__bottom | `[0, 10]` | Array | Set footer position bottom. |\n| B.3. | Table Left Top Text |:footer__table__left__top__text | `\"\u003c\u003c--FILENAME--\u003e\u003e\"` | String | Set text in field left-top |\n| B.4. | Table Left Bottom Text |:footer__table__left__bottom__text | `\"\"` | String | String | Set text in field left-bottom |\n| B.5. | Table Center Top Text |:footer__table__center__top__text | `\"\"` | String | String | Set text in field center-top |\n| B.6. | Table Center Bottom Text |:footer__table__center__bottom__text | `\"\"` | String | String | Set text in field center-bottom |\n| B.7. | Table Right Top Text |:footer__table__right__top__text | `\"\u003c\u003c--TIMESTAMP--\u003e\u003e\"` | String | String | Set text in field right-top |\n| B.8. | Table Right Bottom Text |:footer__table__right__bottom__text | `\"\u003c\u003c--PAGE_CURRENT--\u003e\u003e from \u003c\u003c--PAGE_TOTAL--\u003e\u003e\"` | String | String | Set text in field right-bottom |\n\n\n### Selectors\n| Nr | Name | Key | Default | Type | Description |\n| :-- | :-- | :-- | :-- | :-- | :-- |\n| C.1. | Timestamp Gsub |:selectors__timestamp__gsub | `\"\u003c\u003c--TIMESTAMP--\u003e\u003e\"` | String | Change marker for timestamp. |\n| C.2. | Timestamp Strf |:selectors__timestamp__strf | `\"%d.%m.%Y\"` | String | Change format of date and time |\n| C.3. | Page_current Gsub |:selectors__page_current__gsub | `\"\u003c\u003c--PAGE_CURRENT--\u003e\u003e\"` | String | Change marker for current page. |\n| C.4. | Page_total Gsub |:selectors__page_total__gsub | `\"\u003c\u003c--PAGE_TOTAL--\u003e\u003e\"` | String | Change marker for total page size |\n| C.5. | Enumerator_original Gsub |:selectors__enumerator_original__gsub | `\"\u003c\u003c--ENUMERATOR_ORIGINAL--\u003e\u003e\"` | String | Change marker for original enumeration |\n| C.6. | Enumerator_integer Gsub |:selectors__enumerator_integer__gsub | `\"\u003c\u003c--ENUMERATOR_INTEGER--\u003e\u003e\"` | String | Change marker for integer enumeration |\n| C.7. | Enumerator_char Gsub |:selectors__enumerator_char__gsub | `\"\u003c\u003c--ENUMERATOR_CHAR--\u003e\u003e\"` | String | Change marker for char enumeration |\n| C.8. | Enumerator_roman Gsub |:selectors__enumerator_roman__gsub | `\"\u003c\u003c--ENUMERATOR_ROMAN--\u003e\u003e\"` | String | Change marker for roman letters enumeration |\n| C.9. | Filename Gsub |:selectors__filename__gsub | `\"\u003c\u003c--FILENAME--\u003e\u003e\"` | String | Change marker for filename |\n| C.10. | Path Gsub |:selectors__path__gsub | `\"\u003c\u003c--PATH--\u003e\u003e\"` | String | Change marker for full path |\n| C.11. | Heading Gsub |:selectors__heading__gsub | `\"\u003c\u003c--HEADLINE--\u003e\u003e\"` | String | Change marker for headline |\n| C.12. | Subheading Gsub |:selectors__subheading__gsub | `\"\u003c\u003c--SUBHEADING--\u003e\u003e\"` | String | Change marker for sub headline |\n\nMore Information on ```strf``` format: https://apidock.com/ruby/DateTime/strftime\n\n### Params\n| Nr | Name | Key | Default | Type | Description |\n| :-- | :-- | :-- | :-- | :-- | :-- |\n| D.1. | Footer Font_size |:params__footer__font_size | `9` | Integer | Set footer font size |\n| D.2. | Document Width |:params__document__width | `500` | Integer | Set document width |\n| D.3. | Image Density |:params__image__density | `300` | Integer | Set image density |\n| D.4. | Search Subfolders |:params__search__subfolders | `false` | Boolean | Set if subfolders should be included in search |\n| D.5. | Search Suffixs |:params__search__suffixs | `[\"jpg\", \"png\", \"pdf\"]` | Array | Types of suffixes which are included (Supported jpg, png, pdf) |\n| D.6. | Console Length |:params__console__length | `50` | Integer | Change length of console output |\n\u003c/a\u003e\n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/selectors.svg\" height=\"45px\" name=\"selectors\" alt=\"Selectors\"\u003e\n\u003c/a\u003e\n\n| Selector | Example | Description |\n| :--- | :--- | :--- |\n| ```\"\u003c\u003c--TIMESTAMP--\u003e\u003e\"``` | 24.05.2021 | Show current Timestamp, to change for format use option: :selectors__timestamp__strf |\n| ```\"\u003c\u003c--PAGE_CURRENT--\u003e\u003e\"``` | ```1``` | Show current Page |\n| ```\"\u003c\u003c--PAGE_TOTAL--\u003e\u003e\"``` | ```3``` | Show total Page size |\n| ```\"\u003c\u003c--ENUMERATOR_ORIGINAL--\u003e\u003e\"``` | ```\"C\"``` | Show original Enumerator |\n| ```\"\u003c\u003c--ENUMERATOR_INTEGER--\u003e\u003e\"``` | ```3``` | Show Enumerator as Integer |\n| ```\"\u003c\u003c--ENUMERATOR_CHAR--\u003e\u003e\"``` | ```\"C\"``` | Show Enumerator as Char |\n| ```\"\u003c\u003c--ENUMERATOR_ROMAN--\u003e\u003e\"``` | ```\"III\"``` | Show Enumerator in Roman Letters |\n| ```\"\u003c\u003c--FILENAME--\u003e\u003e\"``` | ```\"C--HEADING--Subheadline.png\"``` | Show filename |\n| ```\"\u003c\u003c--PATH--\u003e\u003e\"``` | ```\"../C--HEADING--Subheadline\"``` | Show file path|\n| ```\"\u003c\u003c--HEADLINE--\u003e\u003e\"``` | ```\"HEADING\"``` | Show Headline |\n| ```\"\u003c\u003c--SUBHEADING--\u003e\u003e\"``` | ```\"Subheading\"``` | Show Subheading |\n\n### Filename Selectors\nUse double hyphens '--' as limiter \n\n**Struct**:\n```#{SINGLE DIGIT/CHAR}```--```#{HEADLINE}```--```#{SUBHEADING}```.suffix\n\n**Example Filename**: ```C--HEADING--Subheadline.png```\n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/contributing.svg\" height=\"45px\" name=\"contributing\" alt=\"Contributing\"\u003e\n\u003c/a\u003e\n\nBug 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).\n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/limitations.svg\" height=\"45px\" name=\"limitations\" alt=\"Limitations\"\u003e\n\u003c/a\u003e\n\n- Made for local usage\n- Some pdf fonts are not supported.\n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/credits.svg\" height=\"45px\" name=\"credits\" alt=\"Credits\"\u003e\n\u003c/a\u003e\n\nThis gem depend on following gems:\n- [local_path_builder](https://github.com/a6b8/local-path-builder-for-ruby) \u003cbr\u003e\n- [FileUtils](https://ruby-doc.org/stdlib-2.4.1/libdoc/fileutils/rdoc/FileUtils.html) \u003cbr\u003e\n- [combine_pdf](https://github.com/boazsegev/combine_pdf) \u003cbr\u003e\n- [prawn](https://github.com/prawnpdf/prawn) \u003cbr\u003e\n- [image magick](https://imagemagick.org/script/convert.php)\n  \n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/license.svg\" height=\"45px\" name=\"license\" alt=\"License\"\u003e\n\u003c/a\u003e\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/code-of-conduct.svg\" height=\"45px\" name=\"code-of-conduct\" alt=\"Code of Conduct\"\u003e\n\u003c/a\u003e\n    \nEveryone 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).\n\n\u003cbr\u003e\n\n\u003ca href=\"#table-of-contents\"\u003e\n\u003cimg href=\"#table-of-contents\" src=\"https://raw.githubusercontent.com/a6b8/a6b8/main/assets/headlines/default/star-us.svg\" height=\"45px\" name=\"star-us\" alt=\"Star us\"\u003e\n\u003c/a\u003e\n\nPlease ⭐️ star this Project, every ⭐️ star makes us very happy!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa6b8%2Fdocuments-with-footer-to-pdf-for-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa6b8%2Fdocuments-with-footer-to-pdf-for-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa6b8%2Fdocuments-with-footer-to-pdf-for-ruby/lists"}