Advanced print solution

37088
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
EricVenden
Occasional Contributor II
Tom,
I am attempting to change the default choices in your print widget - namely, the default location of the scale bar, scale, etc.  I have loaded the files into my Flash project and also added the mxml to the modules list.  After the project is rebuilt, I get a red "x" over the mxml file.  I try to Run the project and it throws an error....should I ignore these errors, make the changes, and just export the project to release build?  I am using Flash Builder 4....not sure why the error is there as soon as I load the source code you provide.
Any help would be appreciated.
Thanks
Eric V
0 Kudos
EricVenden
Occasional Contributor II
Tom,
I've run into another random issue with the widget you included with the Advanced print solution...I occasionally get the attached error.  If I click the print button again it will work....
Any ideas?
Thanks for your time.
Eric V
0 Kudos
TomSchuller
Occasional Contributor III
Eric,
the Widget should compile correctly under FlashBuilder4 with the latest FlexViewer code.
Could you post the contents of the "Problems" tab in FlashBuilder concerning the error?

When you get the error during the print, could you check if there is a mxd and pdf/png/... file generated in the argcisoutput folder?
When you are running the FlexViewer in debug modus, the rest-url for calling the PrintSOE is outputted in the console view.
You can try to open this url directly in your browser.

Tom
0 Kudos
DavidCaussin
New Contributor III
Try to pass your parameters with quotes, like:
 soemanager.bat -a localhost localhost "caussin dv"  myPassWord PCHarcgisSOE.jar


Tom


Hi TOM,

Still don't work 😞

ERROR: User name is empty, null or invalid 😞
0 Kudos
TomSchuller
Occasional Contributor III
Hy,
it seems that there is a problem with usernames containing a space.

As workaround I would suggest to create a new user which doesn' contains spaces, or use the ARCGISSom-User or use the administrator user.

Don't miss to add your newly created user and/or the adminisitrator to the agsadmin group.

If it still doesn't work, could you post your command line here?

Tom
0 Kudos
EricVenden
Occasional Contributor II
Eric,
the Widget should compile correctly under FlashBuilder4 with the latest FlexViewer code.
Could you post the contents of the "Problems" tab in FlashBuilder concerning the error?

When you get the error during the print, could you check if there is a mxd and pdf/png/... file generated in the argcisoutput folder?
When you are running the FlexViewer in debug modus, the rest-url for calling the PrintSOE is outputted in the console view.
You can try to open this url directly in your browser.

Tom


Good morning Tom,
It appears there are some missing image files - arrow_here.png & bullet_go.png.  I only had 1 image in the lu_assets folder...so I moved the missing image files there...that seemed to clear up the issue.  There is an mxd and pdf/png in the arcgisoutput folder.  I do not get the error all the time...it is sporadic.
Thank you
Eric
0 Kudos
EricVenden
Occasional Contributor II
Tom,
When the print works, the correct files (png/pdf & mxd) are located in the arcgisoutput folder, but when the print errors, there are only tmp files (6 total) in that folder.  It seems that when it does error out, all I have to do is clear the error popup and then click "Print" again...it has never given me the error message 2 times in a row.

I do have another question...if I want to leave layers off the Legend, can I insert my layers in the excludeLayers array?  I tried putting the names of map services there, but it seems that it may actually be map layer names that need to be put here...am I correct?

Thanks
Eric
0 Kudos
TomSchuller
Occasional Contributor III
Eric,
you could set the ArcGIS server log to verbose and check the error log.

For the legend, you have to use the layer names.
Just open a generated mxd and copy out the layername to the "excludeLayers" array.

Tom
0 Kudos
EricVenden
Occasional Contributor II
Tom,
Figured out the exclude layers issue.  I have 1 map layer that shows up in the legend, but not in the map...it is on and displays in the main application.  Have you seen this issue?

I also have a question on the scale text.  How do you calculate the size of the scale font?  I would like to make it smaller.
Thank you
Eric
0 Kudos
TomSchuller
Occasional Contributor III
Eric,
what is in the generated mxd? You should find there the source of the problem.

I will look the make the fontsize of the scaletext configurable.

Tom
0 Kudos