PDF generator using UIViews or UIViews with an associated XIB

Related tags

PDF UIView_2_PDF
Overview

Description

Create UIView objects using any method you like, including interface builder with Auto-layout and size classes enabled. Then generate a PDF directly from those views!

Requirements

XCode 6.4+, iOS 7.0+

Installation

In XCode, select 'Add Files To Project', and select RP_UIView_2_PDF.h

Usage

  1. Make a xib file. Your xib file should only consist of UILabels and/or UIImageViews and/or other UIView subviews. Use views that are 1 pixel high or wide to create lines. Set the tag of a UIView to 1 to have it draw filled or zero to draw as just a 1 pixel bordered box.
  2. Load your xib like so
UIView *pageOne = [[NSBundle mainBundle] loadNibNamed:@"NibNameOne" owner:self options:nil].lastObject;
UIView *pageTwo = [[NSBundle mainBundle] loadNibNamed:@"NibNameTwo" owner:self options:nil].lastObject;
  1. Then generate your PDF like this
NSString *tempFilepath = [RP_UIView_2_PDF generatePDFWithPages:@[pageOne, pageTwo];

See demo project for details.

License

UIView_2_PDF is released under the MIT license. See 'LICENCE.md' for details.

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

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

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

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

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

Type-Safe Associated Objects in Swift

Type-Safe Associated Objects in Swift TSAO is an implementation of type-safe associated objects in Swift. Objective-C associated objects are useful, b

This UI attempts to capture the Quibi Card Stack and the associated User Interaction.
This UI attempts to capture the Quibi Card Stack and the associated User Interaction.

RGStack This UI attempts to capture the Quibi Card Stack and the associated User Interaction. Required A View that conforms to the ConfigurableCard pr

URLScheme router than supports auto creation of UIViewControllers for associated url parameters to allow creation of navigation stacks

IKRouter What does it do? Once you have made your UIViewControllers conform to Routable you can register them with the parameters that they represent

JSONExport is a desktop application for Mac OS X which enables you to export JSON objects as model classes with their associated constructors, utility methods, setters and getters in your favorite language.
JSONExport is a desktop application for Mac OS X which enables you to export JSON objects as model classes with their associated constructors, utility methods, setters and getters in your favorite language.

JSONExport JSONExport is a desktop application for Mac OS X written in Swift. Using JSONExport you will be able to: Convert any valid JSON object to a

Creates a DatePickerTextField which shows a TextField associated with a DatePicker
Creates a DatePickerTextField which shows a TextField associated with a DatePicker

SwiftUI.DatePickerTextField This app creates a DatePickerTextField which shows a TextField associated with a DatePicker. When the TextField gets focus

Protocol-oriented UITableView management, powered by generics and associated types.

DTTableViewManager Features Powerful mapping system between data models and cells, headers and footers Automatic datasource and interface synchronizat

Fineride - An iOS application for managing one's vehicles and their associated maintenance

FineRide An iOS application for managing one's vehicles and their associated mai

Protocol-oriented UICollectionView management, powered by generics and associated types.

DTCollectionViewManager Features Powerful mapping system between data models and cells, headers and footers Automatic datasource and interface synchro

RetroVisor helps you with inspecting UIViews in your unit tests.

RetroVisor RetroVisor helps you with inspecting UIViews in your unit tests. You do test views in unit tests, right? Right? Usually, I mark subview pro

A Swift mixin for reusing views easily and in a type-safe way (UITableViewCells, UICollectionViewCells, custom UIViews, ViewControllers, Storyboards…)
A Swift mixin for reusing views easily and in a type-safe way (UITableViewCells, UICollectionViewCells, custom UIViews, ViewControllers, Storyboards…)

Reusable A Swift mixin to use UITableViewCells, UICollectionViewCells and UIViewControllers in a type-safe way, without the need to manipulate their S

Enables you to hide ur UIViews and make them screen/screen shot proof. objective c/c++ only

SecureView Enables you to hide ur UIViews and make them screen/screen shot proof. objective c/c++ only Usage UIWindow* mainWindow; - (void) setup {

Comments
  • Minor Refactoring. Simple Modernisation and more concise/direct ReadMe.

    Minor Refactoring. Simple Modernisation and more concise/direct ReadMe.

    Hi Rob!

    A client is asking me for some PDF related tasks and I remembered a while back that you submitted this code to the public domain. It's still impressive today and I figured I should make some sort of contribution to the effort.

    Granted, all I have done is clean it up a bit. The logic is still sound. One thing I did notice, is that the preview controller wasn't working properly in modern devices, so just using web view for now. It's only a demo project anyway. The real meat, is in your class that does the drawing.

    Other changes include simple modernisation of the build settings, courtesy of Xcode 7 wizard. Also enabled size classes.

    I cut down the read me file so that it's easier on the eye and straight to the point. Hope that's ok. Also removed the debugging feature because it seemed to only be necessary during development i.e. the code is stable now.

    If your happy with all this then please merge into your master branch. I look forward to any updates you do to this code. I'm 'watching' this repo so I will be notified!

    opened by ghost 7
Owner
null
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

Dimension 1.2k Dec 22, 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
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

Kushagra Chandra 6 Nov 22, 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
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
UIImage PDF extensions.

UIImagePlusPDF UIImage extensions to use PDF files. Using UIImagePlusPDF you can avoid a lot png images files (1x, 2x, 3x sizes) and simply replace ea

Dmytro Mishchenko 35 Jan 4, 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