Jesse,

 

I have been running various tests, and have reviewed the documentation.  I have 
not been able to look at the vector examples on Github, the files cannot be 
displayed.  I have still not been successful in printing the vector layer.  I 
have to use GET for my requests because when I try to use POST, I get the error 
it failed to load resource because it is not allowed by 
Access-Control-Allow-Origin.  I researched that error and the web.config on our 
server contains the information to prevent that error, so I am not sure why 
that is happening.

 

I have tried running the standalone application on spec information that I have 
captured for maps that do work, and I continue to get the “Cannot parse the 
spec file” error and it says it is caused by a JSONObject text must begin with 
‘{‘ at character 1.  I replaced the urlencoding with a {, and then it gives an 
error cause by expected a ‘:’ after a key at character . .  I have tried 
replacing the urlencode characters with the actual character, and then it 
complains about the next one.  Should the urlencoding prevent the file from 
running?

 

Thanks,

 

Jerome

 

 

From: Jesse Eichar [mailto:[email protected]] 
Sent: Friday, November 01, 2013 1:56 AM
To: jawendell
Cc: Mauro Bartolomeoli; GeoServer Mailing List List
Subject: Re: [Geoserver-users] GeoServer Printing Module

 

Hi Jerome,

 

I had asked you to download a "standalone" application instead of a 
webapplication.  It is useful for debugging issues sometimes.  

 

The yaml parameter I think should be pretty straightforward.  It is the print 
application configuration and exists on the server with the print 
servlet/webapplication.

 

The spec parameter simulates the browsers print request.  Therefore it has to 
contain the same json that a print request makes.  As you can see in the 
console above it is complaining about the format of the request.

 

In order to get the spec data you can:

*       Open a browser.  
*       go to the print page
*       Open the developer tools for that browser (F12 if using chrome) . 
*       make a print request.
*       Look in the developer tools for the browser and find the POST data for 
the print request.
*       Copy the post data in to a file

that POST data is what needs to be in a spec.

 

For comparison you can look at several examples that are online:

 

https://github.com/mapfish/mapfish-print/tree/master/samples

 

You can also read the documentation about the spec:

 

http://www.mapfish.org/doc/print/protocol.html

 

Jesse

 

On Thu, Oct 31, 2013 at 7:29 PM, Jerome A. Wendell <[email protected]> 
wrote:

I have run the command for the standalone module, and I get the following error:



Does anyone know a solution for the “Cannot parse the spec file” error?

 

Thanks,

 

Jerome

 

 

From: Jesse Eichar [mailto:[email protected]] 
Sent: Wednesday, October 30, 2013 2:56 PM


To: jawendell
Cc: Mauro Bartolomeoli; GeoServer Mailing List List
Subject: Re: [Geoserver-users] GeoServer Printing Module

 

Really nothing useful there is there...  could you download:

 

http://search.maven.org/remotecontent?filepath=org/mapfish/print/print-standalone/1.2.0/print-standalone-1.2.0.jar

 

and run it with your request to see if there is something broken with the 
version of mapfish-print that you are using?

 

Command to run:

 

java -jar print-standalone-1.2.0.jar  --config=config.yaml --spec=spec.json 
--output=print.pdf --verbose=3

 

where config.yaml is the configuration you find within geoserver somewhere

the spec.json is what is posted by the browser.

verbose 3 will give maximum logging.

print.pdf will be the generated file.

 

 

Lets see if this works.  We have to be a bit careful in the case that the 
config.yaml or the spec.json is not compatible with the newer version but I 
think in most cases backwards compatibility was maintained as best as possible.

 

Jesse

 

<<image001.png>>

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to