'How to Generate a PDF in a Web Application [closed]

I have been struggling few days with PDF generation. I belive HTML to PDF might be the best way for my application. I have tried several methods in C#, JS, and some online APIs to no luck.

This is the template I'm trying to acheive

. [here](https://media.discordapp.net/attachments/707481146610679868/952008859633975396/unknown.png?width=477&height=676)

Could someone help me out, please?

Thanks



Solution 1:[1]

  1. Create a webpage with this layout
  2. Populate the data in the webpage
  3. Get the HTML markup of the webpage
  4. Use a library like HiQPDF, to pass the HTML Data. This should generate the PDF for you

Solution 2:[2]

From C# run a command line like:

cpdf -add-text "300 SAR" -topleft 600 -font "Helvetica" -font-size 14 template.pdf -o step1.pdf

See: https://community.coherentpdf.com/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zee
Solution 2 JBrooks