{"id":10610087,"url":"https://github.com/jbd0101/ruby-gotenberg-client","last_synced_at":"2025-09-12T09:31:23.334Z","repository":{"id":57952925,"uuid":"528994501","full_name":"jbd0101/ruby-gotenberg-client","owner":"jbd0101","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-08T20:22:08.000Z","size":553,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-03T21:13:27.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jbd0101.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-08-25T19:39:44.000Z","updated_at":"2025-08-01T15:37:27.000Z","dependencies_parsed_at":"2023-02-08T07:31:07.821Z","dependency_job_id":null,"html_url":"https://github.com/jbd0101/ruby-gotenberg-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jbd0101/ruby-gotenberg-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbd0101%2Fruby-gotenberg-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbd0101%2Fruby-gotenberg-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbd0101%2Fruby-gotenberg-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbd0101%2Fruby-gotenberg-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbd0101","download_url":"https://codeload.github.com/jbd0101/ruby-gotenberg-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbd0101%2Fruby-gotenberg-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274788845,"owners_count":25349994,"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-09-12T02:00:09.324Z","response_time":60,"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":[],"created_at":"2024-06-02T09:27:05.731Z","updated_at":"2025-09-12T09:31:23.068Z","avatar_url":"https://github.com/jbd0101.png","language":"Ruby","funding_links":[],"categories":["Clients"],"sub_categories":[],"readme":"# Gotenberg client for Ruby\n\n[Gotenberg] is awesome, but using it with Ruby is complicated.\n\nThis gem is not intended to wrap the whole api of Gotenberg but to make\nthe creation of PDFs easy in Ruby / Ruby on Rails.\n\nThis gem is young and needs a lot of updates and improvements. (Work in progress, be patient, or contribute :-) )\n\n## Install\n\nFirst download and run Gotenberg:\n\n```\ndocker run --rm -p 3000:3000 gotenberg/gotenberg:7\n```\n\nInstall `gotenberg-client` gem\n\n```\ngem install gotenberg-client\n```\n\nor add `gotenberg-client` to your Gemfile.\n\n## Usage\n\nYou will probably use this gem to generate PDFs in a Ruby on Rails background job or in a Ruby file.\n\nTherefore, this gem does not (yet) integrate with any Ruby on Rails tools.\n\n```ruby\nrequire \"gotenberg\"\n\napi_endpoint = \"http://localhost:3000\" # change it with your specific port and address.\ngb = Gotenberg::Client.new(api_endpoint)\n\n# check whether your endpoint is working\ngb.up? # true if working\n\noutput_pdf = Tempfile.new(\"my-pdf.pdf\")\nhtml = \"\u003ch1\u003e my html \u003c/h1\u003e\"\ngb.html(html, output_pdf)\n\n# Do not forget to destroy your tempfile\noutput_pdf.close\noutput_pdf.unlink\n```\n\nIf you want to use Rails views, the easiest way is to use [`ActionController::Base#render_to_string`][render_to_string].\n\nSay you have a view file `app/views/test.html.erb` that requires a `@customer` variable.\n\n```ruby\ngb = Gotenberg::Client.new(api_endpoint)\n\noutput_pdf = Tempfile.new(\"my-pdf.pdf\")\nac = ActionController::Base.new\nac.instance_variable_set(:@customer, Customer.find(params[:id]))\ngb.html(ac.render_to_string(\"/test.html.erb\"), output_pdf)\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/jbd0101/ruby-gotenberg-client.\n\n\n## License\n\ndo whatever you want with it\n\n[Gotenberg]: https://gotenberg.dev/\n[render_to_string]: https://api.rubyonrails.org/classes/AbstractController/Rendering.html#method-i-render_to_string","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbd0101%2Fruby-gotenberg-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbd0101%2Fruby-gotenberg-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbd0101%2Fruby-gotenberg-client/lists"}