# Printing Maps to printer or pdf

**URL:** <https://mapwindow.discourse.group/t/printing-maps-to-printer-or-pdf/1278>\
**Category:** Uncategorized\
**Created:** [March 14, 2022, 2:53pm UTC](https://mapwindow.discourse.group/t/printing-maps-to-printer-or-pdf/1278 "2022-03-14T14:53:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimpflmoser](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@dimpflmoser](https://mapwindow.discourse.group/u/dimpflmoser)\
**Post date:** [March 14, 2022, 2:53pm UTC](https://mapwindow.discourse.group/t/printing-maps-to-printer-or-pdf/1278/1 "2022-03-14T14:53:06Z")

</div>

Hello everybody,

in my current application in MS-Access/vba I use a quite spartan dialog to print a snapshot to a MS-Word document by using the SnapShot3 function. This works but is far from being comfortable.  
Now that it is finally time to move to C# I’d like to implement a new printout functionality which should:

- be more comfortable (i.e. give a print-preview, let the user move the print area, select the scale, etc)
- and either print directly to the printer or to an pdf-file.  
Now I wonder, if anyone has developed a routineaccomplish something similar and would be willing to share his/her knowledge and provide some example code?

Thanks in advance

By the way - if anybody was interested in my vba-code I would be glad to share.

---

<div class="post-metadata">

**Author:** ![pmeems](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/pmeems/32/9_2.png) [@pmeems](https://mapwindow.discourse.group/u/pmeems)\
**Post date:** [March 16, 2022, 11:07am UTC](https://mapwindow.discourse.group/t/printing-maps-to-printer-or-pdf/1278/2 "2022-03-16T11:07:50Z")

</div>

MapWindow5 has a print option.  
It’s in a separate plug-in. You can look at its code for inspiration: [MapWindow5/src/Plugins/MW5.Printing at develop · MapWindow/MapWindow5 · GitHub](https://github.com/MapWindow/MapWindow5/tree/develop/src/Plugins/MW5.Printing)

---

<div class="post-metadata">

**Author:** ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)\
**Post date:** [April 2, 2022, 5:13pm UTC](https://mapwindow.discourse.group/t/printing-maps-to-printer-or-pdf/1278/3 "2022-04-02T17:13:11Z")

</div>

Hello @dimpflmoser

In c#, you can use the SnapShot method to capture the current map extents into an image, something like:

```
    MapWinGIS.Image mwImage = axMap1.SnapShot(axMap1.Extents);

```

What I have done in the past is to then use the Image.Save method to save the file to a temporary directory, then use the Windows standard Print dialog to preview and print the file.

Regards,  
Jerry.

---

<div class="post-metadata">

**Author:** ![rolivera](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@rolivera](https://mapwindow.discourse.group/u/rolivera)\
**Post date:** [April 27, 2023, 11:38am UTC](https://mapwindow.discourse.group/t/printing-maps-to-printer-or-pdf/1278/4 "2023-04-27T11:38:46Z")

</div>

Hello @jerryfaust  
Could you be more specific?  
Could you provide the code to save?  
I would appreciate your contribution!

---

<div class="post-metadata">

**Author:** ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)\
**Post date:** [May 1, 2023, 7:01am UTC](https://mapwindow.discourse.group/t/printing-maps-to-printer-or-pdf/1278/5 "2023-05-01T07:01:37Z")

</div>

There’s a Save method on the Image class. See [the documentation here](https://www.mapwindow.org/mapwingis/group __image__ common.html#ga6516f8262a3e2c51621e66925ecc228d).

Jerry.
