The ability to print my map to pdf in ESRI ArcGIS Server is something I have wanted for a while. There are several examples available on ESRI's website from ESRI and others developers have shared their examples as well. But I haven't found the print examples easy to follow or to apply. So I made one "Chris" simple. Feel free to read about my PrintTask if you haven't. It uses iTextSharp, but one thing I did not mention is that you can use the same code to print any image that iTextSharp supports and everything I did can be done at no cost to you. Having a job in GIS isn't even required.
Now for the topic at hand; clean code. I thought it was more important for my fellow developers to have the knowledge of how to print a map to pdf. If I were in their shoes, I would not want to wait to learn the functionality that could be added to my application, so I did not want you to have to wait either.
And now you have a PrintTask in which you can integrate into your ESRI ArcGIS Server applications using the JavaScript API 2.1. However, if you know how to export the map in Flex or Silverlight, you can apply this same example in those API's as well as the page that displays the pdf uses no GIS API's of any kind; it just references the location of the image.
But why am I still talking about the PrintTask? I did not separate presentation, functionality and content. If you are not familiar with this, you are not alone. Now you need to know, I am not "the authority" on website design, but I do the best I can to apply what I learn from other professionals and programming books.
I listed three books that I have bought below from SitePoint. They are easy to read books and a good starting point. You can check your local library first. The first one I mention is quite possibly available there and the best one of the three. Build Your Own Website the Right Way will help with basic CSS, but I would skip the chapter on HTML forms. I did. I want to build .NET pages, so HTML forms is not an area I was too concerned about. Concepts of this book are applied to my examples, but where the book takes you on a learning tour of creating well-formed websites with HTML; I will extend the information and show you how to apply those same well-formed techniques in .NET. That's not in the book. Simply JavaScript is a lot to take in, but it does drive home the importance of separation of content, display and functionality. jQuery is there because I just like it. However, if you don't want or need a book, don't worry. I plan on taking you through the steps that these books use and plan on showing you how to take that information further, by integrating the topics with .NET, JavaScript Framework, and mapping API's. But, you do need to be aware that I will be starting with .NET, not HTML. It will be easier than you think, just follow along and if you get lost, just speak up and I will give you directions.
I listed three books that I have bought below from SitePoint. They are easy to read books and a good starting point. You can check your local library first. The first one I mention is quite possibly available there and the best one of the three. Build Your Own Website the Right Way will help with basic CSS, but I would skip the chapter on HTML forms. I did. I want to build .NET pages, so HTML forms is not an area I was too concerned about. Concepts of this book are applied to my examples, but where the book takes you on a learning tour of creating well-formed websites with HTML; I will extend the information and show you how to apply those same well-formed techniques in .NET. That's not in the book. Simply JavaScript is a lot to take in, but it does drive home the importance of separation of content, display and functionality. jQuery is there because I just like it. However, if you don't want or need a book, don't worry. I plan on taking you through the steps that these books use and plan on showing you how to take that information further, by integrating the topics with .NET, JavaScript Framework, and mapping API's. But, you do need to be aware that I will be starting with .NET, not HTML. It will be easier than you think, just follow along and if you get lost, just speak up and I will give you directions.
Before sharing how to build a well-formed site template, I want to share with you some basics that I think are important, commenting and documenting your work by showing you how to write code that creates an XML file for you.
If you want to become more involved with the developer community collaborating, live, online and even in person, I would like to invite you to join the Web Dev Network on LinkedIn. Just click the link below and request to join. If you do not already have a LinkedIn account, you will need to create it first. But it's free and we have live online meetings. There is no video yet, but you can talk, watch, and even present.

No comments:
Post a Comment
I have had the opportunity to share this with you and I encourage you to share your comments with me.