Skip to content

Commit

Permalink
Merge branch 'release/1.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
philprime committed Mar 13, 2019
2 parents f42f4ec + 748edfe commit fb7173b
Show file tree
Hide file tree
Showing 11 changed files with 797 additions and 730 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@

**Merged pull requests:**

## [1.3.3](https://github.com/techprimate/TPPDF/tree/1.3.3) (2019-03-13)
[Full Changelog](https://github.com/techprimate/TPPDF/compare/1.3.2...1.3.3)

**Implemented enhancements:**

- Changed accessibility of `PDFGenerator`

**Closed issues:**

- #101
- #103
- #108
- #109
- #111
- #113
- #114


**Merged pull requests:**

- PR #106 [by protspace]
- PR #119 [by yhelfronda]

## [1.3.2](https://github.com/techprimate/TPPDF/tree/1.3.2) (2019-01-22)
[Full Changelog](https://github.com/techprimate/TPPDF/compare/1.3.1...1.3.2)

Expand Down
1,396 changes: 679 additions & 717 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/TPPDF.xcscheme

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Example/TPPDF.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@
};
D49CB2DC21C7EAD200CDCE70 = {
CreatedOnToolsVersion = 10.1;
DevelopmentTeam = 4N4ASZ575M;
DevelopmentTeam = 8REJWL5T8N;
LastSwiftMigration = 1010;
ProvisioningStyle = Automatic;
TestTargetID = 607FACCF1AFB9204008FA782;
Expand Down Expand Up @@ -1051,7 +1051,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 4N4ASZ575M;
DEVELOPMENT_TEAM = 8REJWL5T8N;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = TPPDF_Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
Expand Down Expand Up @@ -1082,7 +1082,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 4N4ASZ575M;
DEVELOPMENT_TEAM = 8REJWL5T8N;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = TPPDF_Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
Expand Down
4 changes: 3 additions & 1 deletion Example/TPPDF/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ class ViewController: UIViewController {

// Add an image and scale it down. Image will not be drawn scaled, instead it will be scaled down and compressed to save file size.
// Also you can define a quality in percent between 0.0 and 1.0 which is the JPEG compression quality. This is applied if the option `compress` is set.
let logoImage = PDFImage(image: UIImage(named: "Icon.png")!, size: CGSize(width: 150, height: 150), quality: 0.9, options: [.resize, .compress])
// Use `none` for better and crisp quality of image. You don't need to set the image quality if you set this option.
// let logoImage = PDFImage(image: UIImage(named: "Icon.png")!, size: CGSize(width: 150, height: 150), quality: 0.9, options: [.resize, .compress])
let logoImage = PDFImage(image: UIImage(named: "Icon.png")!, size: CGSize(width: 150, height: 150), options: [.none])
document.addImage(.contentCenter, image: logoImage)

// Create and add an title as an attributed string for more customization possibilities
Expand Down
1 change: 1 addition & 0 deletions Source/Image/PDFImageOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ public struct PDFImageOptions: OptionSet {

public static let resize = PDFImageOptions(rawValue: 1 << 0)
public static let compress = PDFImageOptions(rawValue: 1 << 1)
public static let none = PDFImageOptions(rawValue: 1 << 2)

}
4 changes: 2 additions & 2 deletions Source/PDFGenerator+Generation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ extension PDFGenerator {
- throws: PDFError
*/
func generatePDFContext(progress: ((CGFloat) -> Void)?) throws {
public func generatePDFContext(progress: ((CGFloat) -> Void)?) throws {
progress?(progressValue)
let renderObjects = try createRenderObjects(progress: progress)
try render(objects: renderObjects, progress: progress)
Expand All @@ -109,7 +109,7 @@ extension PDFGenerator {
- returns: List of renderable objects
*/
func createRenderObjects(progress: ((CGFloat) -> Void)?) throws -> [(PDFContainer, PDFObject)] {
public func createRenderObjects(progress: ((CGFloat) -> Void)?) throws -> [(PDFContainer, PDFObject)] {
// Extract content objects
let contentObjects = PDFGenerator.extractContentObjects(objects: document.objects)
let numContentObjects = contentObjects.count
Expand Down
7 changes: 3 additions & 4 deletions Source/PDFGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class PDFGenerator {
/**
Total page count used for displaying in rendered PDF
*/
var totalPages: Int = 1
public var totalPages: Int = 1

var progressValue: CGFloat = 0

Expand Down Expand Up @@ -68,14 +68,14 @@ public class PDFGenerator {
return defaults
}()

// MARK: - INTERNAL INITS
// MARK: - PUBLIC INITS

/**
Initializes the generator with a document.
- parameter document: The document which will be converted
*/
init(document: PDFDocument) {
public init(document: PDFDocument) {
self.document = document
}

Expand All @@ -88,5 +88,4 @@ public class PDFGenerator {
layout.reset()
currentPage = 1
}

}
2 changes: 1 addition & 1 deletion Source/Table/PDFTableObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class PDFTableObject: PDFObject {
var contentObject: PDFObject?

if let contentImage = content?.imageValue {
contentObject = PDFImageObject(image: PDFImage(image: contentImage))
contentObject = PDFImageObject(image: PDFImage(image: contentImage, options: [.none]))
} else {
var attributedString: NSAttributedString?
if let contentText = content?.stringValue {
Expand Down
2 changes: 1 addition & 1 deletion Source/Utils/PDFObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
All renderable objects subclass from this object.
Each object is first calculated and then drawn.
*/
class PDFObject: PDFJSONSerializable {
public class PDFObject: PDFJSONSerializable {

/**
Frame of this object
Expand Down
2 changes: 1 addition & 1 deletion TPPDF.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'TPPDF'
s.version = '1.3.2'
s.version = '1.3.3'
s.summary = 'TPPDF is a simple-to-use PDF builder for iOS'
s.description = <<-DESC
TPPDF is an object-based PDF builder, completely built in Swift.
Expand Down

0 comments on commit fb7173b

Please sign in to comment.