{"id":1553,"url":"https://github.com/DimaMishchenko/UIImagePlusPDF","last_synced_at":"2025-08-02T04:31:38.434Z","repository":{"id":56924923,"uuid":"133666624","full_name":"DimaMishchenko/UIImagePlusPDF","owner":"DimaMishchenko","description":"UIImage PDF extensions.","archived":false,"fork":false,"pushed_at":"2020-12-27T15:29:44.000Z","size":256,"stargazers_count":36,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-01T04:21:39.584Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/DimaMishchenko.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}},"created_at":"2018-05-16T13:03:00.000Z","updated_at":"2024-03-30T10:20:28.000Z","dependencies_parsed_at":"2022-08-20T22:50:27.970Z","dependency_job_id":null,"html_url":"https://github.com/DimaMishchenko/UIImagePlusPDF","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaMishchenko%2FUIImagePlusPDF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaMishchenko%2FUIImagePlusPDF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaMishchenko%2FUIImagePlusPDF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaMishchenko%2FUIImagePlusPDF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DimaMishchenko","download_url":"https://codeload.github.com/DimaMishchenko/UIImagePlusPDF/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228438963,"owners_count":17920017,"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":[],"created_at":"2024-01-05T20:15:49.665Z","updated_at":"2024-12-06T08:31:11.057Z","avatar_url":"https://github.com/DimaMishchenko.png","language":"Swift","funding_links":[],"categories":["Media"],"sub_categories":["PDF"],"readme":"# UIImagePlusPDF\n[![Swift 4.2](https://img.shields.io/badge/Swift-5.3-orange.svg?style=flat)](https://developer.apple.com/swift/)\n[![CocoaPods compatible](https://img.shields.io/cocoapods/v/UIImagePlusPDF.svg)](https://cocoapods.org/pods/UIImagePlusPDF)\n[![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg)]()\n\nUIImage extensions to use PDF files. \nUsing `UIImagePlusPDF` you can avoid a lot `png` images files (1x, 2x, 3x sizes) and simply replace each of them with only one `pdf` file.\n\n## Installation\n\n[CocoaPods](http://www.cocoapods.org):\n\n``` ruby\npod 'UIImagePlusPDF'\n```\n\n``` swift\nimport UIImagePlusPDF\n```\n\n## Usage\n**Simple example:**\n``` swift\nlet imageView = UIImageView()\nlet image = UIImage.pdfImage(with: \"imageName\")\nimageView.image = image\n```\n**Other options**\n``` swift\n//with custom width \nUIImage.pdfImage(with: \"imageName\", width: 350)\n\n//with custom height\nUIImage.pdfImage(with: \"imageName\", height: 350)\n\n//with custom size\nUIImage.pdfImage(with: \"imageName\", size: CGSize(width: 300, height:  400))\n\n//with page number\nUIImage.pdfImage(with: \"multipage pdf file\", width: 300, pageNumber: 2)\n\n//same options with resource url\nUIImage.pdfImage(with: URL(string: \"path\"))\n```\n\n## Cache\n**Memory cache:**\n``` swift\n//using NSCache\n//default is true\nUIImage.pdfCacheInMemory = true\n```\n**Disk cache:**\n``` swift\n//default is false\nUIImage.pdfCacheOnDisk = true\n```\n**Cache deleting:**\n``` swift\n//all cache\nUIImage.removeAllPDFCache()\n\n//all memory cache\nUIImage.removeAllPDFMemoryCache()\n\n//all disk cache\nUIImage.removeAllPDFDiskCache()\n\n//memory cached pdf with name\nUIImage.removeMemoryCachedPDFImage(\n    with: \"pdf name\", \n    size: imageSize, \n    pageNumber: 1 /*optional, default is 1*/\n)\n\n//memory cached pdf with url\nUIImage.removeMemoryCachedPDFImage(\n    with: URL(string: \"path\"), \n    size: imageSize, \n    pageNumber: 1 /*optional, default is 1*/\n)\n\n//disk cached pdf with name\nUIImage.removeDiskCachedPDFImage(\n    with: \"pdf name\", \n    size: imageSize, \n    pageNumber: 1 /*optional, default is 1*/\n)\n\n//disk cached pdf with url\nUIImage.removeDiskCachedPDFImage(\n    with: URL(string: \"path\"), \n    size: imageSize, \n    pageNumber: 1 /*optional, default is 1*/\n)\n```\n## License\n**UIImagePlusPDF** is under MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDimaMishchenko%2FUIImagePlusPDF","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDimaMishchenko%2FUIImagePlusPDF","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDimaMishchenko%2FUIImagePlusPDF/lists"}