Print custom information along with your map

1404
11
Jump to solution
08-20-2013 05:54 AM
RaduMihai
New Contributor
Hello Forum!

First I want to say that I am new to esri api so hold your horses 😄
Second I am not good at spelling either..
So i have followed some samples taken from the esri site for Javascript developers  in order to learn more about esri javascript api
For the current task,as an intern,I had to follow this sample :
[HTML]https://developers.arcgis.com/en/javascript//jssamples/fl_hover.html[/HTML]
For better understanding I have simplified the code of the given samples in order to get a better grip on the essentials.
(attached here)
Basically,I am trying to insert my own text (information) below(anywhere) my printed map.

Afterwards I will try to insert information taken from a JQuery self made pop-up(attached in my second file ) taken that from a sample too [HTML]https://developers.arcgis.com/en/javascript/jssamples/fl_hover.html[/HTML]
but first any text will do. 🙂

I have attached two files with my source code.

I am working with netbeans if it matters.

Any Ideas?
0 Kudos
1 Solution

Accepted Solutions
JasonZou
Occasional Contributor III
Unfortunately, you will have few control over what to add dynamically on the printout page if using esri Print widget or PrintTask. ESRI 's solution uses the map templates for the printout layout. There is nothing else you can add to it dynamically. If you like to add something dynamically, you will need to develop some custom print function on your own.

View solution in original post

0 Kudos
11 Replies
JasonZou
Occasional Contributor III
1. In order for you to add anything that not showing on the printout, more than likely, you will need to modify the MXD templates that served as the print page templates. You can find these templates under <arcgis server folder>/templates on your arcgis server machine. If you are using third party print url, that will be an unfortunate.
2. To add anything to your popup, you just need to modify the popup content.
0 Kudos
RaduMihai
New Contributor
1. In order for you to add anything that not showing on the printout, more than likely, you will need to modify the MXD templates that served as the print page templates. You can find these templates under <arcgis server folder>/templates on your arcgis server machine. If you are using third party print url, that will be an unfortunate.
2. To add anything to your popup, you just need to modify the popup content.


Thank you very much for your reply.

I was aware of No.2 answer..I was hoping I can include the content of the JQuery Popup into the printed version of the map,or something like that...

So in order to add anything else that is outside the pre-set attributes like a paragraph or input field I have which can be in some div,unfortunately I  have to modify the template.
0 Kudos
JasonZou
Occasional Contributor III
Unfortunately, you will have few control over what to add dynamically on the printout page if using esri Print widget or PrintTask. ESRI 's solution uses the map templates for the printout layout. There is nothing else you can add to it dynamically. If you like to add something dynamically, you will need to develop some custom print function on your own.
0 Kudos
RaduMihai
New Contributor
I see..
Thank you for the info !
It clarified my questions..

If I might encounter someting similar I will update the post.
Cheers!
0 Kudos
JeffPace
MVP Alum
TO add on, you can use the print class, just not the print template.

The workflow can be

1. Use print class to render your map as a single image by specifying the IMAGE return type (as opposed to PDF)
2. Then take that image and build your own output page, either PDF using a client or serverside library, or as a html page with a print.css style
0 Kudos
JasonZou
Occasional Contributor III
Hi Jeff, I am curious to know which print class you are talking about.
0 Kudos
JeffPace
MVP Alum
Sorry, print task

https://developers.arcgis.com/en/javascript/jsapi/printtask-amd.html

Then you set in the template the format of jpg ( or png) and map only.
0 Kudos
AdrianMarsden
Occasional Contributor III
Hi

Using the standard Print Widget you have three potential "things" to add your own text - I use them all, CopyrightText, authortext and titletext - the copyright and title I use for what they are supposed to be for.  the author I use for user added comments/text.  But there is no reason, say if you have a fixed title and copyright, to add these directly to the MXD in ArcMap and use those two things to hold extra user generated content.

ACM
0 Kudos
MatthewLawton
Occasional Contributor
Has anybody experimented with inserting markup into the titleText, authorText, or copyrightText values? I have a lengthy disclaimer I would like to add as the copyrightText, so I need to include a few line breaks, otherwise it runs off the page. However, the template doesn't seem to acknowledge any HTML break tags. Has anyone discovered another system of escape characters that might allow line breaks or maybe even bold or italic text?
0 Kudos