<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def map_to_pdf(map_source, zoom, x, y, width, height):
 """ Generate a PDF at the given position. Args: map_source (str):
 id of the map source to print. zoom (int):
 zoom-level to print x (float):
 Center of the Map in mercator projection (EPSG:4326), x-coordinate y (float):
 Center of the Map in mercator projection (EPSG:4326), y-coordinate width (float):
 width of the pdf in mm height (float):
 height of the pdf in mm Returns: """

    map_source = app.config["mapsources"][map_source]
    pdf_file = print_map(map_source, x=float(x), y=float(y),
                         zoom=int(zoom), width=float(width), height=float(height), format='pdf')
    return send_file(pdf_file,
                     attachment_filename="map.pdf",
                     as_attachment=True)