{"id":17506229,"url":"https://github.com/orchetect/pdfgadget","last_synced_at":"2025-04-23T12:25:56.375Z","repository":{"id":153806020,"uuid":"622454611","full_name":"orchetect/PDFGadget","owner":"orchetect","description":"Batch PDF operations for Swift","archived":false,"fork":false,"pushed_at":"2024-09-29T22:42:36.000Z","size":454,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-20T08:09:07.717Z","etag":null,"topics":["pdf","pdf-document-processor","pdf-files","pdf-merger","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/orchetect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"orchetect"}},"created_at":"2023-04-02T06:45:34.000Z","updated_at":"2024-09-29T22:42:39.000Z","dependencies_parsed_at":"2024-02-17T06:30:18.489Z","dependency_job_id":"15a10573-8261-4527-a1bd-20ebbda5e3c1","html_url":"https://github.com/orchetect/PDFGadget","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orchetect%2FPDFGadget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orchetect%2FPDFGadget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orchetect%2FPDFGadget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orchetect%2FPDFGadget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orchetect","download_url":"https://codeload.github.com/orchetect/PDFGadget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250432444,"owners_count":21429672,"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":["pdf","pdf-document-processor","pdf-files","pdf-merger","swift"],"created_at":"2024-10-20T03:34:10.495Z","updated_at":"2025-04-23T12:25:56.351Z","avatar_url":"https://github.com/orchetect.png","language":"Swift","funding_links":["https://github.com/sponsors/orchetect"],"categories":[],"sub_categories":[],"readme":"# PDFGadget\n\n[![CI Build Status](https://github.com/orchetect/PDFGadget/actions/workflows/build.yml/badge.svg)](https://github.com/orchetect/PDFGadget/actions/workflows/build.yml) [![Platforms - macOS 11+ | iOS 14+ | visionOS 1+](https://img.shields.io/badge/platforms-macOS%2011+%20|%20iOS%2014+%20|%20visionOS%201+-lightgrey.svg?style=flat)](https://developer.apple.com/swift) ![Swift 5.6-6.0](https://img.shields.io/badge/Swift-5.6–6.0-orange.svg?style=flat) [![Xcode 16+](https://img.shields.io/badge/Xcode-16+-blue.svg?style=flat)](https://developer.apple.com/swift) [![License: MIT](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/orchetect/PDFGadget/blob/main/LICENSE)\n\nBatch PDF utilities with simple API for Swift. Declarative API for:\n\n- assigning or removing file attributes (metadata)\n- file filtering, ordering, and merging\n- page management: reordering, collation, copying, moving, and replacement\n- page presentation: rotation, cropping, etc.\n- page content: filtering, removal or burn-in of annotations\n\n\u003e [!NOTE]\n\u003e Currently this package is only a Swift library. A CLI tool and/or GUI frontend may be added in future.\n\n## Basic Usage\n\n```swift\nimport PDFGadget\n\nlet sources = [URL, URL, URL, ...] // URLs to one or more PDF files\nlet outputDir = URL.desktopDirectory\n```\n\nThe steps of loading source PDFs, performing operations, and saving the resulting PDFs can be performed individually:\n\n```swift\nlet pdfGadget = PDFGadget()\n\ntry pdfGadget.load(pdfs: sources)\ntry pdfGadget.perform(operations: [\n    // one or more operations\n])\n\n// access the resulting PDF documents in memory\npdfGadget.pdfDocuments // [PDFDocument]\n\n// or save them as PDF files to disk\ntry pdfGadget.savePDFs(outputDir: outputDir)\n```\n\nOr a fully automated batch operation can be run with a single call to `run()` by passing in a populated instance of `PDFGadget.Settings`.\n\n```swift\nlet settings = try PDFGadget.Settings(\n    sourcePDFs: sources,\n    outputDir: outputDir,\n    operations: [\n        // one or more operations\n    ],\n    savePDFs: true\n)\n\ntry PDFGadget().run(using: settings)\n```\n\n## Batch Operations\n\nThe following are single operations that may be used in a batch sequence of operations.\n\n\u003e  **Note**: More to be added in future, including: page cropping, more sophisticated annotation editing/filtering/removal.\n\n### File Operations\n\n- New empty file\n- Clone file\n- Filter files\n- Merge files\n- Set file filename(s)\n- Set or remove file attributes (metadata such as title, author, etc.)\n- Remove file protections (encryption and permissions)\n\n### Page Operations\n\n- Filter pages\n- Copy pages\n- Move pages\n- Replace pages by copying or moving them\n- Reverse page order (all or subset of pages)\n- Rotate pages\n- Crop pages\n- Split file into multiple files\n\n### Page Content Operations\n\n- Filter annotations (by types, or remove all)\n- Burn in annotations\n- Extract plain text (to system pasteboard, to file on disk, or to variable in memory)\n\n## Getting Started\n\n1. Add the package to your application as a dependency using Swift Package Manager\n2. `import PDFGadget`\n\n## Author\n\nCoded by a bunch of 🐹 hamsters in a trenchcoat that calls itself [@orchetect](https://github.com/orchetect).\n\n## License\n\nLicensed under the MIT license. See [LICENSE](/LICENSE) for details.\n\n## Sponsoring\n\nIf you enjoy using PDFGadget and want to contribute to open-source financially, GitHub sponsorship is much appreciated. Feedback and code contributions are also welcome.\n\n## Roadmap \u0026 Contributions\n\nPlanned and in-progress features can be found in [Issues](https://github.com/orchetect/PDFGadget/issues). Any help is welcome and appreciated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forchetect%2Fpdfgadget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forchetect%2Fpdfgadget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forchetect%2Fpdfgadget/lists"}