UIImage PDF extensions.

Related tags

PDF UIImagePlusPDF
Overview

UIImagePlusPDF

Swift 4.2 CocoaPods compatible Packagist

UIImage extensions to use PDF files. Using UIImagePlusPDF you can avoid a lot png images files (1x, 2x, 3x sizes) and simply replace each of them with only one pdf file.

Installation

CocoaPods:

pod 'UIImagePlusPDF'
import UIImagePlusPDF

Usage

Simple example:

let imageView = UIImageView()
let image = UIImage.pdfImage(with: "imageName")
imageView.image = image

Other options

//with custom width 
UIImage.pdfImage(with: "imageName", width: 350)

//with custom height
UIImage.pdfImage(with: "imageName", height: 350)

//with custom size
UIImage.pdfImage(with: "imageName", size: CGSize(width: 300, height:  400))

//with page number
UIImage.pdfImage(with: "multipage pdf file", width: 300, pageNumber: 2)

//same options with resource url
UIImage.pdfImage(with: URL(string: "path"))

Cache

Memory cache:

//using NSCache
//default is true
UIImage.pdfCacheInMemory = true

Disk cache:

//default is false
UIImage.pdfCacheOnDisk = true

Cache deleting:

//all cache
UIImage.removeAllPDFCache()

//all memory cache
UIImage.removeAllPDFMemoryCache()

//all disk cache
UIImage.removeAllPDFDiskCache()

//memory cached pdf with name
UIImage.removeMemoryCachedPDFImage(
    with: "pdf name", 
    size: imageSize, 
    pageNumber: 1 /*optional, default is 1*/
)

//memory cached pdf with url
UIImage.removeMemoryCachedPDFImage(
    with: URL(string: "path"), 
    size: imageSize, 
    pageNumber: 1 /*optional, default is 1*/
)

//disk cached pdf with name
UIImage.removeDiskCachedPDFImage(
    with: "pdf name", 
    size: imageSize, 
    pageNumber: 1 /*optional, default is 1*/
)

//disk cached pdf with url
UIImage.removeDiskCachedPDFImage(
    with: URL(string: "path"), 
    size: imageSize, 
    pageNumber: 1 /*optional, default is 1*/
)

License

UIImagePlusPDF is under MIT license. See the LICENSE file for more info.

You might also like...
Mephisto - A command line tool to convert Comic Book Zip archives to PDF and share them over AirDrop
Mephisto - A command line tool to convert Comic Book Zip archives to PDF and share them over AirDrop

mephisto A command line tool written in Swift to convert Comic Book Zip archives

Small utility to import PDF slides as vector images into Keynote for iOS.
Small utility to import PDF slides as vector images into Keynote for iOS.

Small utility to import PDF files into Keynote for iOS. This utility is especially helpful when presenting slideshows created by LaTeX

Draw Week Time Table on PDF using PDFKit in iOS Swift
Draw Week Time Table on PDF using PDFKit in iOS Swift

DrawPDFTimeTable Draw Week Time Table on PDF using PDFKit in iOS Swift. Image Info This is the pdf of time table drawn using PDFKit in iOS Swift with

Swift package that uses WebKit to render PDF files from URLs

Swift package for generating a PDF file from a URL (rendered by WebKit)

PLHKit: A Swift DSL for Rendering and creating PDF Files.
PLHKit: A Swift DSL for Rendering and creating PDF Files.

PLHKit PLH is a tribute to Portsaid Light House, Port Said Lighthouse was the first building in the world created with reinforced concrete. 🌊 PLHKit

TPPDF is a simple-to-use PDF builder for iOS
TPPDF is a simple-to-use PDF builder for iOS

TPPDF is a fast PDF builder for iOS & macOS using simple commands to create advanced documents! Created and maintained by Philip Niedertscheider and a

A Static Library to be embedded on iOS applications to display pdf documents derived from Fast PDF

FastPdfKit This repository contains the FastPdfKit iOS library with some sample projects. FastPdfKit is a library that let you show pdf documents in i

 SwiftGif - A small UIImage extension with gif support.
SwiftGif - A small UIImage extension with gif support.

SwiftGif - A small UIImage extension with gif support.

High performance and lightweight UIView, UIImage, UIImageView, UIlabel, UIButton, Promise and more.

SwiftyUI High performance and lightweight UIView, UIImage, UIImageView, UIlabel, UIButton and more. Features SwiftyView GPU rendering Image and Color

A tool to calculate the color ratio of UIImage in iOS.
A tool to calculate the color ratio of UIImage in iOS.

UIImageColorRatio A tool to calculate the color ratio of UIImage in iOS. How to use UIImageColorRatio Get the color ratio of UIImage. let image = ...

TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage
TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage

TextDrawer TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage. About Annotating Images TextDrawer is the easiest way

A Simple way help you drop or drag your source (like UIImage) between different App.

A Simple way help you drop or drag your source (like UIImage) between different App.

A convenient class usable from UIKit view controller or SwiftUI to scan document & get UIImage or PDFDocument as result - Replacement of IRLDocumentScanner

Super easy SwiftUI & UKKit pakcage to scan: Images or PDF. It is also a replacement for IRLScannerViewController

Complete Animated GIF Support for iOS, with Functions, NSJSONSerialization-style Class, and (Optional) UIImage Swizzling
Complete Animated GIF Support for iOS, with Functions, NSJSONSerialization-style Class, and (Optional) UIImage Swizzling

AnimatedGIFImageSerialization This library is no longer maintained. In iOS 13+ and macOS 10.15+, use CGAnimateImageAtURLWithBlock instead. AnimatedGIF

🌠 A small UIImage extension with gif support
🌠 A small UIImage extension with gif support

🌠 A small UIImage extension with gif support

IOS UIImage processing functions using the vDSP/Accellerate framework for speed.

UIImage Image Processing extensions using the vDSP/Accelerate framework.

A view controller for iOS that allows users to crop portions of UIImage objects
A view controller for iOS that allows users to crop portions of UIImage objects

TOCropViewController TOCropViewController is an open-source UIViewController subclass to crop out sections of UIImage objects, as well as perform basi

Convert UIImage to ASCII art
Convert UIImage to ASCII art

BKAsciiImage As seen on Cmd.fm iOS App https://itunes.apple.com/app/cmd.fm-radio-for-geeks-hackers/id935765356 Installation BKAsciiImage is available

An NSFW image detector for Swift built as an extension on UIImage.

Swift_NSFW_Detector An NSFW image detector for Swift built as an extension on UIImage. If you've ever allowed users to share images you are probably w

Releases(1.2.0)
Owner
Dmytro Mishchenko
Dmytro Mishchenko
A convenient class usable from UIKit view controller or SwiftUI to scan document & get UIImage or PDFDocument as result - Replacement of IRLDocumentScanner

Super easy SwiftUI & UKKit pakcage to scan: Images or PDF. It is also a replacement for IRLScannerViewController

MARTIN Denis 8 Oct 8, 2022
A simple generator of PDF written in Swift.

Features | Requirements | Installation | Usage | Communication | LICENSE PDFGenerator PDFGenerator is a simple PDF generator that generates with UIVie

Suguru Kishimoto 712 Dec 29, 2022
SimplePDF is a wrapper of UIGraphics PDF context written in Swift.

SimplePDF is a wrapper of UIGraphics PDF context written in Swift. You can: add texts, images, spaces and lines, table set up page layout, adjust cont

Nutchaphon Rewik 238 Dec 29, 2022
An iOS PDF viewer and annotator written in Swift that can be embedded into any application.

Requirements iOS 9 or above Xcode 8 or above Swift 3.0 Note This project is still in early stages. Right now the PDF reader works both programmaticall

UXM Studio 269 Dec 11, 2022
PDF Reader Core for iOS

PDF Reader Core for iOS This project is no longer supported or maintained. It is only here for historical reasons. Please see the UXReader PDF Framewo

Julius Oklamcak 4.3k Jan 6, 2023
PDF generator using UIViews or UIViews with an associated XIB

Description Create UIView objects using any method you like, including interface builder with Auto-layout and size classes enabled. Then generate a PD

null 34 Dec 17, 2022
Generate beautiful .pdf Files from xib

Description The Library generates a PDF directly from interface builder with Auto-layouted views! Swift Version of UIView_2_PDF. Installation Download

Simon C. Krüger 16 Dec 17, 2022
TPPDF is a simple-to-use PDF builder for iOS

TPPDF is a fast PDF builder for iOS & macOS using simple commands to create advanced documents! Created and maintained by Philip Niedertscheider and a

techprimate 582 Jan 6, 2023
Estrutura Simples para Navegacao Web e Download PDF

Download-PDF-WebView Projeto desenvolvido em Swift com a função de criar uma estrutura simples para navegação Web em seu Aplicativo, permitindo a visu

Josué Rodrigues 1 Nov 30, 2021
PdfBuilder: a swift library made to make creation of the Pdf file from code simpler

PdfBuilder PdfBuilder is a swift library made to make creation of the Pdf file f

null 4 Jul 22, 2022