<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Maybe I should expand:<br>
    I need to render a certain map area (random polygon, e.g. a park,
    part of the city, or whatever) into a given paper size (e.g. A5
    landscape).<br>
    <br>
    I already have that implemented, with a map on a webpage, and
    setting the boundary on the max/min lat/lon values of the polygon.
    However, I have the following problems:<br>
    1) Because the polygon may be large, the zoom level chosen may be
    low, so the map omits street names, but I absolutely need all street
    names. Printing has 600+ dpi, so it should be fine.<br>
    2) OpenLayers calculates with the 100dpi of the screen, and choses
    the zoom level accordingly, but the printer has 600dpi, and the
    curved street names look pixelish coarse, ugly and barely readable.<br>
    3) the zoom levels are in fixed steps, so the resulting map has a
    lot of unneeded area around the area I actually want. The size is
    given, so the wanted area is unnecessarily small.<br>
    4) the wanted area is not necessarily parallel to lat/lon axis, so
    if I have an area that's high, and a paper that's wide, there's even
    more unused space left and right.<br>
    <br>
    Unless somebody has a better suggestion (that involves only
    OpenLayers, not any server), I am thinking of the following
    approach:<br>
    <ol>
      <li>Let OpenLayers render the map (the whole map, not just one
        vector layer) into an off-screen &lt;canvas&gt; element, and
        make a bitmap of it.</li>
      <li>Set the zoom level to a certain minimum (e.g. 17), where all
        street names are shown. The result would be a map that is huge,
        but it's in a bitmap, not on the webpage.</li>
      <li>Given the shape of the polygon, I rotate the bitmap so that
        the polygon uses as much of the available print rectangle (e.g.
        20:15) as possible.</li>
      <li>Scale down the (rotated) bitmap so that I end up with one that
        has 20x15 cm at 600 dpi (= 236 dots per cm) = 4720x3540 px<br>
      </li>
    </ol>
    <p><br>
      I think I could do step 3. and 4., but I don't know how to do 1.
      (and 2).<br>
    </p>
    <p>Ben<br>
    </p>
  </body>
</html>