Select to view content in your preferred language

Is there any print example that can be referenced for SL 4?

10847
71
07-14-2010 01:18 PM
weiliang
Deactivated User
I try to incorporate the print feature into our website (with SL 4, and ESRI API 2.0). I used the following code, but it direct me to the print dialog box only. How can I make a print template (e.g., http://citizengis.chesterfield.gov/) to print the current map extent with some controls (e.g, scale bar) into a pdf. Is there any easy way to do so or I must create a WCF service?


PrintDocument doc = new PrintDocument();
doc.PrintPage += (s, e) =>
{
   e.PageVisual = MyMap
   e.HasMorePages = false;
};
doc.Print("Map");

Many thanks,

Wei
0 Kudos
71 Replies
JeffSauder
Regular Contributor
Hi Lisa,

I did not get your email, my organization blocks .zip files and that is probably why.  Would you mind sending the code to jsauder@cox.net

Thanks,

Jeff
0 Kudos
LisaChesley
Emerging Contributor
Good afternoon, Jeff!

I just noticed that myself - the bounceback email ended up in my spam folder, so I didn't see it until this morning.  I have resent the project using a large email attachment tool which doesn't actually email you the attachment, but merely a link to the attachment which resides on our servers.  Hopefully that will pass your company filters, but if it doesn't, please let me know (at lchesley@oxfordcounty.ca) and I will send you the code unzipped.

Thanks, and have a great day!

Lisa
0 Kudos
AlexanderOvsyankin
Deactivated User


In the meantime, I'd be happy to email the project to anyone who'd like to see it.  Just post back with an email address that I can reach you at, and whether you'd like .zip or .rar.

Thanks!

Lisa


Hello Lisa,

Could you, please, send me your code sample at alex.ovsyankin@gmail.com? Thank you very much!

Rgds, Alex
0 Kudos
LisaChesley
Emerging Contributor
Good afternoon, James and Alex!

Your projects are in the mail. 🙂

Thanks!

Lisa
0 Kudos
BrianBorg
Emerging Contributor
Can some one send me the projects on borgb05@gmail.com please?

Regards
0 Kudos
JohnPalmbach
Emerging Contributor
Hi Lisa,
Thanks for your community support.  Could you send your example to me as well? 

johnpalmbach@alliantenergy.com

-John
0 Kudos
MartenLiebster
Deactivated User
Lisa,

Thanks for sharing your code (grabbed it from the other thread)!

Looks like the process essentially is to:
1) create a smaller (dimension wise) map
2) match the extent
3) copy the various layers
4) print

Is this correct?

Thanks again.
0 Kudos
TonyAlmeida
MVP Regular Contributor
wliang1 i am very interested on how your "Search" tool works, would you mind sharing that code?

Lisa could you send me the print code as well?    sttuntman@hotmail.com

Thanks.
0 Kudos
LisaChesley
Emerging Contributor
Good morning, all!

@Akilly, John, Brian - your projects are in the mail!  My apologies for the delay - yesterday was a holiday up here. 🙂

@Martin - yes, that is correct.  The reason I am creating a reasonably small map is that the user needs to be able to view the entire print sample on their screen - if they can't, the area they don't see will appear cut off on their printout.  This is a problem, as many of my target users only have 1024x768 resolution, but the 'resolution' for a standard page is 816 x 1056 (reversed if they print in landscape).  It's tricky to get exactly what they want without leaving a lot of whitespace on the page.  If you try to print on larger pages, I imagine that you'd run into much the same problem.

Thank you all for your kind words and acknowledgements - I've gleaned much useful information from these forums, it's nice to be able to give back. 🙂

Lisa
0 Kudos
LisaChesley
Emerging Contributor
Good afternoon, all!

I have finally compressed my project down enough to post it here!  Now included is a table of contents for the two dynamic layers on the map, based on the SOAP code from this thread:

http://forums.esri.com/Thread.asp?c=213&f=2455&t=289070

The code I built on is posted in the third, fourth, and fifth posts in the thread.

If you have any questions, please feel free to ask!

Lisa
0 Kudos