3

I've got cached tiles for all map layers at various zoom levels, and would like to print at DPI higher than the default (around 96) by using tiles from a deeper zoom level. It doesn't matter if map features become very small or unreadable. I've tried passing a higher DPI setting:

template=new PrintTemplate();
template['layout']='MAP_ONLY';
template['exportOptions']={dpi:300,width:3200,height:2400};
template['preserveScale']=false;
template['format']='PDF';

printWidget=new Print({
    async:true,
    map:map,
    url:url,
    templates:[template]
},dom.byId('printButton'));

printWidget.startup();

However pixels in the resulting PDF are still very large. The server seems to choose the zoom level of the tiles based on the map extent only, but always according to about 96 DPI. The preserveScale option does nothing (I checked that it doesn't get passed to the server at all) and the DPI setting is sent to the server but doesn't affect the resulting image.

What can I do to increase the output DPI by printing tiles from a deeper zoom level than is shown on screen?

Creating an A3 or A2 sized printing template and instructing users to configure their printing settings to scale it to A4 fixes the problem, but it would be preferable to produce a correct PDF.

  • 1
    The dpi property works when printing as an image. – Aamir Suleman Dec 22 '14 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.