{"id":19474563,"url":"https://github.com/tomasc/dragonfly_pdf","last_synced_at":"2025-09-18T17:05:35.354Z","repository":{"id":18452366,"uuid":"21645887","full_name":"tomasc/dragonfly_pdf","owner":"tomasc","description":"Dragonfly PDF analysers and processors.","archived":false,"fork":false,"pushed_at":"2023-02-13T22:38:19.000Z","size":1078,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T11:47:02.217Z","etag":null,"topics":["dragonfly","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/tomasc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-09T09:00:23.000Z","updated_at":"2023-02-13T21:16:00.000Z","dependencies_parsed_at":"2024-11-10T19:35:45.686Z","dependency_job_id":null,"html_url":"https://github.com/tomasc/dragonfly_pdf","commit_stats":{"total_commits":158,"total_committers":5,"mean_commits":31.6,"dds":"0.25316455696202533","last_synced_commit":"248b3f1e4132643efbe9397d57ea9d3c2fe49dfc"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fdragonfly_pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fdragonfly_pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fdragonfly_pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fdragonfly_pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasc","download_url":"https://codeload.github.com/tomasc/dragonfly_pdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250817780,"owners_count":21492221,"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":["dragonfly","pdf"],"created_at":"2024-11-10T19:25:41.909Z","updated_at":"2025-09-18T17:05:30.300Z","avatar_url":"https://github.com/tomasc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dragonfly PDF\n\n[![Build Status](https://travis-ci.org/tomasc/dragonfly_pdf.svg)](https://travis-ci.org/tomasc/dragonfly_pdf) [![Gem Version](https://badge.fury.io/rb/dragonfly_pdf.svg)](http://badge.fury.io/rb/dragonfly_pdf) [![Coverage Status](https://img.shields.io/coveralls/tomasc/dragonfly_pdf.svg)](https://coveralls.io/r/tomasc/dragonfly_pdf)\n\n[Dragonfly](https://github.com/markevans/dragonfly) PDF analysers and processors.\n\n## Dependencies\n\n- [libvips](https://github.com/jcupitt/libvips)\n- [GhostScript](http://www.ghostscript.com)\n- [mupdf](https://mupdf.com)\n- [pdftk](https://www.pdflabs.com/tools/pdftk-server)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```\ngem 'dragonfly_pdf'\n```\n\nAnd then execute:\n\n```\n$ bundle\n```\n\nOr install it yourself as:\n\n```\n$ gem install dragonfly_pdf\n```\n\n## Usage\n\nThe analyser and processors are added by configuring the plugin\n\n```ruby\nDragonfly.app.configure do\n  plugin :pdf\nend\n```\n\n## Supported Formats\n\nList of supported formats is available as:\n\n```ruby\nDragonflyPdf::SUPPORTED_FORMATS # =\u003e [\"pdf\"]\nDragonflyPdf::SUPPORTED_OUTPUT_FORMATS # =\u003e [\"pdf\", \"svg\", …]\n```\n\n## Analysers\n\n### PDF properties\n\nReads properties from a PDF.\n\n```ruby\npdf.pdf_properties # =\u003e {\n    page_count: 4,\n    page_dimensions: [[210.0, 297.0], [210.0, 297.0], [210.0, 297.0], [210.0, 297.0]],\n    page_numbers: [1, 2, 3, 4],\n    aspect_ratios: [0.71, 0.71, 0.71, 0.71],\n    page_rotations: [0.0, 90.0, 0.0, 0.0]\n}\n```\n\n## Processors\n\n### Append\n\nAppend PDFs.\n\n```ruby\npdf.append([pdf_1, pdf_2, pdf_3])\n```\n\n### Page\n\nExtracts page from PDF.\n\n```ruby\npdf.page(page_number=1)\n```\n\n### Page Thumb\n\nGenerates thumbnail of a specified page using the `thumb` processor of [DragonflyLibvips](https://github.com/tomasc/dragonfly_libvips).\n\n```ruby\npdf.page_thumb(page_number=1, '500x', opts={})\n```\n\nThe default format is `png`, others can be specified\n\n```ruby\n{\n    'format' =\u003e 'jpg',\n}\n```\n\nFor more options see the [`thumb` doc](https://github.com/tomasc/dragonfly_libvips#thumb).\n\n### Remove password\n\nRemove password from password protected PDF.\n\n```ruby\npdf.remove_password\n```\n\n### Rotate\n\nRotate all pages.\n\n```ruby\npdf.rotate(:left)\n```\n\nRotate selected pages.\n\n```ruby\npdf.rotate(1 =\u003e :left, 3 =\u003e :right)\n```\n\nabsolute: `north|south|east|west` relative: `left|right|down`\n\n### Stamp\n\nStamp every page of a PDF with another PDF.\n\n```ruby\npdf.stamp(stamp_pdf)\n```\n\n### Subset Fonts\n\nSubset fonts in PDF.\n\n```ruby\npdf.subset_fonts\n```\n\n## Contributing\n\n1. Fork it ( \u003chttps://github.com/tomasc/dragonfly_pdf/fork\u003e )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasc%2Fdragonfly_pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasc%2Fdragonfly_pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasc%2Fdragonfly_pdf/lists"}