Google Calendar – printing multiple months or weeks to PDF – URL parameter tips and tricks
Posted by jpluimers on 2010/06/28
Recently, I had to print multiple months or weeks from within Google Calendar.
The default UI does not allow that, but it is in fact pretty easy to do.
These are the steps to get PDF versions of a whole year.
Edit 20100714: thanks to Kilian Croese, I could explain a few more parameters, and cut out the steps for Fiddler, so it now works with most browsers on most platforms.
All text that is not relevant any more is marked deleted, so you can still read it if you want to use Fiddler.
It works from Google Chrome and Internet Explorer on Windows (FireFox works if you install FiddlerHook)
Download, install and start HTTP fiddler 2
(this allows you to see what HTTP traffic takes place between your web-browser and the Google calendar web-server)- Open http://calendar.google.com, login, and browse to a month or week that needs to be in the printing range
- On the left select the calendars you want to see printed
- Click the print link (you’ll get a popup window with an image similar to the one on the right)
In fiddler, look for the URL that looks like this one below, then press Ctrl-U to copy it to the clipboard:
right-click on the calendar image, then copy the URL to the clipboard; it looks like this:
http://www.google.com/calendar/printable?dates=20100621%2F20100628&pgsz=letter&hl=en&ctz=Europe%2FAmsterdam&mode=WEEK&wkst=2&src=ZHUwbHRscGdibjVqODhlbW1uMXZkZnQwMWdAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=YTFkZHFnYjRxMTEwdDY4c2JrcG1pamFxYjRubjZzbzFAaW1wb3J0LmNhbGVuZGFyLmdvb2dsZS5jb20&src=ZHV0Y2hfX2VuQGhvbGlkYXkuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=cCN3ZWVrbnVtQGdyb3VwLnYuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&psdec=true&pft=png&rand=1277562185852
(I’ll explain a bit more about the parameters a few paragraphs downward).- Paste the URL in your favourite text editor
- replace “pgsz=letter” with “pgsz=a4“
- remove the “&pft=png&rand=1277562185852” (so you get a multi-page PDF in stead of a single page PNG)
- replace the
“20100329%2F20100503” with
“20100101%2F20101231” (for exactly one year) or
“20091228%2F20101231” (for a PDF starting on monday 20091228)
I ended up with these URLs:
- MONTH calendar:
http://www.google.com/calendar/printable?dates=20100101%2F20101231&pgsz=a4&hl=en&ctz=Europe%2FAmsterdam&mode=WEEK&wkst=2&src=ZHUwbHRscGdibjVqODhlbW1uMXZkZnQwMWdAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=YTFkZHFnYjRxMTEwdDY4c2JrcG1pamFxYjRubjZzbzFAaW1wb3J0LmNhbGVuZGFyLmdvb2dsZS5jb20&src=ZHV0Y2hfX2VuQGhvbGlkYXkuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=cCN3ZWVrbnVtQGdyb3VwLnYuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&psdec=true - WEEK calendar starting on FRIDAY januari 1st:
http://www.google.com/calendar/printable?dates=20100101%2F20101231&pgsz=a4&hl=en&ctz=Europe%2FAmsterdam&mode=MONTH&wkst=2&src=ZHUwbHRscGdibjVqODhlbW1uMXZkZnQwMWdAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=YTFkZHFnYjRxMTEwdDY4c2JrcG1pamFxYjRubjZzbzFAaW1wb3J0LmNhbGVuZGFyLmdvb2dsZS5jb20&src=ZHV0Y2hfX2VuQGhvbGlkYXkuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=cCN3ZWVrbnVtQGdyb3VwLnYuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&psdec=true - WEEK calendar starting on MONDAY december 28nd:
http://www.google.com/calendar/printable?dates=20091228%2F20101231&pgsz=a4&hl=en&ctz=Europe%2FAmsterdam&mode=MONTH&wkst=2&src=ZHUwbHRscGdibjVqODhlbW1uMXZkZnQwMWdAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=YTFkZHFnYjRxMTEwdDY4c2JrcG1pamFxYjRubjZzbzFAaW1wb3J0LmNhbGVuZGFyLmdvb2dsZS5jb20&src=ZHV0Y2hfX2VuQGhvbGlkYXkuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=cCN3ZWVrbnVtQGdyb3VwLnYuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&psdec=true
Furthermore, https://calendar.google.com/calendar/embedhelper generates a subset of the below parameters for https://calendar.google.com/calendar/embed based URLs.
Hope this helps a few people.
As promised a few notes on the URL parameters (Edit 20100714: thanks Kilian Croese, who toke the time to check out all options in the pop-up window; I marked your additions with “new“):
- src parameters contain base64 encoded numbers referring to the selected calendars
(since these calendars are public, I don’t mind sharing the values with you) - dates=
20100621%2F20100628
holds the start and ending date both ISO 8601 encoded asYYYYMMDD
, separated by a%2F
which is the ASCII code for the slash character (/) - pgsz=
letter
determines the page size (now letter; you can replace this with a4 and probably legal – I’m European, and we like A4) - hl=
en
indicates the language for the calendar; probably ISO 3166-1 encoded
en is English,
nl is Dutch. - ctz=
Europe%2FAmsterdam
Current Time Zone; Google probably uses Java, as I have also seen Africa/Windhoek as a value.
Java has the nice TimeZone.GetAvailableIDs function for which the javaworld.com site has a nice example showing all the time zones. - mode=
WEEK
Print mode. I have seen MONTH and AGENDA here as well.DAY
is also supported (edited 20170726; as per [WayBack] Kai Carver who also mentions these values can be in lower-case at [WayBack] Use a custom URL to get a customized printable version of Google Calendar – Stack Overflow) - wkst=
2
I have no idea what this means :-) - psdec=
true
Prints descriptions declined appointments (true) or not (false) - pft=
png
Print file type is PNG (png) or PDF (leave this parameter away) - rand=
1277562185852
Some random number (looks like a JavaScript EPOCH value; leave it out and google will insert a fresh one. - pfs=
NORMAL
new: Fontsize, with these possible values: SMALLEST, SMALLER, SMALL, NORMAL, BIG, BIGGER, BIGGEST
somehow this make me feel it is related to CSS font sizes. - po=
AUTO
new: Page Orientation, with these possible values: AUTO (seems to always map to LANDSCAPE), PORTRAIT, LANDSCAPE. - pbw=
false
new: Prints in black and white (false) or color (true) - pjs=
false
Insert “Print JavaScript” into the PDF (true) or just loads the PDF (false)
The JavaScript inserted in the PDF looks like this: “/S/JavaScript/JS(this.print\({bUI: true,bSilent: false,bShrinkToFit: true}\);)
“ - pda=
false
Prepare the PDF for download (true) or printing (false)
–jeroen
Sara said
I wanted to get a large range of weeks (~6 months) and it kept coming up with a 5-day week printed on a page. But, when it displayed on the browser window directly from GCal, it showed 7 day weeks. I started, then looking at print ranges beyond 4 weeks. 5 was ok, as was 6, but not 7. So it appears as if you can print 6 weeks at a time in week view, but not more than that.
jpluimers said
Thanks for bringing this up. Did you file a bug report with Google?
Some places to start that:
http://productforums.google.com/forum/#!category-topic/calendar/sharing-and-inviting/r4giSfKpMYo
http://support.google.com/calendar/bin/static.py?hl=en&page=known_issues.cs
http://support.google.com/calendar/bin/request.py
All About Mail said
All About Mail…
[…]Google Calendar – printing multiple months or weeks to PDF « The Wiert Corner – irregular stream of Wiert stuff[…]…
ISO 8601 Date, Time and DateTime in Delphi (was: Simple example to show DateTime.Now in ISO 8601 format on ideone.com | Online C# Compiler & Debugging Tool) « The Wiert Corner – irregular stream of Wiert stuff said
[…] In the past I wrote about a Simple example to show DateTime.Now in ISO 8601 format on ideone.com | Online C# Compiler & Debugging Tool , using ISO 8601 in batch-files, and how ISO 8601 is used in Google Calendar URLs. […]
Simple example to show DateTime.Now in ISO 8601 format on ideone.com | Online C# Compiler & Debugging Tool « The Wiert Corner – irregular stream of Wiert stuff said
[…] Comments Noah on Google Calendar – printi…jpluimers on Removing the VMWare Server SSL…IL on Removing the VMWare Server […]
Noah said
Thanks for this – wish this was built into GCal, but this worked a treat for me!
mcbarley said
Thank you so much…now if only I could get a two-week view to do this…
jpluimers said
That would be nice.
Let me know if you find out how to do that ;-)
–jeroen
Chris said
it looks like wkst means “week start”, i.e., Sunday = 1, Monday = 2, etc.
A few updates to: Google Calendar – printing multiple months or weeks to PDF « The Wiert Corner – Jeroen Pluimers’ irregular stream of Wiert stuff said
[…] Comments jpluimers on Google Calendar – printi…Kilian Croese on Google Calendar – printi…Kilian Croese on Google Calendar – […]
Kilian Croese said
Another option: &pbw=false/true To print in Black and White or not.
(Maybe your could/want to merge all these comments?)
Kilian Croese said
The &pfs parameter seems to be for the Font Size, with one of the following options: SMALLEST | SMALLER | SMALL | NORMAL | BIG | BIGGER | BIGGEST
(sorry for the multiple replies, couldn’t figure out how to change a reply)
Kilian Croese said
Than something else. I’m just playing around with it now. You can use the &po parameter with the value of LANDSCAPE or PORTRAIT
for example &po=PORTRAIT for portrait orientated printing.
There is also a &pfs parameter, but i haven’t figured out yet what that is for.
Kilian Croese said
You don’t really need to use fiddler. To make things even easier. Just right click on the preview image and copy the Image Location. This will get the same URL as in step 5, but without using Fiddler, which might be to advanced for some people.
-Kilian
jpluimers said
Thx! I’ll be editing my post because of your replies.
Don’t worry about sending multiple replies; having them in ‘one bite at a time’ is easier for many people.
–jeroen
Taryn said
me again – when I reread your post, I realised that I can do what I want to do, but now the problem is that the URL is not showing up in fiddler. The only google related URLs coming up are CONNECT hosted. I’m using Chrome as my browser.
jpluimers said
You are probably using HTTPS in your Google Calendar connection, decrypting HTTPS traffic in Fiddler is a lot more difficult than capturing unencrypted HTTP traffic.
So: try using HTTP in stead of HTTPS when connecting to Google Calendar.
–jeroen
Taryn said
hi there – thanks for this! does this apply to ranges more than 5 weeks? I’m wanting to print a 12 week range on one page.
jpluimers said
You can’t; I just tried it with this one (starting januari 1st, until februari 20th); you get 5 weeks in januari and 3 weeks in februari:
http://www.google.com/calendar/printable?pgsz=a4&psdec=true&dates=20100101/20100220&ctz=Europe/Amsterdam&src=ZHUwbHRscGdibjVqODhlbW1uMXZkZnQwMWdAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=YTFkZHFnYjRxMTEwdDY4c2JrcG1pamFxYjRubjZzbzFAaW1wb3J0LmNhbGVuZGFyLmdvb2dsZS5jb20&src=ZHV0Y2hfX2VuQGhvbGlkYXkuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=cCN3ZWVrbnVtQGdyb3VwLnYuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&hl=en&wkst=2&mode=MONTH
–jeroen