mpetroff / print-maps

High-resolution maps in the browser, for printing
https://printmaps.mpetroff.net/
MIT License
286 stars 51 forks source link

PDFs are ANSI A (letter) dimensions regardless of width and height entered #4

Closed talllguy closed 9 years ago

talllguy commented 9 years ago

Exported a few PDFs and I noticed that they all are sized at ANSI A 8.5x11" (letter). This line of code may be to blame. It looks like there are only a few options for the paper size in the jsPDF spec, though it appears you can specificy a custom size in this case.

Here are a few example PDFs where the filename was the input values in inches.

Changing to millimeter mode switches the output paper size to A4.

mpetroff commented 9 years ago

Since the jsPDF documentation doesn't say anything about custom page sizes, I purposely set the output to letter for inches and A4 for millimeters. Thanks to the Stack Overflow post you linked to, I'm now using arbitrary page sizes.

talllguy commented 9 years ago

Excellent! Glad to help. I see you fixed this in 8e99a6c5c9577be1b855ea28e6388a2a26813533