I need an application to produce a PDF file using several different custom templates.
I have a kmz file that defines my input geographic shapes, labels & coordinates.
The output needs to be for 8 1/2″ x 11″ normal paper, or for 32″ x 36″ plotters
My application uses a C# .net stack and a web service where I have access to SQLServer spatial functions.
I would like to implement it as part of my web silverlight application, but if I need to have a separate desktop application I will take that.
I need a solution quick, and the boss will pay for it – so a commercial library is OK.
My silverlight application is at http://MyDistrictBuilder.FloridaRedistricting.org
An example KMZ file is at
http://censusvalidator.blob.core.windows.net/mydistrictbuilderdata/Public%20Redistricting%20Plan%20Submissions/HPUBC0005_Kelly_Henry_KMZ.kmz
A example output PDF file is at
http://censusvalidator.blob.core.windows.net/mydistrictbuilderdata/Public%20Redistricting%20Plan%20Submissions/HPUBC0005_Kelly_Henry_8x11.pdf
UPDATE:
I’m thinking I can use ComponentOne C1pdf library in my silverlight app.
- Get shapes with lat/lon points from my database
- Convert them to x/y coordinates
(not quite sure about this, but some other posts here may help)
(Also not sure about getting the right paper size) - open a C1pdf document
- draw the shapes to the document using C1pdf.
Any experience out there with ComponentOne?
I hate to answer my own question, but I’ve waited long enough for some feedback, so here is what I wound up doing:
I went with the Component One Silverlight Studio. At $1200 bucks, it’s a little steep, but it works great. I used the C1pdfDocument and C1pdfViewer to integrate a pdf solution right into my web based silverlight app. The users click a button, I generate the pdf into a memory stream and load it into the viewer.
Lessons Learned:
I did have a little trouble with drawing colored polygons, till I realized that C1pdfDocument only takes an opacity of 1.0, anything else shows up as no color at all.
I needed to convert my lon/lat points to x/y coordinates, and flip the vertical access since I’m drawing shapes in Florida (Northern hemisphere), and then move the x/y to the origin of the box I was drawing in. It took me a little time to get it right, so I figured I’d post it here. Note that I don’t use a lot of fancy sperical or conical projections, the simple conversion works close enough for my purposes.
Hope this helps somebody. (If it does, give me an upvote, eh?)