Select to view content in your preferred language

Advanced print solution

46713
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
TomSchuller
Occasional Contributor III
Could you post both (working and non-working) layer-files (.lyr) or send them by email?

You could also check the layer properties of both layers .
There has to be somewhere a difference.

Tom
0 Kudos
EricVenden
Occasional Contributor II
Tom,

Attached are the working and nonworking parcel layers(zipped).  I will look closer at these...but there did not seem to be a difference....
Eric
0 Kudos
TomSchuller
Occasional Contributor III
Eric,
I found a difference between both layers.

The working one is connected through a LOCAL connection.
The non-working is connected through a INTERNET connection.

Could you try to add manually a mapservice over a INTERNET connection?
-> AddData->GISservers->AddArcGISserver->UseGISservices->Internet->ServerURL: xxxxx

An alternative would be to enable the "PrintSOE" on the parcels mapservice.
Clear your rest-cache and try the print again.
Having the "PrintSOE" enabled on a mapservice, will allow to access directly the datasource instead of the mapservice.

You will see the difference in the layers properties under "source".

Tom
0 Kudos
DavidCaussin
New Contributor III
Tom,

I have tried to print th PDF with the PrintSOE enabled on the map service and without.

With the PrintSOE enabled, here is the source a have.

Data Type: ArcGIS Map Service
Connection:   Internet
Server:   http://swarcgis001/ArcGIS/services
Name:   Cad_test
Operations Allowed:  Map (Display), Query (Identify), Data (Find)
Map Service Type:  Cached
File Format:  PNG32
Restriction:  Sublayers can't be turned on or off

When i disabled the PrintSOE here is the source :

Data Type: ArcGIS Map Service
Connection:   Internet
Server:   http://swarcgis001/ArcGIS/services
Name:   Cad_test
Operations Allowed:  Map (Display), Query (Identify), Data (Find)
Map Service Type:  Cached
File Format:  PNG32
Restriction:  Sublayers can't be turned on or off


and i had during the print processus a error
0 Kudos
TomSchuller
Occasional Contributor III
If you have problems with PrintSOE-enabled on a mapservice to use direct datasource for printing instead of the mapservice itself, you can make the following checks:
- is the "PrintSOE" enabled on the mapservice?
- does the outputdirecotoy of the mapservice contains a "lyr" folder with .lyr files? (/arcgisoutput/<mapservice-name>/lyr)
- does the .lyr file work? (try them by adding to ArcMAP)
- could you download the lyr file over the PrintSOE-REST api?
     http://<server>/arcgis/rest/services/<mapservice-name>/MapServer/exts/PCHPrintSOE/layerFile

Remember to clear the rest cache after you make modification to your mapservice.

Tom
0 Kudos
EricVenden
Occasional Contributor II
Eric,
I found a difference between both layers.

The working one is connected through a LOCAL connection.
The non-working is connected through a INTERNET connection.

Could you try to add manually a mapservice over a INTERNET connection?
-> AddData->GISservers->AddArcGISserver->UseGISservices->Internet->ServerURL: xxxxx

An alternative would be to enable the "PrintSOE" on the parcels mapservice.
Clear your rest-cache and try the print again.
Having the "PrintSOE" enabled on a mapservice, will allow to access directly the datasource instead of the mapservice.

You will see the difference in the layers properties under "source".

Tom



Tom,
Thanks for picking up on that...I am wondering why only the Parcels service is not working as all the other layers that I've looked at in the mxd generated by the PrintSOE have Internet as the source.  The reason the Parcels layer I sent was "Local" is that I did the work on the server that AGS is installed on.  I loaded the Parcels service as you requested on my local machine using an "Internet" connection and it loaded fine - I have attached a screenshot of this.  I also enabled the PCHPrintSOE on the Parcels service, cleared the Rest cache, and tried printing.  I have attached the PDF output from this - still no parcels.  I'm curious - Do I need to enable the PCHExportSOE on the layout service?  Right now, I have the PCHExportSOE enabled on the layout service and the parcels service.  I also have the PCHPrintSOE enabled on both of these services and I have the "printMap" checked.

Thank you again for your time Tom.
Eric
0 Kudos
TomSchuller
Occasional Contributor III
Could you post the .lyr file of the working internet-mapserice?
Could you check if the layers are well checked in the "Layer properties" -> "LAyers" tabs?

This is very strange?

You could also post printscreens for all the tabs (general,source,...) in the Layer properties for the working and non-working internet-layers.

Tom
0 Kudos
EricVenden
Occasional Contributor II
Could you post the .lyr file of the working internet-mapserice?
Could you check if the layers are well checked in the "Layer properties" -> "LAyers" tabs?

This is very strange?

You could also post printscreens for all the tabs (general,source,...) in the Layer properties for the working and non-working internet-layers.

Tom


Tom,
It is strange....I just copied the resultant mxd to my computer and opened it up.  The parcels show up even though if I open the mxd up on the AGS server they do not show up.  The PDF that was created does not display the parcel lines.  I have attached 2 screen shots of the source tab for the Parcels layer when opened in ArcMap on my computer and on the AGS server.  The AGS server shows the service as cached...which it is not.  My computer shows the service as it should be: Not Cached....I will try recreating the Parcels service.
Thanks Tom
Eric
0 Kudos
EricVenden
Occasional Contributor II
Tom,
I deleted the Parcels service and then recreated it from scratch. The result is the same...on the server, the Parcels service is viewed as "Cached" and does not display.  On my pc, the Parcels service is viewed as "Not Cached" and is displayed properly. 
It's strange, this is the only map service that has this behavior...
Any ideas?
Thank you very much Tom.
Eric
0 Kudos
TomSchuller
Occasional Contributor III
Eric,
you can make the following tests:
- create the same mapservice (smae mxd) under a different name
- log you in with an other user and try the mxd again (maybe IE cache)

Tom
0 Kudos