Advanced print solution

37022
296
02-19-2011 10:52 AM
TomSchuller
Occasional Contributor III
Please find in the codegallery my first version of an advanced print solution:
http://www.arcgis.com/home/item.html?id=6809086326ea4c76bf026a32bb9dd698

The backend is developed in Java as a ServerObjectExtension: PChPrintSOE

The communication to the SOE is realized by the REST.
So, any client can be used Flex, Javascript, ...
I just created a simple FlexWidget.

Some features:
- full print over the rest api (usable by any client)
- export to pdf,jpeg,png,emf and mxd!
- view paper layout extent live on map
- make print on a "template" mapservice by keeping the predefined layout
- multi-mapservices/multi-server support
- add graphics on the map view positioned in map units
- add elements on the layout view positioned in paper units like scalebar, scaletext


The code is under full development:
- support for wms layer
- code clean up and reorganization

Any suggestions, remarques or help is welcome.

Live demo with public Esri mapservices (last print button):
http://gis.pch.etat.lu/flexViewerPrint/
   - use this print widget with your PChPrintSOE-enabled mapservices for high quality
   - draw first some graphics with the DrawWidget prior making your print (in mxd format)
Tags (2)
0 Kudos
296 Replies
MattiasEkström
Occasional Contributor III
Tom,
I've tried the new jar file and now one lyr file is created for each layer id in the REST service, so there is one lyr file for all sublayers to the annotationlayer. But the print still doesn't work.
I tried to open the lyr files in ArcMap and the first 0.lyr which is the lyr file for the entire AnnotationLayer works in ArcMap, but 1-4.lyr which are lyr files for annotation sublayers is not possible to open/add in ArcMap. (In ArcMap you can't create a lyr file from a sublayer to an Annotation, at least what I know).
I'm attaching 0.lyr and 1.lyr

I don't really know where to find the appropriate log files for ArcGIS Server, I always look at the log in ArcGIS Server Manager. I'm attaching messages from there as a simple html file.

Thanks a lot for taking time to look in to this.
/Mattias
0 Kudos
TomSchuller
Occasional Contributor III
mattias_j,
I updated the http://gis.pch.etat.lu/flexViewerPrint/PCHarcgisSOE.jar

It's a partial fix where only the annotation lyr-files are created.
The sub-annotation-layers are currently ignored.

I will check to find a solution to implement it.
Does you now get a print?

Tom
0 Kudos
MattiasEkström
Occasional Contributor III
Tom,
I think there is something wrong with that latest jar file, when I'm using that one I can't restart/start any service that has the PrintSOE enabled, except my empty layout service. And can't make a print.

Edit: Did some more testing. All my services except the layout is based on .msd documents, I published a couple of new services from the .mxd documents and I was able to enable the PrintSOE on them.
My test service without annotation works fine, the one with annotation works but is low quality and the annotations are missing. Is that expected? Is that what you meant with "The sub-annotation-layers are currently ignored."??
In the lyr folder the lyr files seems to be good, there is 0.lyr, 5.lyr, 6.lyr and 7.lyr and all works in ArcMap so the number/names are correct and there's no lyr files for the annotations sublayers.
But the .msd based services are supposed to work with the PrintSOE right?

/Mattias
0 Kudos
TomSchuller
Occasional Contributor III
mattias_j,
could you post the log files.

They are normaly located under:
  C:\Program Files\ArcGIS\Server10.0\server\user\log

On your installation, I assume they are located under:
  /opt/arcgis/server10.0/server/user/log

Tom
0 Kudos
MattiasEkström
Occasional Contributor III
There was a lot of log files there, this should be the latest, I guess it will be enough for you?
This test server is a virtual server that I stop and start when I'm using it so the date and time isn't correct. 20110711 in the log files is today...

Did you see the edits I made to my last post? I didn't saw that you had answered before I made those edits, probably should have written it in a new post.

/Mattias
0 Kudos
SylvainKerdreux
New Contributor
Hi TomLux.

I have a question about your wonderfull print solution.

When I try to print I got only a white blank page.
I check ArcGIS Server log
and I found two errors :

<Msg time='2011-07-20T12:47:50' type='ERROR' code='8001' target='layout.MapServer' machine='VM-GEOTEST' user='?' process='4996' thread='1520' elapsed='0.00000'> AutomationException: One or more arguments are invalid</Msg>

<Msg time='2011-07-20T12:47:50' type='ERROR' code='8001' target='layout.MapServer' machine='VM-GEOTEST' user='?' process='4996' thread='1520' elapsed='0.00000'> unable to add mapservice layers for :http://vm-geotest/ArcGIS/rest/services/CarteGenerale/MapServer</Msg>

in Arcgis server Output folder I found PDF and mxd files.
However MXD files is empty.

Do you have any idea to correct this problem ?
0 Kudos
TomSchuller
Occasional Contributor III
sylvain.kerdreux,

could you try this url on your server:
http://vm-geotest/ArcGIS/rest/services/CarteGenerale/MapServer?f=lyr&v=9.3


This should give you a "lyr" file containing the mapservice.
Could you try to add it to ArcMAP?`
Are all layers visible?

If you have ArcMAP on your server "VM-GEOTEST", try it directly on the server.

Tom
0 Kudos
JustinConner
Occasional Contributor II
I'm having an issue where the red print extent box remains on the display after the widget is closed. Is there a fix for this with the compiled version? See the attached image.
0 Kudos
SylvainKerdreux
New Contributor
sylvain.kerdreux,

could you try this url on your server:
http://vm-geotest/ArcGIS/rest/services/CarteGenerale/MapServer?f=lyr&v=9.3


This should give you a "lyr" file containing the mapservice.
Could you try to add it to ArcMAP?`
Are all layers visible?

If you have ArcMAP on your server "VM-GEOTEST", try it directly on the server.

Tom



in the 'lyr' files all layers are visible in ArcMap.
I tried with several mapservicex on the server and it's always the same error.
(ArcGIS Server 10.0)
0 Kudos
MattiasEkström
Occasional Contributor III
Hi Tom!

I've been away on vacation for a couple of weeks now, before that I had problems with printing map services containing annotation layers with annotation sub layers, as you might remember.
You made a fix for me that didn't worked for me, on your request I posted my log file and then I haven't got any reply. Have you had any time to look at it?

/Mattias
0 Kudos