Skip to content

devgeek27/ViewToPDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Igor Ananiev
Feb 6, 2013
3b11514 · Feb 6, 2013

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ViewToPDF

iOS Component which generates PDF file from a view.

Supported UI components

  • UIView with background color and subviews
  • UILabel with text and background colors
  • UIImageView with image or background color

Instalation

  1. Add CoreText framework to the project.
  2. Add ViewToPDF.m and ViewToPDF.h files to the project.
  3. Include (#import) ViewToPDF.h file to the ViewController from which you would like to render PDF file.

Properties

  1. NSString *fullPDFPath - full path to the rendered PDF file

Methods

  1. initWithView:(UIView*)view andPDFFileName:(NSString*)PDFFileName parameters: 1.1 view - UIView to render PDF from 1.2 PDFFileName - name of the PDF file

  2. render - render PDF file from specified view

Example

// Create and instance of viewToPDF
ViewToPDF *viewToPDF = [[ViewToPDF alloc] initWithView:self.reportView andPDFFileName:@"my_pdg.pdf"];
// Render method renders PDF file from the reportView view
[viewToPDF render];
// This property showf the full path to rendered PDF file
NSLog(@"PDF File path: %@",viewToPDF.fullPDFPath);

About

iOS Component which generates PDF file from a view

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published