Save html web pages as pdf files

Table of Contents

  1. Note
  2. Intro
  3. Print

Go to End

-> Top

Note

4/5/2024: Created.

-> Top

Intro

When using Windows' print function, many pdf apps installed can be selected to print html web pages as pdf files. However, not all pdf apps can keep the hypertext links in html web pages such that clicking the links in the pdf files can direct to the linked web pages.

Furthermore, the default header and footer cannot be modified.

This page shows how to resolve the problems.

-> Top

Print

Open web browser.

Choose web page.

Enter Ctrl-P to show dialog.

Select:

  • Destination: Save as PDF.
  • Margins: Custom (i.e. previously used):
    • Drag the margin borders on the left to give 15 mm margins around (if not previously used).
  • Scale: Default (i.e. 100%).
  • Option: Background graphics (so as to print highlight colours).

Do not select: 

  • Headers and footers (so as not to use the default).

Select Save to save to pdf file. Note that the Table of Contents is included.

Use Wondershare PDFelement to open the pdf file.

May use other pdf apps with editing capability.

Select Edit > Header & Footer > Add Header & Footer

Select top left corner position,

enter left header content,

select font type and font size, and

adjust the margin widths:

Select top right corner position,

enter right header content, and

select font type and font size:

Select Date style below and Add to add to the above content: 

Select bottom left corner position,

enter left footer content, and

select font type and font size:

Select bottom right corner position,

enter right footer content, and

select font type and font size:

Select Page number style below and Add to add to the above content: 

Select Add to template, and Apply:
 

All the pages of one pdf file for one web page will have the same header and footer:

The above will save one web page only.

To save the whole book of linked web pages, use Printer-Friendly function.

The Printer-Friendly function is intended to simplify the printout to have less formatting and colours, but this website has defined to have more formatting and colours.

Select Printer-friendly version on the top right of the front web page:

This page and all the linked pages after it will be displayed, except the Table of Contents because the Table of Contents function used by this website cannot be recognised by the Printer-Friendly function. How to set it to make it possible will be investigated.

Scroll up the linked pages to see that photos embedded in the pages are fully shown. They may take time to show up for the first time.

Add Header & Footer as the above. However, if a template has been saved before, select Add From Template:

 

Select the desired custom template to assign all the header & footer by one click, and select Apply:

The thumbnail image of the custom template also has options to edit or delete the template.

All the pages of one pdf file for all the linked web pages will have the same header and footer:

(this example has one web page only)
 

End of Page

-> Top

Back to top with progress scrollbar