====== Map Suite WebAPI Printing======
===== Video Overview =====
{{youtube>tise5efBFaY|WebAPI Printing Sample}}
{{filehistory:webapieditionsample_printing_cs_20151215.zip|C# Project}}
[[source_code_webapieditionsample_printing.zip|View Source]]
[[http://samples.thinkgeo.com/WebApiEdition/SampleTemplates/Printing/leaflet/|Try It Online(Leaflet)]]
[[http://samples.thinkgeo.com/WebApiEdition/SampleTemplates/Printing/openlayers/|Try It Online(Openlayers)]]
=====Overview=====
This project shows you how to add robust printing support to your WebAPI application. Using the code in this sample you will be able to build a print preview interface that lets your users interactively arrange items such as a map, scale line, labels, data grid, or image on a virtual page before printing the result to a printer, exporting to a PDF or to a bitmap image. Maps are printed using vector graphics so you can be sure the output will look great on anything from a PDF or even a large plotter. The printing system also includes low-level report building classes that make it easy to generate reports in a web environment.
===== Printer Layers =====
This sample shows you different APIs that allows you to build your own printing system. Some of the features include adding labels, images, scale lines, scale bars, and data grid.
==== Label Printer Layer ====
{{webapiedition:printerlayeroflabel.png?300|Border}}
\\
//Label printer layers.
//
The label printer layer allows you to add a label to the page. The user has full control and can customize the font and content of the label.
==== Image Printer Layer ====
{{webapiedition:printerlayerofimage.png?300|Border}}
\\
//Image printer layers.
//
The image printer layer allows you to add an image to the page. You can customize the image and the image size on the page.
==== Scale Line Printer Layer ====
{{webapiedition:printerlayerofscaleline.png?300|Border}}
\\
//Scale line printer layers.
//
The Scale Line printer layer allows you to add Scale Line to the page.
==== Scale Bar Printer Layer ====
{{webapiedition:printerlayerofscalebar.png?300|Border}}
\\
//Scale Bar printer layers.
//
The scale bar printer layer allows you to add a scale bar to the page.
==== Data Grid Printer Layer ====
{{webapiedition:printerlayerofdatagrid.png?300|Border}}
\\
//Scale Bar printer layers.
//
The data grid printer layer shows how to add a data grid to the page. In the sample the data grid shows the columns with the countries that have population > 150 million.
===== Print preview =====
Print Preview allows users to specify paper size, page orientation, and percentage.
==== Paper Size ====
Users can specify paper size to predefined sizes such as ANSI A-8.5 x 11(A4), ANSI B-11 x 17(A3), ANSI C-17 x 22(A2), ANSI D-22 x 34(A1), ANSI E-34 x 44(A0) or create custom sizing.
==== Orientation ====
{{webapiedition:printerlayerofportrait.png?170|Border}}
\\
//Portrait.//
\\
{{webapiedition:printerlayeroflandscape.png?220|Border}}
\\
//Landscape.//
Users can select portrait and/ or landscape for page orientation.
===== Export =====
This sample shows how you can export the page printer layer, save it as bitmap, PDF and how to print.