Search results

Print and Export

Print

The rendered map can be printed directly from the browser by calling the public method print. ID of the map div element must be passed as argument to that method.

Source
Preview
index.html
index.css
<!DOCTYPE html><html lang="en"><head>
    <title>EJ2 Maps</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Typescript UI Controls">
    <meta name="author" content="Syncfusion">
    <link href="index.css" rel="stylesheet">
    
    
<script src="//cdn.syncfusion.com/ej2/dist/ej2.min.js" type="text/javascript"></script>
</head>

<body>
    
    <div id="container" style="margin-top: 125px">
        <div id="element"></div>
        <div id="chart"></div>
        <button id="export" type="button" width="15%" style="float: right">Print</button>
    </div>


<script>
var ele = document.getElementById('container');
if(ele) {
    ele.style.visibility = "visible";
 }   
        </script>
<script src="index.js" type="text/javascript"></script>
</body></html>
        <div class="content-wrapper">
            <div id="container"></div>
        </div>
            <div>
              <button id="togglebtn">Print</button>
            </div>

Export

The rendered map can be exported to jpeg or png format by using export method in map. Input parameters for this method are Export Type for format and fileName of result.

Source
Preview
index.html
index.css
<!DOCTYPE html><html lang="en"><head>
    <title>EJ2 Maps</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Typescript UI Controls">
    <meta name="author" content="Syncfusion">
    <link href="index.css" rel="stylesheet">
    
    
<script src="//cdn.syncfusion.com/ej2/dist/ej2.min.js" type="text/javascript"></script>
</head>

<body>
    
    <div id="container" style="margin-top: 125px">
        <div id="element"></div>
        <div id="chart"></div>
        <button id="export" type="button" width="15%" style="float: right">Export</button>
    </div>


<script>
var ele = document.getElementById('container');
if(ele) {
    ele.style.visibility = "visible";
 }   
        </script>
<script src="index.js" type="text/javascript"></script>
</body></html>
        <div class="content-wrapper">
            <div id="container"></div>
        </div>
            <div>
              <button id="togglebtn">Export</button>
            </div>
Contents
Contents