{"id":25457294,"url":"https://github.com/mc-public/pdfpreviewer","last_synced_at":"2025-11-02T12:30:30.172Z","repository":{"id":276992796,"uuid":"930962483","full_name":"mc-public/PDFPreviewer","owner":"mc-public","description":"A SwiftUI component for displaying PDF files.","archived":false,"fork":false,"pushed_at":"2025-02-11T14:40:10.000Z","size":13083,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T15:30:02.093Z","etag":null,"topics":["pdfview","swiftui","swiftui-components"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mc-public.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2025-02-11T13:57:10.000Z","updated_at":"2025-02-11T14:40:14.000Z","dependencies_parsed_at":"2025-02-11T15:41:08.818Z","dependency_job_id":null,"html_url":"https://github.com/mc-public/PDFPreviewer","commit_stats":null,"previous_names":["mc-public/pdfpreviewer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mc-public%2FPDFPreviewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mc-public%2FPDFPreviewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mc-public%2FPDFPreviewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mc-public%2FPDFPreviewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mc-public","download_url":"https://codeload.github.com/mc-public/PDFPreviewer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239394714,"owners_count":19631122,"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":["pdfview","swiftui","swiftui-components"],"created_at":"2025-02-18T02:16:56.952Z","updated_at":"2025-11-02T12:30:30.129Z","avatar_url":"https://github.com/mc-public.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"### PDFPreviewer - a powerful SwiftUI view for iOS platform to display PDF files.\n\n**PDFPreviewer** uses Apple's [PDFKit](https://developer.apple.com/documentation/pdfkit) to display PDF files. And it added features that were originally thought to be impossible within the framework.\n\n![](https://img.shields.io/badge/Platform_Compatibility-iOS16.0+-blue)\n![](https://img.shields.io/badge/Swift_Compatibility-6.0-red)\n\n## Features\n\n- Smoothly display PDF files.\n- Custom background color and page border.\n- Custom page double-click operation.\n- Automatically invert the PDF rendering tone in night mode.\n- A very simple and powerful zoom-scale control system, allow auto scaling, fixed scaling ratio, or even disable scaling.\n- A convenient and easy-to-use PDF page navigation system.\n\n## Example\n\nAfter downloading the package resources, open the test project to quickly test all the features provided by this framework. The following are two screenshots that demonstrate some of the features supported by the framework.\n\n\u003cimg src=\"Images/green.png\" width=50% height=50%\u003e\n\u003cimg src=\"Images/black.png\" width=50% height=50%\u003e\n\n## Usage\n\n#### Create a `PDFPreviewer` using the view model\n\n```swift\nimport SwiftUI\nimport PDFPreviewer\n\nstruct ContentView: View {\n\n    static let TestPDFURL: URL = {\n        guard let pdfURL = Bundle.main.url(forResource: \"Test\", withExtension: \"pdf\") else {\n            fatalError()\n        }\n        return pdfURL\n    }()\n    \n    @StateObject var controller = PDFPreviewerModel()\n    var body: some View {\n        PDFPreviewer(model: controller)\n        .task {\n            await controller.loadDocument(from: Self.TestPDFURL)\n        }\n    }\n}\n```\nEnsure the uniqueness of the view model being passed, otherwise it will result in undefined behavior.\n\n## Contributing\n\nClone this repository to get started working on the project. \n\n```bash\ngit clone --recursive git@github.com:mc-public/PDFPreviewer.git\n```\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmc-public%2Fpdfpreviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmc-public%2Fpdfpreviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmc-public%2Fpdfpreviewer/lists"}