Print Legend on a seperat Page

5299
11
Jump to solution
11-17-2015 03:12 AM
MiriamBrockmann
Occasional Contributor

Hi there!

My Question is simple : can you print the Legend, made by the LegendLayer of the PrintTask on a seperate Page?

I've searched the Web up and down, but don't get any hints for a solution.

I've setup my own Layout, but can only place an Legendfield on the same Page. Theres no option for a second.

Regards, Miriam

1 Solution

Accepted Solutions
SteveCole
Frequent Contributor

I can think of perhaps one way of doing this but I'm not 100% sure (and I don't have actual code to share).

1.) Create and register two custom print templates with ArcGIS Server:

   * One print template is your basic map, minus the legend

   * Second print template has just your legend within the visible area of the layout (i.e. move the data frame off of the physical map space so it won't appear when you use the template).

2.) Use the 1st map template with PrintTask as you normally would.

3.) In the Callback function for the printTask, pass the results of the 1st printTask to a second function which generates the legend using the second print template.

4.) In the second printTask callback, initiate some sort of GP service using ArcPy to combine the two separate PDFs into the final, finished PDF.

Ugly, kludgy, and something I'd rather not tackle.

Steve

View solution in original post

11 Replies
MiriamBrockmann
Occasional Contributor

Has anybody an Idea how to make this? Or an Idea if this is possible or not?

0 Kudos
DanPatterson_Retired
MVP Emeritus

Only ArcGIS Pro supports multiple map view and layouts ArcGIS Pro | ArcGIS for Desktop

MiriamBrockmann
Occasional Contributor

Hello Dan!

Thanks for answering! I followed your Link and just find a hint to two seperate Mapframes, but no Option for a seperate Legend. Have you further Information?

Regards, Miriam

0 Kudos
DanPatterson_Retired
MVP Emeritus

There is no way to do it automatically other than moving other elements off the map leaving the legend (probably in graphics form).  ArcMap has suffered greatly for the inability to have multiple layouts like the old ArcView 3.x ... they are going to rectify that with ArcGIS PRO

0 Kudos
TracySchloss
Frequent Contributor

I wouldn't assume that just because you can have two map frames in ArcGIS Pro that this functionality will become available as a PrintTask through the Javascript API.  These are two different technologies.

0 Kudos
SteveCole
Frequent Contributor

I can think of perhaps one way of doing this but I'm not 100% sure (and I don't have actual code to share).

1.) Create and register two custom print templates with ArcGIS Server:

   * One print template is your basic map, minus the legend

   * Second print template has just your legend within the visible area of the layout (i.e. move the data frame off of the physical map space so it won't appear when you use the template).

2.) Use the 1st map template with PrintTask as you normally would.

3.) In the Callback function for the printTask, pass the results of the 1st printTask to a second function which generates the legend using the second print template.

4.) In the second printTask callback, initiate some sort of GP service using ArcPy to combine the two separate PDFs into the final, finished PDF.

Ugly, kludgy, and something I'd rather not tackle.

Steve

MiriamBrockmann
Occasional Contributor

Hello Steve!

I started a try in this direction yesterday. Seems to be the only Option to solve this.

I'll post the results, when i'm successful!

Regards, Miriam

0 Kudos
MiriamBrockmann
Occasional Contributor

Hello Steve!

Your suggestion did it! Now i can Print the Map on one Side an the Legend is printed on a second separate Page.

After the Map is printed i call the printtask.execute a second Time and call the Legend_Layout without the Map.

Works perfect.

Regards, Miriam

SteveCole
Frequent Contributor

Awesome! Sometimes I surprise myself. Glad you were able to code it.