Skip to content

Commit

Permalink
Merge pull request #206 from techprimate/release/2.0.1
Browse files Browse the repository at this point in the history
Release/2.0.1
  • Loading branch information
Philip Niedertscheider committed May 31, 2020
2 parents c3aa6f1 + dcf1859 commit 848d33a
Show file tree
Hide file tree
Showing 213 changed files with 808 additions and 6,775 deletions.
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,28 @@

**Implemented enhancements:**

- Added deprecation for JSON representation
**Fixed bugs:**

**Closed issues:**

**Merged pull requests:**


## [2.0.1](https://github.com/techprimate/TPPDF/tree/2.0.1) (2020-05-31)
[Full Changelog](https://github.com/techprimate/TPPDF/compare/2.0.0...2.0.1)

**Implemented enhancements:**

- Removed JSON representation
- Added deprecation for `table.generateCells`

**Fixed bugs:**

- Missing page break after space which overlaps page end (#204)

**Closed issues:**

**Merged pull requests:**
- #204

## [2.0.0](https://github.com/techprimate/TPPDF/tree/2.0.0) (2020-05-19)
[Full Changelog](https://github.com/techprimate/TPPDF/compare/1.6.0...2.0.0)
Expand Down
26 changes: 13 additions & 13 deletions Example iOS-SwiftPM/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,23 @@
D498551D2461FB0B00D54270 /* Examples */ = {
isa = PBXGroup;
children = (
D498551E2461FB0B00D54270 /* PaginationExampleFactory.swift */,
D498551F2461FB0B00D54270 /* TableOfContentsExampleFactory.swift */,
D49855202461FB0B00D54270 /* TableExampleFactory.swift */,
D49855212461FB0B00D54270 /* LineSeparatorExampleFactory.swift */,
D49855222461FB0B00D54270 /* TextStylesExampleFactory.swift */,
D49855232461FB0B00D54270 /* MultiSectionExampleFactory.swift */,
D49855552461FB9A00D54270 /* Examples.swift */,
D498552B2461FB0B00D54270 /* ExperimentFactory.swift */,
D49855262461FB0B00D54270 /* ExternalDocumentExampleFactory.swift */,
D49855242461FB0B00D54270 /* GroupExampleFactory.swift */,
D49855252461FB0B00D54270 /* HeaderFooterExampleFactory.swift */,
D49855262461FB0B00D54270 /* ExternalDocumentExampleFactory.swift */,
D49855272461FB0B00D54270 /* MultipleDocumentsExampleFactory.swift */,
D49855282461FB0B00D54270 /* ListExampleFactory.swift */,
D49855292461FB0B00D54270 /* TextExampleFactory.swift */,
D498552A2461FB0B00D54270 /* ObjectAttributesExampleFactory.swift */,
D498552B2461FB0B00D54270 /* ExperimentFactory.swift */,
D498552C2461FB0B00D54270 /* ImageExampleFactory.swift */,
D49855212461FB0B00D54270 /* LineSeparatorExampleFactory.swift */,
D49855282461FB0B00D54270 /* ListExampleFactory.swift */,
D498552D2461FB0B00D54270 /* MetadataExampleFactory.swift */,
D49855552461FB9A00D54270 /* Examples.swift */,
D49855272461FB0B00D54270 /* MultipleDocumentsExampleFactory.swift */,
D49855232461FB0B00D54270 /* MultiSectionExampleFactory.swift */,
D498552A2461FB0B00D54270 /* ObjectAttributesExampleFactory.swift */,
D498551E2461FB0B00D54270 /* PaginationExampleFactory.swift */,
D49855202461FB0B00D54270 /* TableExampleFactory.swift */,
D498551F2461FB0B00D54270 /* TableOfContentsExampleFactory.swift */,
D49855292461FB0B00D54270 /* TextExampleFactory.swift */,
D49855222461FB0B00D54270 /* TextStylesExampleFactory.swift */,
);
path = Examples;
sourceTree = "<group>";
Expand Down
5 changes: 5 additions & 0 deletions Shared iOS/UI/ExamplesListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import UIKit

class ExamplesListViewController: UITableViewController {

override func viewDidAppear(_ animated: Bool) {
super.viewDidLoad()
//performSegue(withIdentifier: "show-example", sender: IndexPath(row: 0, section: 1))
}

override func numberOfSections(in tableView: UITableView) -> Int {
return Examples.factories.count
}
Expand Down
3 changes: 3 additions & 0 deletions Shared/Examples/TextExampleFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class TextExampleFactory: ExampleFactory {
document.set(font: UIFont.italicSystemFont(ofSize: 13))
document.add(text: LoremIpsum.get(words: 100))

document.add(space: 300)
document.add(text: "Test text here")

return [document]
}
}
2 changes: 1 addition & 1 deletion Source/API/Graphics/PDFLineStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
/**
This struct defines how a line or border of a table is drawn.
*/
public struct PDFLineStyle: PDFJSONSerializable {
public struct PDFLineStyle {

/**
Defines the type of this line
Expand Down
21 changes: 0 additions & 21 deletions Source/API/Graphics/PDFLineType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,3 @@ public enum PDFLineType {
case dotted

}

// MARK: - JSON Serialization

extension PDFLineType: PDFJSONSerializable {

/**
Creates a serializable object
*/
public var JSONRepresentation: AnyObject {
switch self {
case .none:
return 0 as AnyObject
case .full:
return 1 as AnyObject
case .dashed:
return 2 as AnyObject
case .dotted:
return 3 as AnyObject
}
}
}
2 changes: 1 addition & 1 deletion Source/API/Groups/PDFGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import UIKit
/**
TODO: Documentation
*/
public class PDFGroup: PDFJSONSerializable {
public class PDFGroup {

// MARK: - PUBLIC VARS

Expand Down
21 changes: 0 additions & 21 deletions Source/API/Groups/PDFGroupContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,3 @@ public enum PDFGroupContainer {
}
}
}

// MARK: - JSON Serialization

extension PDFGroupContainer: PDFJSONSerializable {

/**
Creates a representable object
*/
public var JSONRepresentation: AnyObject {
switch self {
case .none:
return 0 as AnyObject
case .left:
return 1 as AnyObject
case .center:
return 2 as AnyObject
case .right:
return 3 as AnyObject
}
}
}
2 changes: 1 addition & 1 deletion Source/API/Image/PDFImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
/**
Image element for the PDF document. Contains all information about an image, including the caption.
*/
public class PDFImage: PDFDocumentObject, PDFJSONSerializable {
public class PDFImage: PDFDocumentObject {

/**
The actual image
Expand Down
19 changes: 0 additions & 19 deletions Source/API/Image/PDFImageSizeFit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,3 @@ public enum PDFImageSizeFit {
case widthHeight

}

// MARK: - JSON Serialization

extension PDFImageSizeFit: PDFJSONSerializable {

/**
Creates representable object
*/
public var JSONRepresentation: AnyObject {
switch self {
case .width:
return 0 as AnyObject
case .height:
return 1 as AnyObject
case .widthHeight:
return 2 as AnyObject
}
}
}
33 changes: 0 additions & 33 deletions Source/API/Layout/PDFContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,36 +130,3 @@ public enum PDFContainer: CaseIterable {
]
}
}

// MARK: - JSON Serialization

extension PDFContainer: PDFJSONSerializable {

/**
Creates a representable object
*/
public var JSONRepresentation: AnyObject {
switch self {
case .none:
return 0 as AnyObject
case .headerLeft:
return 1 as AnyObject
case .headerCenter:
return 2 as AnyObject
case .headerRight:
return 3 as AnyObject
case .contentLeft:
return 4 as AnyObject
case .contentCenter:
return 5 as AnyObject
case .contentRight:
return 6 as AnyObject
case .footerLeft:
return 7 as AnyObject
case .footerCenter:
return 8 as AnyObject
case .footerRight:
return 9 as AnyObject
}
}
}
2 changes: 1 addition & 1 deletion Source/API/Layout/PDFPageLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
/**
Contains all relevant layout informations of a pdf document
*/
public struct PDFPageLayout: PDFJSONSerializable {
public struct PDFPageLayout {

// MARK: - PUBLIC VARS

Expand Down
2 changes: 1 addition & 1 deletion Source/API/List/PDFList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
/**
TODO: Documentation
*/
public class PDFList: PDFDocumentObject, PDFJSONSerializable {
public class PDFList: PDFDocumentObject {

/**
TODO: Documentation
Expand Down
21 changes: 0 additions & 21 deletions Source/API/List/PDFListItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,6 @@ public class PDFListItem: PDFDocumentObject {
}
}

extension PDFListItem: PDFJSONSerializable {

/**
TODO: documentation
*/
public var JSONRepresentation: AnyObject {
var representation: [String: AnyObject] = [:]
if let content = content {
representation["content"] = content as AnyObject
}
representation["symbol"] = symbol.JSONRepresentation

if let children = children {
let result = children.map(\.JSONRepresentation) as AnyObject

representation["children"] = result
}
return representation as AnyObject
}
}

extension PDFListItem: CustomDebugStringConvertible {

public var debugDescription: String {
Expand Down
9 changes: 1 addition & 8 deletions Source/API/List/PDFListItemSymbol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
TODO: documentation
*/
public enum PDFListItemSymbol: RawRepresentable, PDFJSONSerializable {
public enum PDFListItemSymbol: RawRepresentable {

/**
TODO: documentation
Expand Down Expand Up @@ -112,11 +112,4 @@ public enum PDFListItemSymbol: RawRepresentable, PDFJSONSerializable {
}
}
}

/**
TODO: documentation
*/
public var JSONRepresentation: AnyObject {
self.rawValue as AnyObject
}
}
2 changes: 1 addition & 1 deletion Source/API/Metadata/PDFInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
/**
Information saved in PDF file metadata.
*/
public class PDFInfo: PDFJSONSerializable {
public class PDFInfo {

/**
Title of document.
Expand Down
4 changes: 1 addition & 3 deletions Source/API/PDFDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
/**
The main class users interact with.
This object holds the information about the document and also all PDF objects.
It is possible to create a JSON representation using the `PDFJSONSerializable` protocol.
*/
public class PDFDocument: CustomStringConvertible, PDFJSONSerializable {
public class PDFDocument: CustomStringConvertible {

// MARK: - PUBLIC VARS

Expand Down
2 changes: 1 addition & 1 deletion Source/API/Section/PDFSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
/**
TODO: Documentation
*/
public class PDFSection: PDFDocumentObject, PDFJSONSerializable {
public class PDFSection: PDFDocumentObject {

/**
List of section columns.
Expand Down
2 changes: 1 addition & 1 deletion Source/API/Section/PDFSectionColumn.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
/**
TODO: Documentation
*/
public class PDFSectionColumn: PDFDocumentObject, PDFJSONSerializable {
public class PDFSectionColumn: PDFDocumentObject {

// MARK: - PUBLIC VARS

Expand Down
2 changes: 1 addition & 1 deletion Source/API/Table Of Content/PDFTableOfContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal typealias WeakPDFTextStyleRef = WeakRef<PDFTextStyle>
/**
TODO: Documentation
*/
public class PDFTableOfContent: PDFDocumentObject, PDFJSONSerializable {
public class PDFTableOfContent: PDFDocumentObject {

/**
TODO: Documentation
Expand Down
19 changes: 2 additions & 17 deletions Source/API/Table/Content/PDFTableContent+ContentType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extension PDFTableContent {
/**
TODO: Documentation
*/
internal enum ContentType: PDFJSONSerializable {
internal enum ContentType {

/**
TODO: Documentation
Expand All @@ -34,21 +34,6 @@ extension PDFTableContent {
TODO: Documentation
*/
case image

/**
TODO: Documentation
*/
internal var JSONRepresentation: AnyObject {
switch self {
case .none:
return 0 as AnyObject
case .string:
return 1 as AnyObject
case .attributedString:
return 2 as AnyObject
case .image:
return 3 as AnyObject
}
}

}
}
2 changes: 1 addition & 1 deletion Source/API/Table/Content/PDFTableContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
/**
TODO: Documentation
*/
public class PDFTableContent: PDFJSONSerializable {
public class PDFTableContent {

/**
TODO: Documentation
Expand Down
2 changes: 1 addition & 1 deletion Source/API/Table/PDFTable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import UIKit
A table is a two dimensional list.
It can be styled and can contain different data.
*/
public class PDFTable: PDFDocumentObject, PDFJSONSerializable {
public class PDFTable: PDFDocumentObject {

/**
Styling used for drawing
Expand Down

0 comments on commit 848d33a

Please sign in to comment.