iOS-htmltopdf icon indicating copy to clipboard operation
iOS-htmltopdf copied to clipboard

Swift compatible?

Open vin-the-dev opened this issue 9 years ago • 0 comments

I tried it in my swift project and it seems to crash every time, I tried both createPDFWithHTML and NDHTMLtoPDF.createPDFWithHTML, with no luck

let PDFCreator = NDHTMLtoPDF.createPDFWithHTML(htmlString.readString(), baseURL: NSURL(fileURLWithPath: htmlString.path_string), pathForPDF: toFile, pageSize: CGSizeMake(595.2,841.8), margins: UIEdgeInsetsMake(10, 5, 10, 5), successBlock: nil, errorBlock: nil)

    print("open " + toFile)

    NDHTMLtoPDF.createPDFWithHTML(htmlString.readString(),
        baseURL: NSURL(fileURLWithPath: htmlString.path_string),
        pathForPDF: toFile,
        delegate: nil,
        pageSize: CGSizeMake(595.2,841.8),
        margins: UIEdgeInsetsMake(10, 5, 10, 5))

vin-the-dev avatar Feb 17 '16 11:02 vin-the-dev