Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6250717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:28:41+00:00 2026-05-24T13:28:41+00:00

I need an application to produce a PDF file using several different custom templates.

  • 0

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.

  1. Get shapes with lat/lon points from my database
  2. 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)
  3. open a C1pdf document
  4. draw the shapes to the document using C1pdf.

Any experience out there with ComponentOne?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:28:44+00:00Added an answer on May 24, 2026 at 1:28 pm

    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:

    1. 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.

    2. 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?)

        public void AddFillPolygon(List<Point> points, Color color)
        {
            DrawMainPolygon(points, color, mapBorderWidth, mapBorderHeight);
        }
    
        public void AddZoomFillPolygon(List<Point> points, Color color)
        {
            DrawTampaPolygon(points, color);
        }
    
        private void DrawMainPolygon(List<Point> points, Color color,  
                                       double borderWidth, double borderHeight)
        {
            double lonMin = -87.8;
            double lonMax = -79.9;
            double latMin = 24.29;
            double latMax = 31.11;
            DrawGenericPolygon(points, color,  
                                       lonMin, lonMax,  
                                       latMin, latMax,  
                                       borderWidth, borderHeight);
        }
    
        private void DrawTampaPolygon(List<Point> points, Color color)
        {
            double lonMin = -82.855;
            double lonMax = -82.07;
            double latMin = 27.57;
            double latMax = 28.175;
            DrawClippedPolygon(points, color,  
                                       lonMin, lonMax,  
                                       latMin, latMax,  
                                       tampaWidth, tampaHeight, tampaCursor);
        }
    
        private void DrawGenericPolygon(List<Point> points, Color color, 
                                       double lonMin, double lonMax, 
                                       double latMin, double latMax, 
                                       double borderWidth, double borderHeight)
        {
            Point[] XYPoints = ConvertLatLonToXYList(points, lonMin, lonMax,  
                                       latMin, latMax, borderWidth, borderHeight, 1);
            ShiftXYPointsToOrigin(XYPoints, mapBorderCursor);
            pdf.FillPolygon(color, XYPoints);
            pdf.DrawPolygon(new Pen(Colors.Black, 0.25), XYPoints);
        }
    
        private void DrawClippedPolygon(List<Point> points, Color color, 
                                       double lonMin, double lonMax,  
                                       double latMin, double latMax,  
                                       double borderWidth, double borderHeight,  
                                       PDFCursor clipCursor)
        {
            Point[] XYPoints = ConvertLatLonToXYList(points, lonMin, lonMax, latMin, latMax, 
                                        borderWidth, borderHeight, 6);
            ShiftXYPointsToOrigin(XYPoints, clipCursor);
            pdf.SetClipRect(new Rect(new Point(clipCursor.x, clipCursor.y),  
                                       new Size(borderWidth, borderHeight)));
            pdf.FillPolygon(color, XYPoints);
            pdf.DrawPolygon(new Pen(Colors.Black, 0.25), XYPoints);
            pdf.ResetClipRect();
        }
    
        private static Point[] ConvertLatLonToXYList(List<Point> modifiedPoints,  
                                       double lonMinValue, double lonMaxValue,  
                                       double latMinValue, double latMaxValue,  
                                       double borderWidthX, double borderHeightY,  
                                       int roundDecimalPoints)
        {
    
            Point[] XYPoints = new Point[modifiedPoints.Count] ;
            int index = 0;
            foreach (var z in modifiedPoints)
            {
                XYPoints[index] = ConvertLatLonToXYPoint(z, lonMinValue, lonMaxValue,  
                                       latMinValue, 0.0, 0.0,  
                                       borderWidthX, borderHeightY, roundDecimalPoints);
                index++;
            }
    
            return XYPoints;
        }
    
        public static Point ConvertLatLonToXYPoint(Point latlon,  
                                       double lonMinValue, double lonMaxValue, double latMinValue, 
                                       double xScaledMin, double yScaledMin,  
                                       double xScaledMax, double yScaledMax,  
                                       int roundDecimalPoints)
        {
            Point result = new Point();
            double scale = (float)(xScaledMax - xScaledMin) / (float)(lonMaxValue - lonMinValue);
            double offsetX = lonMinValue * scale - xScaledMin;
            result.X = latlon.X * scale - offsetX;
    
            // use the same scale to adjust lattitude
            double offsetY = latMinValue * scale - yScaledMin;
            result.Y = latlon.Y * scale - offsetY;
    
            // The y value is inverted on the map, because lat/lon origin (for florida) is at bottom right
            // x/y origin (for PDF document canvas) is at top left
            // this means for y values number comes out inverted and we have to flip it
            result.Y = yScaledMax * ((yScaledMax - result.Y) / yScaledMax);
    
            return result;
            //return (double)Math.Round(result, roundDecimalPoints);
        }
    
        private void ShiftXYPointsToOrigin(Point[] points, PDFCursor originCursor)
        {
            for (int index = 0; index < points.Length; index++)
            {
                points[index].X += originCursor.x;
                points[index].Y += originCursor.y;
    
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a host application that controls various factory classes which produce implementations of
I need a Javascript application that, when run, prompts a password to be entered,
In certain areas in my application I need data from several tables in the
I have a java application I need to pass some info to a C++
BACKGROUND I am using a commercial application on windows that creates a drawing This
We have a project where we need to convert the following file types to
I have a web application in Spring that has a functional requirement for generating
I'm currently using JScript.NET for a small UI application. The problem is that my
I need to develop a file indexing application in python and wanted to know
i have a input tag which is non editable, but some times i need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.