nRewik / SimplePDF

Create a simple PDF effortlessly. :smile:
MIT License
253 stars 53 forks source link

Issue with compile errors #23

Closed f15radar closed 6 years ago

f15radar commented 6 years ago

I added this to my project, but I m getting compile errors in SimplePDF.swift => drawtext

    let attributes: [NSAttributedStringKey: Any] = [
        .font: font,
        .foregroundColor: textColor,
        .paragraphStyle: paragraphStyle
    ]

Type 'NSString' has no member 'font'

    let attributes: [NSAttributedStringKey: Any] = [
        .foregroundColor: textColor,
        .paragraphStyle: paraStyle,
        .obliqueness: skew,
        .font: font
    ]

Type 'NSString' has no member 'foregroundColor'

Any clues?

nRewik commented 6 years ago

What’s Swift version that you use ?

f15radar commented 6 years ago

Sorry....3.2, I guess I need to update to 4 or do you have a 3 version?

nRewik commented 6 years ago

I think you can use version 3 from the previous release.

Nutchaphon Rewik


From: f15radar notifications@github.com Sent: Tuesday, January 30, 2018 9:56:44 PM To: nRewik/SimplePDF Cc: Nutchaphon Rewik; Comment Subject: Re: [nRewik/SimplePDF] Issue with compile errors (#23)

Sorry....3.2, I guess I need to update to 4 or do you have a 3 version?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/nRewik/SimplePDF/issues/23#issuecomment-361618274, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGRrYRgkvIC8eZfJ-vxnkhSG855bOb4Lks5tPy2rgaJpZM4RxuO7.

f15radar commented 6 years ago

Now I am getting pdf does not have a member writeToFile. I am using v2.0.0

f15radar commented 6 years ago

I got it to compile.....I used

try? pdfData.write(to: path, options: .atomic )

cogsdawgs commented 6 years ago

when I use try? pdfData.write(to: path, options: .atomic) it gives me a URL error. Any easy ways to get around that?