Google maps and pdf
Programaticly, I need to include a google Maps map to automaticly generated pdf files. For this, I need to convert the map into some image format (jpg, png etc). 开发者_StackOverflowHow can it be done ?
I am using Python and Django if build in google maps library is not sufficient.
Thanks
I think the only way is to import images into the PDF, the images coming from the Google Maps static API.
However, it's going to collide with their T & C:
License Restrictions. Except as expressly permitted under the Terms, or unless you have received prior written authorization from Google (or, as applicable, from the provider of particular Content), Google's licenses above are subject to your adherence to all of the restrictions below. Except as explicitly permitted in Section 7 or the Maps APIs Documentation, you must not (nor may you permit anyone else to):
(yada yada)
10.2 copy, translate, modify, create a derivative work of, or publicly display any Content or any part thereof (for example, the following are prohibited: (a) creating server-side modification of map tiles; and (b) stitching multiple static map images together to display a map that is larger than permitted in the Maps APIs Documentation);
10.8 use the Static Maps API other than in an implementation in a web browser;
You can use the Google Maps Static API to return an image of the map. It's a very easy, REST-like API that doesn't even require a key. Example:
http://maps.google.com/maps/api/staticmap?center=51.477222,0&zoom=14&size=400x400&sensor=false
You can embed a swf of google map into PDF with Adobe Acrobat 9 or higher.
In Flash you can create and customize your own google map. https://developers.google.com/maps/documentation/flash/tutorial-flash
The published swf then could be embedded into PDF. And also there is a way how to control this predesigned google map with acrobat buttons using actinscript ExternalInterface class and connect it with Acrobat Javascript.
This PDF must be opened in Adobe Reader 9 or higher to be played correctly.
See the sample here http://www.designus.sk/blog/creating-and-animating-life-google-maps-in-pdf/
精彩评论