How can I print a webpage to a PDF in a single, *continuous* page?

15,075

Solution 1

PDF has a defined media size, so you're going to have to do some workarounds:

  1. Set up a custom page size in your printer. I have one, TenLetter, which is 215.9 × 2794 mm, or a sheet the length of 10 US letter pages end to end. It doesn't split unless the whole content is longer than ten pages. It's a pain to view (zoom is your friend) or to print, but it doesn't break any images.

  2. Manually import the static HTML page into a wordprocessor, and do manual page breaks before the images you don't want split.

Automatic pagination is a hard problem, and most browsers aren't that great at implementing printing support. CSS Print Profile is one of those great ideas that almost works for everyone …

Solution 2

I recently had the same need, and did it in two steps:

1) I used the Chrome Screen Capture Extension (https://chrome.google.com/webstore/detail/screen-capture-by-google/cpngackimfmofbokmjmljamhdncknpmg?hl=en) to capture the page in a png

2) I printed the PNG to a PDF

Share:
15,075

Related videos on Youtube

Louis Thibault
Author by

Louis Thibault

Updated on September 18, 2022

Comments

  • Louis Thibault
    Louis Thibault almost 2 years

    I have an ipython notebook that I would like to print without having the page breaks cut through my figures.

    Any suggestions? I tried the "awesome screenshot" extension for chromium, but it was buggy and ended up cutting out half of my page.

    Any suggestions?

    • Admin
      Admin over 11 years
      Try wkhtmltopdf, as suggested here.
    • Admin
      Admin over 11 years
      @Mik, This seems to print over multiple pages, which exactly the problem I'm trying to avoid. Am I missing something?
    • Admin
      Admin over 11 years
      Yes you're right, but something like the gnome-photo plugin for shutter, as discussed here might be useful, but you would have to convert the image to pdf, as the answer below also mentions this relating to the chrome extension.
  • Louis Thibault
    Louis Thibault over 11 years
    this isn't quite doing the trick. The resulting PDF is an 8.5/11" page and it's impossible to zoom in close enough to see anything other than a blur...