ThinkGeo.com    |     Documentation    |     Premium Support

Large ShapeFile printing problem

 Hi,


I'm trying to print large shape file (200 MB). 


I use "Large Scale Map Printing"  sample codes.


Print preview and printing works fine, The problem ist MapPrinterLayer doesn't show the shape .


I don't see this problem with small shapes.


Thanks in advance.


Shaahin



Hi Shaahin, 
  
 Thanks for your post, please get the latest 6.0.348.0 or 6.0.0.348 and have a try. 
  
 Regards, 
 Edgar

Thanks for your response.  

Using latest version solved my problem but now send to printer doesn't work with any shape file. 


Stack trace :  



System.NotSupportedException: "Specified method is not supported."


 


   at ThinkGeo.MapSuite.Core.PrinterGeoCanvas.NDQ=(GeoBrush NTQ=)


   at ThinkGeo.MapSuite.Core.PrinterGeoCanvas.EzQ=(IEnumerable`1 FDQ=, GeoPen FTQ=, GeoBrush FjQ=, Single FzQ=, Single GDQ=, PenBrushDrawingOrder GTQ=, PrintPageEventArgs GjQ=)


   at ThinkGeo.MapSuite.Core.PrinterGeoCanvas.EDQ=(Collection`1 ETQ=, PrintPageEventArgs EjQ=)


   at ThinkGeo.MapSuite.Core.PrinterGeoCanvas.CTQ=(Object CjQ=, PrintPageEventArgs CzQ=)


   at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)


   at System.Drawing.Printing.PrintController.Print(PrintDocument document)


   at System.Drawing.Printing.PrintDocument.Print()


   at ThinkGeo.MapSuite.Core.PrinterGeoCanvas.EndDrawingCore()


   at ThinkGeo.MapSuite.Core.GeoCanvas.EndDrawing()



 






Printing code : (This is ThinkGeo large scale printing example code and it works wth previous version of DLLs)



 var printerInteractiveOverlay =
                (PrinterInteractiveOverlay) MapControl.InteractiveOverlays[Printpreviewoverlay];
            var pagePrinterLayer = printerInteractiveOverlay.PrinterLayers["PageLayer"] as PagePrinterLayer;

            var printDocument = new PrintDocument {DefaultPageSettings = {Landscape = true}};
            if (pagePrinterLayer != null && pagePrinterLayer.Orientation == PrinterOrientation.Portrait)
            {
                printDocument.DefaultPageSettings.Landscape = false;
            }

            printDocument.DefaultPageSettings.PaperSize = GetPrintPreviewPaperSize(pagePrinterLayer);

            var printerGeoCanvas = new PrinterGeoCanvas
                                       {
                                           DrawingArea = new Rectangle(0, 0,
                                                                       Convert.ToInt32(
                                                                           printDocument.DefaultPageSettings.
                                                                               PrintableArea.Width),
                                                                       Convert.ToInt32(
                                                                           printDocument.DefaultPageSettings.
                                                                               PrintableArea.Height))
                                       };
            if (pagePrinterLayer != null)
                printerGeoCanvas.BeginDrawing(printDocument, pagePrinterLayer.GetBoundingBox(), MapControl.MapUnit);

            var labelsInAllLayers = new Collection<SimpleCandidate>();
            foreach (PrinterLayer printerLayer in printerInteractiveOverlay.PrinterLayers)
            {
                printerLayer.IsDrawing = true;
                if (!(printerLayer is PagePrinterLayer))
                {
                    printerLayer.Draw(printerGeoCanvas, labelsInAllLayers);
                }
                printerLayer.IsDrawing = false;
            }

            printerGeoCanvas.EndDrawing();


Hi Shaahin, 
  
 Sorry the the confusing, please use the development branch 6.0.348.0 which works fine, the release branch 6.0.0.348 does not support the GeoLinearGradientBrush in PrinterGeoCanvas, so you got the exception. 
  
 Regards, 
 Edgar