<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
h4
        {mso-style-priority:9;
        mso-style-link:"Heading 4 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        font-weight:bold;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.Heading4Char
        {mso-style-name:"Heading 4 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 4";
        font-family:"Times New Roman","serif";
        font-weight:bold;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='color:#1F497D'>Unfortunately I am still unable
to print my layers from geowebcache. Here is some code snippets and a link to
a demo page.<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> Any more pointers will be
appreciated. The pdf will not contain my gwc layers, otherwise all is well.<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>My gwc layer<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>baseLayer = new
OpenLayers.Layer.WMS(<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>'gwc',
'http://gis.catawbacountync.gov/geoserver/gwc/service/wms', {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>layers: ['catawba:nc_cities2'],<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>transparent:'true',<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>format: 'image/png',<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>tiled:true<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> },{<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>isBaseLayer: true,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>buffer: 1,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>tileSize: new
OpenLayers.Size(256,256),<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>//tileOrigin: (-20037508,
-20037508),<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>visibility: true,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>displayInLayerSwitcher: false<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>});<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>My print provider and print page<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>printProvider = new
GeoExt.data.PrintProvider({<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>method: "POST",<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>url:
'http://gis.catawbacountync.gov/geoserver/pdf',<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>autoLoad: true,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>listeners: {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> "loadcapabilities":
function () {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>printProvider.setLayout(printProvider.layouts.getAt(0));<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> },<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>"printexception":
function(printProvider,response) {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> alert("An error has
occurred: " + response.statusText);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }}<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>});<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>printPage = new
GeoExt.data.PrintPage({<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>printProvider: printProvider,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>customParams: {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>mapTitle: "gwc print",<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>comment: ""<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>}});<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>My print tool<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>action = new Ext.Action({<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>text: "Print",<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>scale: 'medium',<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>tooltip: "Print map -
PDF",<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>handler: function() {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>printPage.setCenter(map.getCenter());<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>printPage.fit(map, {mode:
"closest"});<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>printProvider.print(mapPanel,
printPage);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>},…<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>Link to a demo<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><a
href="http://www.gis.catawba.nc.us/gwc/print_gwc.html">http://www.gis.catawba.nc.us/gwc/print_gwc.html</a><o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<p class=MsoNormal><span style='color:#1F497D'>Ralph Dell<o:p></o:p></span></p>
</div>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Matt Priour
[mailto:mpriour@kestrelcomputer.com] <br>
<b>Sent:</b> Wednesday, August 24, 2011 4:19 PM<br>
<b>To:</b> Ralph Dell; users@geoext.org<br>
<b>Subject:</b> Re: [Users] geoext Printprovider bad request<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>You can use gwc’s wms, just not as a single tile layer:<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>tileSize: new OpenLayers.Size(256,256)<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>is a _required_ config property of the layer(s) you are trying to
print.<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>Your other option is to use an XYZ layer type with your gwc
layers.<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>Matt Priour<br>
Kestrel Computer Consulting<o:p></o:p></span></p>
</div>
<div>
<div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:black'> <o:p></o:p></span></p>
</div>
<div>
<div>
<p class=MsoNormal style='background:whitesmoke'><b><span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif";color:black'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'> <a
href="mailto:RDell@CatawbaCountyNC.gov" title="RDell@CatawbaCountyNC.gov">Ralph
Dell</a> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal style='background:whitesmoke'><b><span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif";color:black'>Sent:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>
Wednesday, August 24, 2011 2:22 PM<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal style='background:whitesmoke'><b><span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif";color:black'>To:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'> <a
href="mailto:users@geoext.org" title="users@geoext.org">users@geoext.org</a> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal style='background:whitesmoke'><b><span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif";color:black'>Subject:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'> [Users]
geoext Printprovider bad request<o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<p class=MsoNormal><span style='font-size:12.0pt;color:black'> <o:p></o:p></span></p>
</div>
</div>
<div>
<p class=MsoNormal><span style='color:black'>I did not know if this list or the
geoserver list would be a better forum for this question. I decided to start
here.<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>After adding layers to my map from
geowebcache and generating a pdf with the Printprovider the gwc layers
were not showing up in the generated pdf.<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>My straight up wms layes etc, were
printing fine as usual.<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>In my geoserver logs I found the
following information that indicated a bad request. <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>2011-08-24 13:27:21,287 WARN
[org.mapfish.print.PDFUtils] - <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>Server returned an error for
http://gis.catawbacountync.gov/geoserver/gwc/service/wms?<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>BBOX=-9079690.0%2C4218281.5%2C-9006310.0%2C4294718.5&HEIGHT=694&WIDTH=667&TRANSPARENT=true&<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>map_resolution=100&VERSION=1.1.1&FORMAT=image%2Fpng&TILED=true&SERVICE=WMS&format_options=dpi%3A100&<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>LAYERS=ncgroup&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913:<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>Error (status=400) while reading
the image from http://gis.catawbacountync.gov/geoserver/gwc/service/wms?<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>BBOX=-9079690.0%2C4218281.5%2C-9006310.0%2C4294718.5&HEIGHT=694&WIDTH=667&TRANSPARENT=true&<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>map_resolution=100&VERSION=1.1.1&FORMAT=image%2Fpng&TILED=true&SERVICE=WMS&format_options=dpi%3A100&<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>LAYERS=ncgroup&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913:
Bad Request<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>2011-08-24 13:27:21,287 WARN
[org.mapfish.print.PDFCustomBlocks] - <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>Error while adding a PDF
elementjava.io.IOException: <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>Error (status=400) while reading
the image from http://gis.catawbacountync.gov/geoserver/gwc/service/wms?<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>BBOX=-9079690.0%2C4218281.5%2C-9006310.0%2C4294718.5&HEIGHT=694&WIDTH=667&TRANSPARENT=true&<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>map_resolution=100&VERSION=1.1.1&FORMAT=image%2Fpng&TILED=true&SERVICE=WMS&format_options=dpi%3A100&<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>LAYERS=ncgroup&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913:
Bad Request<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>I did not know why it was a bad
request but I was suspicious of the HEIGHT and WIDTH<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>Pasting the url into my browser
confirmed that by returning the error<o:p></o:p></span></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span
style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'>400:
The requested tile dimensions 694x667 do not match those of the grid set
(256x256)<o:p></o:p></span></b></p>
<p class=MsoNormal><span style='color:black'><a
href="http://gis.catawbacountync.gov/geoserver/gwc/service/wms?BBOX=-9079690.0%2C4218281.5%2C-9006310.0%2C4294718.5&HEIGHT=694&WIDTH=667&TRANSPARENT=true&map_resolution=100&VERSION=1.1.1&FORMAT=image%2Fpng&TILED=true&SERVICE=WMS&format_options=dpi%3A100&LAYERS=ncgroup&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913">http://gis.catawbacountync.gov/geoserver/gwc/service/wms?BBOX=-9079690.0%2C4218281.5%2C-9006310.0%2C4294718.5&HEIGHT=694&WIDTH=667&TRANSPARENT=true&map_resolution=100&VERSION=1.1.1&FORMAT=image%2Fpng&TILED=true&SERVICE=WMS&format_options=dpi%3A100&LAYERS=ncgroup&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913</a><o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>OK great. What can I do to resolve
the issue? Can I use my gwc layers with the printProvider? Do I have deeper
issues?<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'>Ralph Dell<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p>
<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:12.0pt;color:black'>
<hr size=2 width="100%" align=center>
</span></div>
<p class=MsoNormal><span style='font-size:12.0pt;color:black'>_______________________________________________<br>
Users mailing list<br>
Users@geoext.org<br>
http://www.geoext.org/cgi-bin/mailman/listinfo/users<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>