Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corresponding to binary(NSData) and image ref(CGImage) #11

Closed
sgr-ksmt opened this issue Feb 18, 2016 · 0 comments · Fixed by #12
Closed

Corresponding to binary(NSData) and image ref(CGImage) #11

sgr-ksmt opened this issue Feb 18, 2016 · 0 comments · Fixed by #12
Milestone

Comments

@sgr-ksmt
Copy link
Owner

Add support for binary and image ref newly.

Todo

  • Add PDFPage type.
public enum PDFPage {
    case WhitePage(CGSize)
    case View(UIView)
    case Image(UIImage)
    case ImagePath(String)
    case Binary(NSData) // Add
    case ImageRef(CGImageRef) // Add
}
  • Add draw process for binary and image ref in order to render pdf page.
    (Consider to manage memory when convert binary or image ref to image.)
  • Add convenience methods.
  • Add new unit test.

Sample(expectation)

    let imageData = NSData(contentsOfFile: imagePath)!
    let imageData2 = NSData(contentsOfFile: imagePath2)!
    let pdfData = try! PDFGenerator.generate([imageData1, imageData2])
    let pdfData = try! PDGenerator.generate([
        PDFPage(.Binary(imageData)),
        PDFPage(.ImageRef(imageref))
    ])
@sgr-ksmt sgr-ksmt added this to the v1.1.0 milestone Feb 18, 2016
sgr-ksmt added a commit that referenced this issue Feb 20, 2016
sgr-ksmt added a commit that referenced this issue Feb 20, 2016
@sgr-ksmt sgr-ksmt mentioned this issue Feb 20, 2016
sgr-ksmt added a commit that referenced this issue Feb 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant