{"id":29873747,"url":"https://github.com/keepworks/caterpillar-ruby","last_synced_at":"2026-04-19T06:48:55.296Z","repository":{"id":62555290,"uuid":"48690430","full_name":"keepworks/caterpillar-ruby","owner":"keepworks","description":"A simple ruby client for the Caterpillar API","archived":false,"fork":false,"pushed_at":"2017-05-08T10:19:01.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-31T07:13:55.388Z","etag":null,"topics":["caterpillar","conversion","encryption-algorithm","html","pdf","pdf-document","rails","ruby"],"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/keepworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-28T11:58:26.000Z","updated_at":"2018-09-04T08:30:21.000Z","dependencies_parsed_at":"2022-11-03T05:15:40.568Z","dependency_job_id":null,"html_url":"https://github.com/keepworks/caterpillar-ruby","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/keepworks/caterpillar-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepworks%2Fcaterpillar-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepworks%2Fcaterpillar-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepworks%2Fcaterpillar-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepworks%2Fcaterpillar-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keepworks","download_url":"https://codeload.github.com/keepworks/caterpillar-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepworks%2Fcaterpillar-ruby/sbom","scorecard":{"id":553636,"data":{"date":"2025-08-11","repo":{"name":"github.com/keepworks/caterpillar-ruby","commit":"424768a144b7cc61d9bdf17e15e760f798cefe8f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T11:42:16.473Z","repository_id":62555290,"created_at":"2025-08-20T11:42:16.473Z","updated_at":"2025-08-20T11:42:16.473Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278786685,"owners_count":26045591,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["caterpillar","conversion","encryption-algorithm","html","pdf","pdf-document","rails","ruby"],"created_at":"2025-07-30T23:19:23.730Z","updated_at":"2025-10-08T19:09:35.154Z","avatar_url":"https://github.com/keepworks.png","language":"Ruby","readme":"# Caterpillar\n\nThis Ruby gem is a simple wrapper around the Caterpillar API. [Caterpillar](https://caterpillar.io) is a web service that allows you to convert html to pdf.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'caterpillar-ruby'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install caterpillar-ruby\n\n## Usage\n\nSet the following attributes in you Ruby app:\n\n```\nCaterpillar.api_key = 'YOUR_CATERPILLAR_API_KEY' # required\nCaterpillar.api_version = 'YOUR_API_VERSION' # optional, default: 'v1'\nCaterpillar.base_uri = 'YOUR_API_BASE_URI' # optional, default: 'https://api.caterpillar.io'\n```\n\nFor a Rails app you can execute:\n\n    $ rails generate caterpillar:install\n\nor create an initializer `config/initializers/caterpillar.rb`:\n\n```\nCaterpillar.configure do |config|\n  config.api_key = 'YOUR_CATERPILLAR_API_KEY'\nend\n```\n\nOnce set, you can create a PDF document by calling:\n\n```\nCaterpillar.create(source: content, grayscale: true, no_images: true)\n```\n\nYou can also create test PDF documents by calling (header and footer options donot work in test mode):\n\n```\nCaterpillar.create(source: content, test: true)\n```\n\nThe `create` call can also take a block, like so:\n\n```\nCaterpillar.create(source: content) do |file, response|\n  # file is a tempfile holding the response body\n  # response is the HTTParty response object\nend\n```\n\n`create` will return an [HTTParty](https://github.com/jnunemaker/httparty) response object, which will be the new file (or errors, if the request was not valid).\n\nThe only **required parameter** is:\n  * `:source` - a string containing the HTML or URL for creating the document\n\nFor a Rails app you can pass a view as source by converting it to an HTML string using [render_to_string](http://apidock.com/rails/ActionController/Base/render_to_string).\n\nYou might want to set other options in that hash:\n\n| Option | Type | Description |\n|:---|:---|:---|\n`:copies` | `Number` | Number of copies to print into the pdf\n`:grayscale` | `Boolean` | PDF will be generated in grayscale\n`:margin_bottom` | `Number` | Set the page bottom margin\n`:margin_left` | `Number` | Set the page left margin (default 10mm)\n`:margin_right` | `Number` | Set the page right margin (default 10mm)\n`:margin_top` | `Number` | Set the page top margin\n`:orientation` | `String` | Set orientation to Landscape or Portrait (default Portrait)\n`:page_size` | `String` | Set paper size to: A4, Letter, etc. (default A4)\n`:background` | `Boolean` | Do print background (default true)\n`:no_background` | `Boolean` | Do not print background\n`:disable_external_links` | `Boolean` | Do not make links to remote web pages\n`:enable_external_links` | `Boolean` | Make links to remote web pages (default true)\n`:disable_forms` | `Boolean` | Do not turn HTML form fields into pdf form fields (default true)\n`:enable_forms` | `Boolean` | Turn HTML form fields into pdf form fields\n`:images` | `Boolean` | Do load or print images (default true)\n`:no_images` | `Boolean` | Do not load or print images\n`:disable_internal_links` | `Boolean` | Do not make local links\n`:enable_internal_links` | `Boolean` | Make local links (default true)\n`:disable_javascript` | `Boolean` | Do not allow web pages to run javascript\n`:enable_javascript` | `Boolean` | Do allow web pages to run javascript (default true)\n`:javascript_delay` | `Number` | Wait some milliseconds for javascript finish (default 200)\n`:viewport_size` | `String` | Set viewport size if you have custom scrollbars or css attribute overflow to emulate window size\n`:zoom` | `Number` | Use this zoom factor (default 1)\n`:footer_center` | `Number`/`String` | Centered footer text\n`:footer_font_name` | `Number`/`String` | Set footer font name (default Arial)\n`:footer_font_size` | `Number`/`String` | Set footer font size (default 12)\n`:footer_html` | `String` | Adds a html footer\n`:footer_left` | `Number`/`String` | Left aligned footer text\n`:footer_line` | `Boolean` | Display line above the footer\n`:no_footer_line` | `Boolean` | Do not display line above the footer (default true)\n`:footer_right` | `Number`/`String` | Right aligned footer text\n`:footer_spacing` | `Number` | Spacing between footer and content in mm (default 0)\n`:header_center` | `Number`/`String` | Centered header text\n`:header_font_name` | `Number`/`String` | Set header font name (default Arial)\n`:header_font_size` | `Number`/`String` | Set header font size (default 12)\n`:header_html` | `String` | Adds a html header\n`:header_left` | `Number`/`String` | Left aligned header text\n`:header_line` | `Boolean` | Display line below the header\n`:no_header_line` | `Boolean` | Do not display line below the header (default true)\n`:header_right` | `Number`/`String` | Right aligned header text\n`:header_spacing` | `Number` | Spacing between header and content in mm (default 0)\n`:password_protect` | `Hash` | Refer next section for more details\n\n## Password Protect\nYou can password protect PDF using AES 256, AES 128, RC4 (128 \u0026 40) encryption algorithms supported by Adobe Reader.\n\nTo encrypt PDF you need to pass `:password_protect` hash in the `create` method call along with the following **required parameters**:\n* `:password` - a string containing the secret password which will be further used to unlock the PDF\n* `:key_length` - a number which defines the encryption algorithm to be used. Values can be **40, 128 and 256** only.\n\nYou might want to set other options for each encryption algorithm inside `:restrictions` hash:\n\n*Key Length:* **40**\n\n| Option | Value | Description |\n|:---|:---|:---|\n`:print` | `'y', 'n'` | Determines whether or not to allow printing.\n`:modify` | `'y', 'n'` | Determines whether or not to allow document modification.\n`:extract` | `'y', 'n'` | Determines whether or not to allow text/image extraction.\n`:annotate` | `'y', 'n'` | Determines whether or not to allow comments and form fill-in and signing.\n\n*Key Length:* **128**\n\n| Option | Value | Description |\n|:---|:---|:---|\n`:print` | `'full', 'low', 'none'` | **full**: allow full printing. **low**: allow low-resolution printing only. **none**: disallow printing.\n`:modify` | `'all', 'annotate', 'form', 'assembly', 'none'` | **all:** allow full document modification. **annotate:** allow comment authoring and form operations. **form:** allow form field fill-in and signing. **assembly:** allow document assembly only. **none:** allow no modifications.\n`:extract` | `'y', 'n'` | Determines whether or not to allow text/image extraction.\n`:use_aes` | `'y', 'n'` | AES encryption will be used instead of RC4 encryption.\n`:accessibility` | `'y', 'n'` | Determines whether or not to allow accessibility to visually impaired.\n\n*Key Length:* **256**\n\n| Option | Value | Description |\n|:---|:---|:---|\n`:print` | `'full', 'low', 'none'` | **full**: allow full printing. **low**: allow low-resolution printing only. **none**: disallow printing.\n`:modify` | `'all', 'annotate', 'form', 'assembly', 'none'` | **all:** allow full document modification. **annotate:** allow comment authoring and form operations. **form:** allow form field fill-in and signing. **assembly:** allow document assembly only. **none:** allow no modifications.\n`:extract` | `'y', 'n'` | Determines whether or not to allow text/image extraction.\n`:accessibility` | `'y', 'n'` | Determines whether or not to allow accessibility to visually impaired.\n\n**Example:**\n```\nCaterpillar.create(\n    source: content,\n    password_protect: {\n        password: 'YOUR_PASSWORD_HERE',\n        key_length: 128,\n        restrictions: {\n            print: 'low',\n            use_aes: 'y'\n        }\n    }\n)\n```\n\n## Meta\n\nMaintained by [KeepWorks](http://www.keepworks.com/)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/keepworks/caterpillar.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeepworks%2Fcaterpillar-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeepworks%2Fcaterpillar-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeepworks%2Fcaterpillar-ruby/lists"}