1<%-- $HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/apps/igeoportal-standard/branches/2.5_testing/printview.jsp $ --%>
2<%--
3 This file is part of deegree, http://deegree.org/
4 Copyright (C) 2001-2009 by:
5 - Department of Geography, University of Bonn -
6 and
7 - lat/lon GmbH -
8
9 This library is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free
11 Software Foundation; either version 2.1 of the License, or (at your option)
12 any later version.
13 This library is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
16 details.
17 You should have received a copy of the GNU Lesser General Public License
18 along with this library; if not, write to the Free Software Foundation, Inc.,
19 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
21 Contact information:
22
23 lat/lon GmbH
24 Aennchenstr. 19, 53177 Bonn
25 Germany
26 http://lat-lon.de/
27
28 Department of Geography, University of Bonn
29 Prof. Dr. Klaus Greve
30 Postfach 1147, 53001 Bonn
31 Germany
32 http://www.geographie.uni-bonn.de/deegree/
33
34 e-mail: info@deegree.org
35--%>
36<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
37<%@ page import="org.deegree.i18n.Messages" %>
38<%@ page import="java.util.Locale" %>
39<%
40    Locale loc = request.getLocale();
41%>
42<html>
43	<head>
44		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
45		<meta name="author" content="lat/lon GmbH">
46        <meta name="KeyWords" content="OGC deegree iGeoPortal lat/lon" />
47		<meta name="audience" content="">
48        <meta http-equiv="imagetoolbar" content="no" />
49        <meta http-equiv="cache-control" content="no-cache" />
50        <title>deegree iGeoPortal print view</title>
51        <link href="css/deegree.css" rel="stylesheet" type="text/css" />
52        <script language="JavaScript1.2" type="text/javascript">
53        <!--
54            function printPage() {
55                var e = document.getElementById( "printBT" );
56                e.parentNode.removeChild( e );
57                e = document.getElementById( "printCancelBT" );
58                e.parentNode.removeChild( e );
59                window.print();
60                window.close();
61            }
62
63            /*
64            function getPrintWidth() {
65            	//the return value should be used for img.map.width
66				var isWindows = true;
67				var printWidth = 600;
68				if ( navigator.appVersion.search("Windows") = -1 ){
69					isWindows = false;
70					printWidth = 1100;
71				}
72				alert( " isWindows = " +  isWindows + "\nprintWidth = " + printWidth );
73				return printWidth;
74			}
75			*/
76        // -->
77        </script>
78<%
79        String file = (String)request.getAttribute( "ImageSource" );
80        Integer width = (Integer)request.getAttribute( "ImageWidth" );
81        Integer height = (Integer)request.getAttribute( "ImageHeight" );
82        int h = 0;
83        int w = 500;
84        if ( file != null ) {
85            double d = width.doubleValue()/500d;
86            h = (int)(height.doubleValue()/d);
87        }
88%>
89        <style type="text/css">
90			@media screen {
91				body {
92					background: #FFFFFF;
93					color: #000000;
94				}
95				img.map{
96					width: <%=w %>;
97					height: <%=h %>;
98				}
99			}
100			@media print {
101				PAGE {
102				    font-size: small;
103					size: portrait;
104					margin: 1.5cm;
105				}
106				body {
107					font-size: 12pt;
108					size: portrait;
109					margin: 1.5cm;
110					background: #FFFFFF;
111					color: #000000;
112				}
113				img.map {
114					width: 600; /* might need to be adjusted */
115				}
116			}
117		</style>
118    </head>
119    <body class="pPrintView">
120        <a id="printBT" href="javascript:printPage()" class="buttonArea"><%=Messages.get( loc, "IGEO_STD_BTN_PRINT" ) %></a>
121        <a id="printCancelBT" href="javascript:window.close()" class="buttonArea"><%=Messages.get( loc, "IGEO_STD_BTN_CANCEL" ) %></a>
122        <br/>
123<%
124        if ( file != null ) {
125%>
126			<img class="map" border="0" src="<%=file %>" />
127<%
128        }
129%>
130    </body>
131</html>
132