0

In my application I have one html template which brings dynamic data from DB. I need to convert that html file(template) to PDF. Is there any package to convert the raw html to PDF in node.js? I go through with pdfcrowd and livedocx. Both using some webservices for conversion which does not suits for my specification. please suggest some package for converting HTML to PDF in local machine..?

Aarthi Chandrasekaran
  • 569
  • 2
  • 10
  • 21

1 Answers1

-1

Go through this link..

Here u can convert HTML file to PDF or HTML content to PDF

import NDHTMLtoPDF.h and NDHTMLtoPDF.m from above source link

pass HTML file path to generate PDF here..

NSURL *targetURL = [NSURL fileURLWithPath:HTMLPath];

Converting HTML to PDF

self.PDFCreator = [NDHTMLtoPDF createPDFWithURL:targetURL
                                     pathForPDF:[[NSString stringWithFormat:@"~/Documents/Sample.pdf"] stringByExpandingTildeInPath]
                                       delegate:self
                                       pageSize:kPaperSizeA4
                                        margins:UIEdgeInsetsMake(20, 5, 90, 5)];

pass HTML Content to generate PDF here..

NSString *str_PDFName_path = [NSString stringWithFormat:@"~/Documents/Sample.pdf"];
self.PDFCreator = [NDHTMLtoPDF createPDFWithHTML:str_HTML pathForPDF:[str_PDFName_path stringByExpandingTildeInPath] delegate:self pageSize:kPaperSizeA4 margins:UIEdgeInsetsMake(20, 5, 90, 5)];
Hulk1991
  • 3,079
  • 13
  • 31
  • 46
Lokesh Chowdary
  • 816
  • 5
  • 22