ThinkGeo.com    |     Documentation    |     Premium Support

PDFExtension Vector Drawing Text does not scale with Map

I am using Desktop Edition 3.0.


When I attempt to draw my layers to a pdf page using the PDFExention Sample, my labels are "bigger" then they should be.  This becomes very noticable along the edges where partials are supposed to be supressed.


The labels draw because the supress algoritm believes they will fit, but when the pdf document is zoomed, the text scales faster then the map and therefore the text of labels can bleed off the edges.


Is there anyway to resolve this?



Jim, 
  
 Thanks for your post and questions. 
  
 I assume this problem is caused by the size of the PDF page is not compatible with map with and map height. 
  
 Could you try to modify as the PDF page size to match the ratio of    the map with and map height to see it works? 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale 
  


Are you saying that the aspect ratio may be different?  I’m not quite clear on what you are suggesting.

 


Jim.
 
Extent and ratio of the width and height are very important for the PDF printing in your situation. DrawingArea is a specific screen area which used for filling the image to. There might be something setting issue in your code. 
Please look at the sample code below. If you still can not solve the problem, could you paste your code here so that we can debug it?
 
            PdfDocument doc = new PdfDocument();
            PdfPage page = doc.AddPage();
            page.Width = 800;
            page.Height = 800;

            double resolution = Math.Max(Map1.CurrentExtent.Width / Map1.Width.Value, Map1.CurrentExtent.Height / Map1.Height.Value);
            RectangleShape newDrawingExtent = new RectangleShape(Map1.CurrentExtent.UpperLeftPoint.X, Map1.CurrentExtent.UpperLeftPoint.Y, Map1.CurrentExtent.UpperLeftPoint.X + 800 * resolution, Map1.CurrentExtent.UpperLeftPoint.Y - 800 * resolution);
            PdfGeoCanvas canvas = new PdfGeoCanvas();
            canvas.BeginDrawing(page, newDrawingExtent, GeographyUnit.DecimalDegree);
            worldLayer.Open();
            worldLayer.Draw(canvas, new Collection<SimpleCandidate>() { });
            worldLayer.Close();
            canvas.EndDrawing();

            canvas.DrawingArea = new System.Drawing.Rectangle(0, 0, 400, 400);
            canvas.BeginDrawing(page, Map1.CurrentExtent, GeographyUnit.DecimalDegree);
            rasterLayer.Open();
            rasterLayer.Draw(canvas, new Collection<SimpleCandidate>() { });
            rasterLayer.Close();
            canvas.EndDrawing();
            doc.Save("c:\\1.pdf");

 
Thanks
 
James

Hi, Jim.  
Thanks for sharing your problem. As for me, I have seldom tried to draw my layers to a pdf page using the PDF Exention Sample before. Have you ever worked it out? I wonder whether you have any exprience about the process of text extraction in pdf files. Because there is something wrong with my pdf reader. I need convert pdf into text or other formats. Any suggestion will be appreciated. Thanks in advance.     









Best regards,  
Pan

Hi Pan, 
  
 We are glad to hear your discuss about the pdf conversion, because it can help anyone met this problem. 
  
 Regards, 
  
 Don