Select to view content in your preferred language

Printing with Custom Text Elements

6764
15
Jump to solution
07-05-2012 06:16 AM
JustinGreco
Frequent Contributor
Are custom text elements not supported in the JavaScript API yet when using the 10.1 print service?  I do not see it as a property for layoutOptions for the PrintTemplate class.
0 Kudos
1 Solution

Accepted Solutions
JustinGreco
Frequent Contributor
The workaround was to create a Python script and add a string parameter for the text for the custom text element.  Then in JS I passed the text to the extraParameters property of the PrintParameters class.  Interesting that customTextElements is a property in the Flex and Silverlight APIs, but not JavaScript.

View solution in original post

0 Kudos
15 Replies
JustinGreco
Frequent Contributor
The workaround was to create a Python script and add a string parameter for the text for the custom text element.  Then in JS I passed the text to the extraParameters property of the PrintParameters class.  Interesting that customTextElements is a property in the Flex and Silverlight APIs, but not JavaScript.
0 Kudos
KevinGooss
Regular Contributor
Ugh. I just wasted 3 hours trying to figure this out.
Why have something exposed by the REST api then not support it in the js api?
This makes the task of exposing a simple extra text element much more complex.
So your saying that now i have to generate a custom python script just to handle this.
that stinks. but thanks for the info.
0 Kudos
KevinGooss
Regular Contributor
maybe this will be fixed in service pack 1?
Pretty please...
0 Kudos
KevinGooss
Regular Contributor
Also, what if i want to pass in, say, 5 additional fields. Would those all be extra params in the python or would i have to parse them in with a delimiter and jam them into a single field? crud.
0 Kudos
KevinGooss
Regular Contributor
Does anyone know if there is a way i can jack the api-generated request before it goes over the wire so i can inject these missing elements myself? Is there an event that provides access to the generated request after the printTask.execute method is called?
0 Kudos
KevinGooss
Regular Contributor
Or, even better, is there a way to generate the web_map_as_json string client-side without shipping it off?
0 Kudos
AdrianMarsden
Honored Contributor
bump.
Before I start to write my Print routine for my ArcIMS replacement internal thingie, is there any change in this?  I need to be able to

  • Add title

  • Add Comments

  • Be to specific Scale - and to print at that scale

  • Add Legend

  • Add Scale Bar

  • Add North Arrow

  • Have multiple page templates

The Print Widget is close to doing this, but it seems not all the way there.

The more advanced print tools (like tutorials here) seem overly complex and take nearly a minute to produce.  My ArcIMS users will see that as a step backwards however much I tell them that the PDFs are much better quality.

So do I embark on the Print Widget, and modifying it as described above, or wait to see if improvements are on the way with 3.3?

Cheers

ACM
0 Kudos
KevinGooss
Regular Contributor
Hopefully js api 3.3 is on the way any day now and esri has heard our pleas to include the custom text elements.
0 Kudos
JianHuang
Deactivated User
3.3 will add support for customTextElements in PrintTask.
Thanks.
0 Kudos