Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RobertAPhillips/UIView_2_PDF
PDF generator using UIViews or UIViews with an associated XIB
https://github.com/RobertAPhillips/UIView_2_PDF
Last synced: 3 months ago
JSON representation
PDF generator using UIViews or UIViews with an associated XIB
- Host: GitHub
- URL: https://github.com/RobertAPhillips/UIView_2_PDF
- Owner: RobertAPhillips
- License: mit
- Created: 2013-12-17T16:45:38.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-30T10:51:12.000Z (about 9 years ago)
- Last Synced: 2024-04-24T19:02:10.654Z (6 months ago)
- Language: Objective-C
- Size: 236 KB
- Stars: 35
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - UIView 2 PDF - PDF generator using UIViews or UIViews with an associated XIB. (Media / PDF)
- awesome-ios-star - UIView 2 PDF - PDF generator using UIViews or UIViews with an associated XIB. (Media / PDF)
README
## 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
```objective-c
UIView *pageOne = [[NSBundle mainBundle] loadNibNamed:@"NibNameOne" owner:self options:nil].lastObject;
UIView *pageTwo = [[NSBundle mainBundle] loadNibNamed:@"NibNameTwo" owner:self options:nil].lastObject;
```
3. Then generate your PDF like this
```objective-c
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.