Web page(HTMLCSS) to pdf

hi all

I want know how to convert web page to pdf

How to work library https://github.com/jung-kurt/gofpdf with web page ؟

Step by Step plz

gopdf provides an API for generating a PDF through a series of function calls, e.g.,

pdf.SetFont("Arial", "B", 16)
pdf.Cell(40, 10, "Hello, world")

This is only one half of what you need. You would also need an algorithm that reads and analyses an HTML page and turns its structure into function calls like those above. This is quite a huge task.

Unless your goal is to write this tool in pure Go, the best option (in my opinion) is to make use of external tools. For example, this blog article describes how to use wkhtmltopdf, a command-line tool written in C, to do the conversion.


Thank you . I will try to find another solution

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.