Select to view content in your preferred language

Advanced print solution

53568
296
02-19-2011 10:52 AM
TomSchuller
Frequent Contributor
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
Frequent Contributor
Good morning (here at least) Tom,
I had your advanced print widget working in 2.4 viewer - with some tweaks to the uncompiled code.  I am now trying to implement the widget you created in the 2.5 viewer.  I have many compile errors.

As I type this - it appears that the latest files I downloaded did not have the json folder.  When I added this folder to my Flash project, I received even more errors - mainly AgsJsonElement related errors found in the PchPrintWidget.mxml & the PopUp_pictureElement.mxml files.

Could you advise?
Thanks for your time.
Eric V
0 Kudos
TomSchuller
Frequent Contributor
Hy Eric,
I just downloaded the latest sources of the bitbucket page:
http://bitbucket.schuller.lu/pchprintwidget/get/f79824d69e04.zip

I also downloaded the FlexViewer 2.5:
https://github.com/ArcGIS/ArcGISViewerForFlex/zipball/flexviewer-2.5-src

I copied from the pchprintwidget the complete "src" directory to the flexviewer src directory (asked to override the config.xml)
I added the "src\lu\etat\pch\gis\widgets\pchPrintWidget\PchPrintWidget.mxml" as module in the FlashBuilder project.

It compiled successfully and worked out-of-the box.

How did you downloaded the latest source?

Which small tweaks did you added to your version? May be I could integrate them directly in the codebase?

Tom
0 Kudos
EricVenden
Frequent Contributor
Thanks for the quick reply Tom,l

I just downloaded the code you posted, added the PchPrintWidget.mxml to the project and it came up with 10 errors.  I am using the 4.1 SDK with FB 4

One thing I noticed is that the lu_assets folder is not in the download you referenced in your post to me...but that shouldn't matter for my issues, I believe.

The errors are referencing the PopUp_Template.mxml (Type was not found or was not a compile-time constant: AgsJsonElement)
and
the PchJSONUtils.as (Access of undefined property - AgsJsonRGBColor, AgsJsonSimpleFillSymbol,AgsJsonSimpleLineSymbol, etc

Thanks Tom
Eric V


Hy Eric,
I just downloaded the latest sources of the bitbucket page:
http://bitbucket.schuller.lu/pchprintwidget/get/f79824d69e04.zip

I also downloaded the FlexViewer 2.5:
https://github.com/ArcGIS/ArcGISViewerForFlex/zipball/flexviewer-2.5-src

I copied from the pchprintwidget the complete "src" directory to the flexviewer src directory (asked to override the config.xml)
I added the "src\lu\etat\pch\gis\widgets\pchPrintWidget\PchPrintWidget.mxml" as module in the FlashBuilder project.

It compiled successfully and worked out-of-the box.

How did you downloaded the latest source?

Which small tweaks did you added to your version? May be I could integrate them directly in the codebase?

Tom
0 Kudos
TomSchuller
Frequent Contributor
Eric,
could you mail me your project?
tom@schuller.lu
I will check it. Seems to be something wrong.

I'm currently on Flex SDK 4.5.1

Tom
0 Kudos
EricVenden
Frequent Contributor
OK Tom,
Not sure if you got my email...but - I created a brand new project from scratch - did exactly as you stated in the previous post....and I get the same errors....
The errors are on lines 15&21 of the PopUp_Template.mxml file (Type was not found or was not a compile-time constant: AgsJsonElement)
and on lines 12,13,61,63,96,100,120,122 of the PchJSONUtils.as file - all those lines reference some symbol

I do see that the json folder (in the was missing from the "latest" download also)
I will add this folder and test

I am using the 4.1 SDK - I may also attempt the 4.5.1 version.
Thanks
Eric


Eric,
could you mail me your project?
tom@schuller.lu
I will check it. Seems to be something wrong.

I'm currently on Flex SDK 4.5.1

Tom
0 Kudos
EricVenden
Frequent Contributor
Tom,
I have tried numerous options.

FB 4 with 4.1 SDK - 2.5 Viewer loaded from scratch
FB 4.6 with 4.1 SDK - 2.5 Viewer loaded from scratch
FB 4.6 with 4.5.1 SDK - 2.5 Viewer loaded from scratch

with and without the json folder


I have attached a screen shot of the errors.
Thanks for your time.
Eric
0 Kudos
TomSchuller
Frequent Contributor
Eric,
your project seems to miss some needed files.

You can get the complete sources under:
http://bitbucket.schuller.lu/pchprintwidget/src
   upper right corner "get source" -> zip file

Tom
0 Kudos
EricVenden
Frequent Contributor
Thanks for your patience Tom,
When I tried clicking on the "Get Source" button, I only received the compiled code files (.swf & xml), so I retrieved the files under the src listing on bitbucket that you posted and now I only receive 1 error - referencing the "title" tag in the PchPrintWidget.mxml document.

The error says "The entity "mdash" was referenced, but not declared"  (line 7)

If I comment this line out or replace this title tag with something else, I get another error referencing line 234 = "The reference to entity "s" must end with the ';' delimiter.

I apologize as I am not a developer, but only a hack.
Thanks for your time
Eric V

Eric,
your project seems to miss some needed files.

You can get the complete sources under:
http://bitbucket.schuller.lu/pchprintwidget/src
   upper right corner "get source" -> zip file

Tom
0 Kudos
TomSchuller
Frequent Contributor
Eric,
when clicking on the "get source" button,
you should get this link:
http://bitbucket.schuller.lu/pchprintwidget/get/f79824d69e04.zip

This download should contain the binaries and the source files.
I also attached it to this post, so you can check if it solves your problem.

Tom
0 Kudos
EricVenden
Frequent Contributor
Thanks Tom,
That link contains ALL the files...The project is good now.
Thanks for your help.
Eric V


Eric,
when clicking on the "get source" button,
you should get this link:
http://bitbucket.schuller.lu/pchprintwidget/get/f79824d69e04.zip

This download should contain the binaries and the source files.
I also attached it to this post, so you can check if it solves your problem.

Tom
0 Kudos