Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 5 generate Html to pdf?

I've 2 questions my project is in ANGULAR 5.

Am looking for a way to generate HTML to PDF. Generated pdf shouldn’t be an image. It should be like the Actual PDF user can copy text etc.

Note: please don't suggest jsPdf.

Another approach is am looking for a way to send the whole HTML with inserted values to an Endpoint. The Html I am trying to send is Only content editable divs.

How can I do this?

Help and suggestion would be appreciated. THanks

like image 256
The Mechanic Avatar asked Feb 17 '18 10:02

The Mechanic


People also ask

How to convert HTML to PDF in angular 12/11?

Angular 12/11 Convert HTML into PDF Tutorial with Example. 1 Step 1 – Create New Angular App. 2 Step 2 – Install Package. 3 Step 3 – Add Code on View File. 4 Step 4 – Add Code On Component ts File. 5 Step 5 – Start Angular App. More items

How to use pdfmake files in angular component or service?

Now to use this files in angular component or service add below import statement on top of component/service PDFMake follows a declarative approach. It basically means, you’ll never have to calculate positions manually or use commands like

How to convert HTML to PDF using NPM?

So, open your terminal and execute the following command: npm install --save pdfmake npm install html-to-pdfmake npm install jspdf --save In this step, create a table and display data on it to convert it to pdf file. So, visit src/app/app.component.html and update the following code into it:

How to generate PDF files in client-side JavaScript?

Generate PDF files in client-side JavaScript. Open the app.component.html file and add the code in it. Open the app.component.ts file and add the code in it. When you hire Angular developers in India, you get a lot of advantages. Hire our Angular developers to create a competitive e-commerce app for you.


1 Answers

You have also this:

https://github.com/moshensky/html-to-pdf-converter

But in my opinion the best way is to send just the data you want to format to a backend service and format it in the backend.

like image 198
Charly Avatar answered Sep 19 '22 04:09

Charly