radu2501 / nativescript-html2pdf

Allows easy conversion from HTML to PDF files.
1 stars 0 forks source link

Error: Unknown error. Cannot get error message. #2

Open AsrarMemon opened 6 years ago

AsrarMemon commented 6 years ago

i add nativescript-html2pdf module using

tns plugin install nativescript-html2pdf

this command.. and code

import { Component,ElementRef , ViewChild} from "@angular/core";
import { html2PdfFile } from 'nativescript-html2pdf/html2pdf'';
import * as fs from "tns-core-modules/file-system";

@Component({
    selector: "ns-app",
    templateUrl: "app.component.html",
})

export class AppComponent { 
    constructor() {
        let myHtml: string = '<p>Hello World</p>';
        let pdfPath: string = fs.knownFolders.documents().getFile('myPdf.pdf').path;      
        html2PdfFile(myHtml, pdfPath);
    }
}

get error

Error: Unknown error. Cannot get error message

can you please help me how to use this plugin