Vishful thinking…

Printing at 300 DPI with ArcGIS Server purely through the ADF

Posted in Uncategorized by viswaug on March 6, 2008

I just finished up a task for the current project I am working on where the client needed to be able print all the resources in the map at multiple resolutions and paper sizes. There are a lot of code snippets on ArcScripts that let you print maps using ArcGIS Server using the IMapServerLayout interface on the MapServer object. But using that approach did not solve 2 major requirements I had to satisfy

  • Ability to print multiple map resources that might be loaded on the map
  • Ability to print the GraphicsLayer from the web tier

Both these requirements would prevent using the IMapServerLayout interface for the printing task since IMapServerLayout works only on single map server objects and it cannot include the GraphicsLayer easily. So, I had just decided to use the DrawExtent method on the IMapFunctionality of every resource on the map after setting the required values on the DisplaySettings property and merge them together to get the complete map. Since, I had to print at 300 DPI, the size of the images I was requesting from ArcGIS Server was pretty huge. For printing a map on a A4 size paper, I was requesting an image size of ( ~ 3000 X 2000). But, whenever I made a call to DrawExtent for an image that size, I kept getting an image of size (2048 X 2048). After, banging my head against the walls for a few hours and using SOEXplorer, I figured out that MapServer objects have “MaxImageWidth” and “MaxImageHeight” settings that default to 2048. Once, I bumped up that number I was getting back images of the size that I requested. You can also bump up the “MaxRecordCount” property to enable ArcGIS Server to return more than 500 records for large queries. But before you bump this number up, take a minute to think about the consequences of handling such large number of records on the client side.

CropperCapture[38]

I was also concerned about the performance of ArcGIS Server when requesting images this size but the performance was acceptable and ArcGIS Server kept chugging along pretty good after several such requests. The GraphicsLayer also didn’t cause any problems for images that size (~ 3000 X 2000).

I moved on to generating ANSI D (plotter size maps) which resulted in size of images requested being more than (~ 10000 X 10000). To my pleasant surprise, ArcGIS Server didn’t throw a fit when requesting images that size. But, the GraphicsLayer didn’t like the request that size and decided to throw an exception saying ‘Parameter is not valid”. So, printing on a ANSI D size paper at 300 DPI should be possible if you don’t need that GraphicsLayer in the printout.

The GraphicsLayer decided to misbehave again when I was requesting images whose aspect ratio did not match the aspect ratio of the map on the browser. The ArcGIS Server had again played nice and returned map images with the aspect ratio requested. So, with the two resources not behaving consistently, I ended up with the final merged map images looking like below. You can see that the polygon on the GraphicsLayer was getting stretched vertically instead nicely overlaying the polygon from ArcGIS Server below.

CropperCapture[36]

But, this problem above I was able to work around. I was able to pre-calculate the extents that will be returned by the server and request the same size from the GraphicsLayer.

After all this, the printing functionality was not complete, the ADF had no easy way of obtaining a legend for all the resources on the map. You would think that the ADF would have the ability to generate a legend for the map already, but no luck on that yet. Hopefully in 9.3? But we couldn’t wait and hope for ESRI to include that feature. So, I went ahead and built the legend for the map dynamically. It wasn’t really that hard to do. I was able to request the swatches for the legend from the IMapTocFunctionality and create an image of the legend dynamically. Please contact me if you interested in the piece of code that generates the legend. I will be happy to share it with you. An example of the dynamically generated legend image is shown below.

Legend

With all the ingredients in place, I was able to generate a PDF of the map print out (looking like below) using the iTextSharp library.

CropperCapture[39]

80 Responses

Subscribe to comments with RSS.

  1. Kevin Dunlop said, on March 6, 2008 at 1:28 pm

    Great post.

    I am actually in the process of right the same thing you described here for one of our customers and using relative the same approach.

    One thing I am adding different is create layout page where the user can rearrange where each element will go and the size of it. Basically have a colored Div box for each element and some javascript that handles drag and drop and resize of them. When the user clicks generate pdf button, it sends the locate and size of all the div tags to server then my code will place them in the correct location using the iTextsharp library.

    Right now I am about half way done on mine. I would love to see your code on how you do this especially the part about the legend since I haven’t started that one yet. If you are able share any of it, please email me at kdunlop@spateng.com.

    Thanks for the great post.

  2. viswaug said, on March 6, 2008 at 1:46 pm

    Hi Kevin,

    I am taking the approach of using a configuration file to specify the XY location and the height/width of the image elements. I am also using an existing PDF file as a template and just inserting the map image, legend, title, name, date into it using the PDFStamper class in iTextSharp. This way only the dynamic elements are positioned during map generation.

    I will send the code you had asked for to you via email.

    Thank You,
    Vish
    http://Vishcio.us

  3. ruprict said, on March 6, 2008 at 5:56 pm

    Hey Vish,

    I’d love the code. In fact, I’d love any of your code😉.

    ggoodrich (at) enspiria.com

    Thanks!!

  4. Dylan said, on March 6, 2008 at 7:32 pm

    Vish,

    We’ve come up with a few approaches to this from the wildy unmaintainable (twice!) to much simpler and more configurable. The approach we’ve taken most recently is to use a .NET port of the Apache FOP project called nFOP. We can establish a nice layout in a configurable XSL format and then just supply the map image and other info like a DataTable of some tabular information we want to display. Apply the transformation and voila, we’ve got PDF output and some other formats as well. I’ve used PDFSharp in the past to do the same as what you’ve got with iTextSharp, but this FOP approach seems more flexible since the end user can monkey with the XSL and update their layout.

    Anyway, I am definitely interested in your approach to generate legend images and also deal with GraphicsLayer. Can you shoot me a snippet to dvhthomas at gmail dot com? Thanks for a well written and interesting post.

    Dylan

  5. viswaug said, on March 7, 2008 at 12:58 am

    Hi Dylan,

    I would throw out a word of caution on using the XSL-FO standard. The standard is a great idea but is real hard to implement. None of the products or frameworks in the market is completely compliant with XSL-FO. In fact, they had to come up with various (3) levels of conformance with XSL-FO for the products out there because of that reason.

    I will have the code out to you over the weekend.

    I am real interested in the success you have had with it though. I definitely agree that XSL-FO is the future for reporting.

    Thank You,
    Vish
    http://www.Vishcio.us

  6. pragnesh said, on March 7, 2008 at 8:35 am

    hi vish,
    i want the code to generate legend & pdf using itextsharp.
    If you can share your code?

    thanks
    Pragnesh

  7. Alex said, on March 7, 2008 at 3:06 pm

    Vish,

    I have also created a very similar task using iTextSharp. I originally used a static image for the legend to avoid problems of the legend being to big or not fitting in the alloted space. I would love to see the code that you are using for your dynamic legend if you don’t’ mind? I appreciate the help.

    Thanks for the great post.
    Alex

  8. Blair said, on March 10, 2008 at 5:28 am

    Vish,

    Wow…first of my coworker and I have struggled with printing via the web ADF and have implemented a very similar approach using iTextSharp and the WebADF. One isse that we have had is that we are not able to print a map to scale in the same manner that we are able to using the IMapServerLayout or the way we did via ArcIMS. Have you had similar issues? Also I would LOVE to see the snippet of code you are using to generate a legend. Right now we are just using a static image. My email address is bcd_mtb@hotmail.com. Thanks for such an awesome blog.

    Cheers,
    Blair

  9. Jonas said, on March 10, 2008 at 4:18 pm

    Hi Vish,

    We are also working on a print task, but we are using the Print custom task for the .Net WebADF found at ArcScript. The approach here is to use a server object extension to print the map in layouts generated in ArcMap. We are still having some problems with the graphics layer as it seems we cannot get the transparent fill types to work in pdf. I thin kwe will solve it by generating an image of the graphics layer with DrawExtent and at the image as a raster layer to the layout before printing.

    Anyway, we also need to have the legend so I would appreciate to see you code for creating the legend. My email is jonasengedal at gmail . com.

    Thx
    Jonas

    PS. Nice post

  10. Scott said, on March 12, 2008 at 3:08 pm

    Hi Vish,

    I’m getting ready to start programming for the same product you already created. If you wouldn’t mind sharing, that would be great!! Awesome work and it would save me tons of time. Thanks!

    Scott
    scw115@excite.com

  11. Daniel Karnes said, on March 14, 2008 at 8:13 pm

    What Scott said —

    I need to be able to print a map layout from a map control that looks at more than one service, so this looks like just the ticket. If you don’t mind sharing, that would be great…

    danl

  12. […] grew out of being able to print multiple map resources on the map through the ADF. I had blogged about it before here. I have made some changes to the code snippet after input from some other people trying to do the […]

  13. Christopher Vipond said, on March 17, 2008 at 8:02 pm

    A very interesting post – I am starting to work on developing a print task that can handle multiple map resources. The approach I had taken is to return each map image from each map resource and then merge them (same as you). I would be grateful if you could share your printing code with me as it would help me out a lot! – email: chris.vipond@hotmail.com

  14. Subbu said, on March 18, 2008 at 7:24 pm

    Hi Vish,

    I’m getting ready to start developing a print task to publich a PDF with lezend and Index dynamically. If you wouldn’t mind sharing, that would be great!!and it would save me lot of time. Thanks! email: itagsubbu@gmail.com

    Subbu

  15. Jay said, on March 25, 2008 at 7:25 pm

    Hey Vish,

    I just started working a print task where I need to be able to print graphics, I would be grateful if I could get my hands on your print code.

    Thanks Jay

  16. Russell Gibson said, on March 26, 2008 at 6:43 pm

    Hi, Vish. Great post. Would you be willing to share the code at my e-mail address? Thanks in advance.

  17. Philip Thompson said, on March 26, 2008 at 10:57 pm

    Hi Vish,

    Talk about convergent development. Your task does exactly what our one does, encounters the same issues and overcomes them with the same solutions (those distorded Graphics Layers were a pig and I only found the solution through pure dumb luck).

    What interests me is that you haven’t encountered any size limitations. I was only able to get metre square images at a dpi of 160 before the System.Drawing.Graphics DrawImage method call gives out with a OutOfMemoryException error. This is what I’m using to merge the images from the multiple resources and graphics layers and I assume you’re using something similar. If not what are you using to merge the images?

    This is more of a catch all error in the Drawing namespace but I was only testing the bounds rather than explicitly printing to A0 for a particular project so I wasn’t terribly concerned and just assumed I’d reached the limitations of this approach.

    ArcGISServer allows you to create images the size of a whale so you can be sure a User will eventually do so.

    Phil.

  18. viswaug said, on March 28, 2008 at 6:24 am

    Hi Phil,

    I didn’t have any OutOfMemoryExceptions(s). What is the dimensions of the image you are trying to generate in pixels?

    Thank You,
    Vish

  19. Philip Thompson said, on April 1, 2008 at 5:02 pm

    It seems inconsistent, possibly related to the type of data being printed and the size of the subsequent generated image, but an image of Height 9150px and Width 6575px at a DPI of 230 generates an image fine in ArcGISServer but throws the Out of Memory exception when attepting to merge the images.

    I’ve also seen your “Parameter is not valid” error message, though not exclusively on Graphics Layers.

  20. neeraja said, on April 2, 2008 at 5:29 am

    Great post.

    I am actually in the process of right the same thing you described here for one of our customers and using relative the same approach.

    please share the code to me my email id is neeraja.ec@gmail.com, it will be help ful for me. thanks

  21. Andrew Coats said, on April 2, 2008 at 3:31 pm

    Hi,
    I too am interested in the code to create the legend. Thanks for a great blog.

    Andrew

  22. Jason said, on April 2, 2008 at 5:02 pm

    Hi Vish,

    This is a great post and got me started in the right direction I am having problems with the graphics layer getting stretched and have not figured out how you are pre-calculating the extents is there any chance you could e-mail me a snippet of your pre-calculate method.

    Thanks,

    Jason

    jstewart143@tampabay.rr.com

  23. Chad Nelson said, on April 3, 2008 at 6:45 pm

    I am experiencing the same issues that you wrote about. Could you please provide me with the code?

  24. Subbu said, on April 4, 2008 at 1:32 pm

    Hi Vish,

    Would you be willing to share the code at my e-mail address? Thanks in advance.

    Subbu

  25. iamlaksh1 said, on April 15, 2008 at 11:50 am

    Great work. Can you share your code: laksh.gisprog@gmail.com

  26. Gregg said, on April 17, 2008 at 11:42 am

    Vish,

    Great post – would you mind sharing any of your available code to grefly at gmail . com? Thanks in advance –

    Gregg

  27. pragnesh said, on April 18, 2008 at 9:40 am

    hi vish,
    This is great post.
    I work around all the point described by you and able to generate the perfact export to pdf as you shown above.
    But, I am not able to do it with Graphics Layer.
    I will be very thankful to you, If you help me to work around Graphics Layer.
    Waiting for your Response !!

    Thanks
    Pragnesh

  28. Dan said, on April 21, 2008 at 7:53 am

    HI, Vish,

    Could I ask if you’re altering the size of your map control at run time before generating? Do you have a code snippet just for fetching the image, i’ve tried numerous ways all resulting in the same resolution. Any code snippet would be greatly appreciated.

    Dan

  29. Fernando said, on April 21, 2008 at 5:29 pm

    Hi Vish,

    I just landed on your blog after constant searching for the same thing I am trying to do. I have been trying to analyze code that is already out there and seem to have hit a road block, but your blog has inspired me and was hoping you can email me the code snippet for the legend creator and how you were able to pass the DisplaySettings and get the Graphics Layer to export with the PDF.

    Great blog BTW!

    -Fernando

  30. Felix said, on April 21, 2008 at 7:28 pm

    Hello,

    Uhm, you seem to have hit a sweep spot with the several map services, grahic layer and legend printing requirements. I have a task for a similar solution in my very near future, but I was looking at it from a web service implementation perspective.
    I would appreciate if you can share your code to give me a big headstart.

    Thanks,

    Felix

  31. Sean said, on April 22, 2008 at 5:44 pm

    Vish:

    I’m curious about two portions of your approach. First how you are performing the extent pre-calculation for the graphics layer. I’ve been getting around this issue by ‘reprojecting’ the graphicslayer image using GDI+ but this seems like a hack, your approach sounds more promising. I’m also interested in how you are setting up the layout for your dynamic legend so any code examples for these would be appreciated. Thanks for alerting me to iTextSharp, it is a great resource

  32. Tommy said, on April 22, 2008 at 6:58 pm

    Vish,

    Great work,I really want to know what you’ve done with printing PDF.Would you please share the code?

  33. Philip Thompson said, on April 23, 2008 at 9:12 am

    Sean,

    One approach to precalculating the extent to avoid the Graphics Layer being skewed is described on the ESRI User Forums.

    forums.esri.com/Thread.asp?c=158&f=2276&t=251310&mc=2#769164

  34. pragnesh said, on April 23, 2008 at 4:07 pm

    hi vish,
    Once again i am here.
    Is there any way to give the Name to the legend created as graphics?
    it comes long guid string. Is there any way to change the guid string with name??

    thanks

  35. Deep said, on May 28, 2008 at 8:09 am

    Hi,
    I am working on creating a dynamic legend of Scale dependent Map service. Every time i made a request i didnt get the updated legend. Can you please provide me the code through which you are performing the following task.

    Thanks
    Deep
    deeplakhanpal@yahoo.co.in

  36. viswaug said, on May 28, 2008 at 2:38 pm

    Hi Deep,

    See here https://viswaug.wordpress.com/2008/03/16/dynamic-legend-generation-through-the-adf/

    Thank You,
    Vish

  37. Steve said, on June 10, 2008 at 3:23 pm

    Hi Vish,

    Like everyone else, I think this is a great post. I’m on a tight deadline to do something similar and I would appreciate it if you could share your code to give me a head start.

    Keep up the good work!

    thanks,
    Steve

  38. Steve said, on June 20, 2008 at 10:20 am

    Hi Vish,

    Thanks for the legend code you sent. I’d actually already sorted this issue, and was more interested in the code you have used to create layouts using itext. I’ve been working with itext and following their examples for a few days now, but the results aren’t always as expected.

    Also, I was wondering if anyone else is having issues with layer transparency when using the print task? I have a problem where transparency is seemly ignored sometimes (rendering the layer black in the resulting image). This occurs intermittently, and seems to be connected to the scale you are viewing the map at. Any help would be appreciated!

    Thanks,

    Steve

  39. mei said, on July 1, 2008 at 10:23 am

    Hi viswaug

    interesting post. from the EDN forums, all i’ve seen are local connections using the IMapServerLayout interface, so your implementation using DrawExtent method on the IMapFunctionality is interesting.

    do you experience any delay in generating the pdf, as i find that using local connection and the IMapServerLayout interface is slow and sometimes the ? This is using the internet connection instead of local connection right?

  40. viswaug said, on July 1, 2008 at 10:45 pm

    Hi Mei,

    The delay is propotional to the image size being retreived. If you are trying to retreive an image for a 300 DPI print, there is going to be bigger delay. But the delay is not at all bad enough to not use this technique.

  41. Don said, on July 10, 2008 at 3:12 am

    Hi Vish,

    Great post and good discussion here! I am developing a similar function if not exactly the same. I am facing difficulties in generating an image from Graphics Layer and creating legend. It would be great help if you would share your code with me at xdhong at gmail.com?

    I appreciate it.

    Don

  42. James Hemphill said, on July 14, 2008 at 6:13 pm

    Hi Vish,

    I’m really struggling to get the combined resources to print out with the pagelayout without converting back to AGS objects…

    It would really help if I could see a snippet of your code to help me on my way.

    Many thanks,

    James
    hemphill101@hotmail.com

  43. Askailla said, on July 22, 2008 at 12:37 pm

    Hi viswaug

    Im looking for a very same tool can you please provide me with your code at askailla@gmail.com

  44. Vibhav Joglekar said, on July 22, 2008 at 12:39 pm

    Hi Viswaug,

    Nice work…
    I a workign on a similar task and have almost done with the print task. I am interested in the legend part. Can you share the code with me please for generating the legend. That would be of great help.

    Keep up the good work Viswaug..

    Thanks,

    Vibhav

  45. JP said, on August 18, 2008 at 4:07 pm

    Hi viswaug,
    I have done something similar to what you describe here. I, too, would like to print my maps at 300dpi, but I can’t get my scale bar to return at that resolution – only 96 dpi – which means it does not accurately display the scale of my map. How did you get your scale bar to print out correctly?

    Thanks for your help.

  46. Aaron said, on September 5, 2008 at 6:40 pm

    Vish,

    Outstanding post. I have been battling with this for some time and your approach to the legend is very nice. Is there any way that you would be willing to also share your print code? I know that this took awhile to complete, but would really be of great value to me and the ArcGIS Server community. Let me know what you can do and thanks again for the great post and ideas!

    Thanks for the support!

    Aaron

  47. Thanan said, on September 16, 2008 at 9:03 am

    It’s a good post. It will be very helpful if you could you also share the implementation way of the above code.

  48. Thanan said, on September 17, 2008 at 6:28 am

    Vish,

    I need to display the legend with only the item in the current map extent durin print process.Can anybody tell me what changes I need to do in the above posted code so that I can get legend information of layers visible in the current Map extent???

    -Thanan

  49. Jennifer said, on October 9, 2008 at 8:59 pm

    Hi Vish,
    This is a fantastic article. I am about to embark on adding printing capabilities to an ArcGIS Server application as well. I would really appreciate it if you could share your code on how you were able to print the map including the featuregraphics layer and TOC. Thanks!
    Jennifer

  50. Jason said, on October 17, 2008 at 5:20 pm

    Thanks for the great post Vish, I am traditionally an ArcObjects developer now creating an ArcGIS Server website with the 9.3 ADF. I have all the elements in place but would love to incorporate the kind of print capability you have employed. I need to print multiple services and graphics layers. I would really appreciate you code for this if possible. Keep up the good work.

  51. MRR said, on October 20, 2008 at 9:43 am

    Great job!!

    i need to print multiple resources and one graphiclayer too. i would really appreciate your code for this.

    best regards

  52. Junny said, on October 24, 2008 at 6:43 am

    hi vish,
    i want the code to generate legend & pdf using itextsharp.
    If you can share your code?

    thanks

  53. Brad said, on October 24, 2008 at 7:48 pm

    Vish,

    I think you’re a good ways ahead of the curve here (still). Those of us on the back end appreciate you putting this online. Would you be willing to share your code for this?

    Thanks a lot.

    Brad

  54. Lynn said, on October 30, 2008 at 5:59 pm

    Wow, that is some great thinking! Code I get a copy of your code? I’m using 9.3, but I’m guessing there aren’t too many changes.

    Just in case,
    Could I also get a copy of your code for the dynamic legend?

    Thanks,
    Lynn

  55. Matt Heller said, on November 25, 2008 at 11:09 pm

    This would help me out a lot in all of my 9.3 ArcServer ADF apps. Could I also get a copy of your code?

    thanks,
    Matt

  56. Paul Bushore said, on December 12, 2008 at 9:50 pm

    Hello!

    Great thinking about printing! I am looking for code to teach myself how to do this and I was wondering if you would be ok with sending me the code so I can get some ideas? I am working with 9.2.

    Thank you again!

  57. Bobby said, on January 9, 2009 at 7:02 pm

    I am actually in the process of right the same thing you described here for one of our customers and using relative the same approach.

    Can you please share the code and help me out in completing this task.

    Regards,
    Bobby.

  58. Chad said, on January 14, 2009 at 9:46 pm

    Great post. Like all the others, I too need to export multiple map resources. I would very much appreciate getting your code.

    Thanks

    chad

  59. Carlos Plaza said, on January 14, 2009 at 10:52 pm

    Hi Vish,

    Great post.
    Could you please share the code to my email carpla@gmail.com?
    I hope this help me on printing PDF maps depending on scale, dpi, size, … for multiple services and graphics layers.

    Thanks!
    Carlos

  60. Natalia said, on January 27, 2009 at 9:38 am

    Hi Vish, I am looking for code to print PDF maps with ADF.
    Could you please share the code to my email nalcoba@gmail.com?
    Thanks, Natalia

  61. Vickie said, on January 27, 2009 at 10:07 pm

    Vish,

    I’ve seen lot’s of people requesting your code and no replies from you saying you won’t. So…., could you please email me the code to print PDF of different sizes & multiple layers: vmbackus AT msn.com.

    Thanks so much – Vickie

  62. Meliton said, on January 30, 2009 at 4:02 pm

    Hello.

    I´m trying to do something like that.
    I see you blog and the article is very interesting.

    Could you please share the code to my email mtienda@sigsa.info, please?

    Thanks so much

  63. Stan Shelton said, on February 4, 2009 at 7:09 pm

    I, like many others, am trying to do the samething.
    Please share the code with me at shelton@lojic.org.

    Thanks a ton

  64. Dave said, on March 3, 2009 at 11:38 pm

    Vish, could you please send me your code for creating high res PDF map layouts with the Graphic Layer.

    davehighness@gmail.com

    Thank you, Dave

  65. abhi said, on March 10, 2009 at 5:24 am

    Hi Vish,

    Like everyone else, I think this is a great post. I’m on a tight deadline to do something similar and I would appreciate it if you could share your code to give me a head start.

    could you please send me your code for creating high res PDF map layouts with the Graphic Layer.

    Keep up the good work!

    thanks,
    abhi,

  66. abhi said, on March 24, 2009 at 2:00 pm

    Does anyone know, how to print the transparent graphics layer? I sent the buffered features to SOE, which has transparencies. But they are printing non-transparent.
    I set the graphics symbol transparent, but still no luck.

    Any workaround besides saving it as a shapefile and bring it back to SOE.

    Thanks,

    Shail

  67. Abhi said, on March 31, 2009 at 9:57 pm

    Vish,

    How to print the map from internet resource instead of local resource?

    I was using the SOE to print the map. Any hint would be appreciated.

  68. Eric said, on April 2, 2009 at 10:04 pm

    Vish,

    Have you considered publishing your code to the ESRI forums (or have you already)? I’d like to take a look at what you did if you could send me the source code.

    Thanks!
    Eric

  69. Gary said, on April 9, 2009 at 7:27 pm

    Vish,

    Looks like a great tool I’ve had problems myself accomplishing these features, would you mind sharing the source code with me.

    Great Post.

    Gary

  70. Morten said, on May 14, 2009 at 8:10 am

    More than a year has gorne and it still looks to be the best attempt. Why can’t ESRI understand that our customers wants to print what they see in a good quality?

    In my attempt I have a problem with the custom graphics. Colors and size works fine but the style doesn’t. I hope your code could inspire me, so would you please send me a copy? Thanks

    \Morten

  71. Neil said, on June 15, 2009 at 4:10 pm

    Hi,

    Like everyone else…great post. We are looking to implement the same functionality and a look at the code would be greatly appreciated if possible.

    Thanks,
    Neil

  72. lm said, on July 29, 2009 at 7:16 pm

    do you have the code for this task? i need do something simliar

  73. jk said, on July 31, 2009 at 2:55 am

    Hi , i have problems with itextsharp to scale images , can you tell me what is wrong?

    Dim tableImg As New PdfPTable(2)
    Dim widths As Integer() = {((PageSize.A4.Rotate.Width * 80) / 100) + PageSize.A4.Rotate.Width, ((PageSize.A4.Rotate.Width * 20) / 100) + PageSize.A4.Rotate.Width}
    tableImg.SetWidths(widths)
    Dim jpegMap As Image = Image.GetInstance(pimageMap)
    jpegMap.ScaleAbsolute(600, 500)
    jpegMap.Alignment = iTextSharp.text.Image.ALIGN_LEFT
    Dim cellImagen As PdfPCell = New PdfPCell(jpegMap,False)
    cellImagen.Border = 15
    cellImagen.BorderColor = Color.BLACK
    tableImg.AddCell(cellImagen)
    Dim jpeglegend As Image = Image.GetInstance(pimagelegend)
    jpeglegend.ScaleAbsolute(200, 500)
    cellImagen = New PdfPCell(jpeglegend, False)
    tableImg.AddCell(cellImagen)
    tableImg.WidthPercentage = 100
    document.Add(tableImg)

  74. Flo said, on January 15, 2010 at 11:48 am

    Hi,

    I’ve to do some something similiar to combine multiple resources (cache + dynamic data) for printing. Would be great if you could share your code!

    Thx
    Florian

  75. Vipal said, on March 17, 2010 at 9:27 pm

    Hi Vish,

    Thanks for your post. It helps great!!!. Can you send me code for generating layout as shown in picture? Email id:vipal.shah@gmail.com

    Thanks,
    Vipal

  76. Michael said, on March 23, 2010 at 2:29 pm

    Wish, great stuff… I’ll stand the queue for sharing the code. I have problem especially with the graphics layer that is always skewed. thank you. nnevie@gmail.com

  77. Sharon said, on August 27, 2010 at 4:49 pm

    Hello – This is similar to what we have been struggling with. If you are willing to share the code, I would sure appreciate it. Thank you in advance!

  78. Usman Jamil said, on January 13, 2011 at 6:13 am

    Hi Vish, i am struggling with a similar task. can u plz share the code for this at my email: usman.jamil08@gmail.com
    Thanx in advance

  79. saidman said, on July 2, 2011 at 12:44 pm

    Great post.
    Could you please share the code to my email said.boubakri@gmail.com?
    I hope this help me on printing PDF maps depending on scale, dpi, size, … for multiple services ( Local, BingMaps….) and graphics layers.

    Thanks!

  80. luca said, on September 9, 2011 at 9:55 am

    Hi Vish,
    I have been working on this fore days, I would like to ask you to share your code, if it is possible for you this is my email defelice.luca at gmail.com.
    thanks a lot
    Luca


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: