Adding Page Numbers to the Footer in Google Docs

I love Google Docs. I use it all the time for just about everything from writing articles to formatting ebooks.

But when working on ebooks, I always had to download them into Open Office before exporting them as PDFs to add page numbers in the footer.

Then someone sent me link to their Google Doc file to help them with, and when I PDFed it to print out, IT HAD PAGE NUMBERS! Ok, maybe you’re not as excited as I was, but it really doesn’t take much to make me giddy.

I figured I had missed a menu item, so I wasted an inordinate amount of time looking for anything in the menu system of Google Docs that might add a page number.

No luck. But then under the edit menu, I unexpectedly hit upon the answer. I clicked on Edit HTML and scrolled down to the bottom of the document, and there it ws… span tags that will magically add page numbers, and/or a total page count to each page of your PDF when it’s exported.

Inside the DIV tag with the class=google_footer you can include one or both of these tags:
<span class=”google_pagenumber”>1</span>
(which will show the actual page number on your PDF, even though there’s a number 1 inside the tags.)
<span class=”google_pagecount”>1</span>
(which once again needs a 1 there in the document, but will actually show how many pages are in your document when it’s exported as a PDF.

So, if you wanted to add Page 5 of 150, for example, in your footer, you would add :
Page <span class=”google_pagenumber”>1</span> of <span class=”google_pagecount”>1</span>
in the footer.

While your fiddling with the HTML anyway, you can style the footer Div with a border-top or background color, or other neato stuff.

I used Google Docs to create the entire PDF I’m giving away as a newsletter signup bonus at PublishingCentral.com

The page numbers showed up great. Now if only I could get the TOC to work reliably, I’d love Google forever.




You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

6 Responses to “Adding Page Numbers to the Footer in Google Docs”

  1. poker heaven rakeback Says:

    This is a really awesome entry. I found your blog from yahoo while searching a similar subject matter. I really liked what you had to say. Keep up the good work!

  2. Chanel bags Says:

    Your point is valueble for me. Thanks!…

  3. Mihkel Putrinš Says:

    And HTML view is not there any more…
    Interesting, what happens with documents with custom HTML in new environment?

  4. berberama Says:

    HTML view? No such thing in Google Docs.

  5. Watch The X Factor – Season 1, Episode 15: LIVE Performance Show #3 Says:

    Watch The X Factor – Season 1, Episode 15: LIVE Performance Show #3…

    [...]Surf the Mind » Adding Page Numbers to the Footer in Google Docs[...]…

  6. [financing health care|ghanaian economy|primary health care|primary health care services|reproductive health care|sanitation problems|wikipedia the free encyclopedia|women with disabilities] Says:

    [financing health care|ghanaian economy|primary health care|primary health care services|reproductive health care|sanitation problems|wikipedia the free encyclopedia|women with disabilities]…

    [...]Surf the Mind » Adding Page Numbers to the Footer in Google Docs[...]…

Leave a Reply