How to make a HTML Page in A4 paper size page(s)?

前端 未结 15 1994
有刺的猬
有刺的猬 2020-11-22 16:30

Is it possible to make a HTML page behave, for example, like a A4-sized page in MS Word?

Essentially, I want to be able to show the HTML page in the browser, and out

15条回答
  •  野性不改
    2020-11-22 17:23

    Technically, you could, but it would take a lot of work to get all browsers to print out the page exactly as it is displayed on screen. Also, most browsers force the URL, print date and page numbering on the print-out, which is not always desired. This cannot be altered or disabled.

    Instead, I would advise to create a PDF based on the contents on screen and serve the PDF for downloading and/or printing. Although most available PDF libraries are paid, there are a few free alternatives available for creating basic PDFs.

提交回复
热议问题