# PdfGeoCanvas Issue with LineStyles and MapShapeLayer

**URL:** <https://community.thinkgeo.com/t/pdfgeocanvas-issue-with-linestyles-and-mapshapelayer/1889>\
**Category:** WinForms\
**Created:** [January 23, 2012, 4:08pm UTC](https://community.thinkgeo.com/t/pdfgeocanvas-issue-with-linestyles-and-mapshapelayer/1889 "2012-01-23T16:08:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmabon](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/jmabon/32/21163_2.png) [@jmabon](https://community.thinkgeo.com/u/jmabon)\
**Post date:** [January 23, 2012, 4:08pm UTC](https://community.thinkgeo.com/t/pdfgeocanvas-issue-with-linestyles-and-mapshapelayer/1889/1 "2012-01-23T16:08:15Z")

</div>

Hello,&nbsp;I’m&nbsp;trying&nbsp;to&nbsp;implement&nbsp;the&nbsp;PdfGeoCanvas&nbsp;extension.&nbsp;The&nbsp;issues&nbsp;I&nbsp;am&nbsp;having&nbsp;are&nbsp;the&nbsp;LocalRoad&nbsp;LineStyles&nbsp;always&nbsp;print&nbsp;over&nbsp;any&nbsp;other&nbsp;custom&nbsp;LineStyle&nbsp;when&nbsp;it&nbsp;gets&nbsp;created&nbsp;into&nbsp;a&nbsp;PDF&nbsp;even&nbsp;though&nbsp;they&nbsp;are&nbsp;on&nbsp;top&nbsp;in&nbsp;the&nbsp;Layer&nbsp;Order.  
  
Also,&nbsp;I&nbsp;can’t&nbsp;seem&nbsp;to&nbsp;get&nbsp;my&nbsp;MapShapeLayer&nbsp;to&nbsp;show&nbsp;up&nbsp;at&nbsp;all&nbsp;in&nbsp;the&nbsp;PDF.&nbsp;I&nbsp;have&nbsp;included&nbsp;some&nbsp;screenshots&nbsp;so&nbsp;you&nbsp;can&nbsp;see&nbsp;what&nbsp;I’m&nbsp;talking&nbsp;about.

Image&nbsp;from&nbsp;Map:

&nbsp;

 ![](https://community.thinkgeo.com/uploads/default/original/1X/3a21e64d1ff84b97ae5074064247789216562346.png)

Image&nbsp;from&nbsp;PDF:

 ![](https://community.thinkgeo.com/uploads/default/original/1X/38ea8646fac83077d11d9717cc16d5da1ca63eba.png)  
  
&nbsp;

If&nbsp;I&nbsp;change&nbsp;the&nbsp;LineStyle&nbsp;to&nbsp;use&nbsp;one&nbsp;of&nbsp;your&nbsp;preset&nbsp;LineStyles&nbsp;it&nbsp;puts&nbsp;it&nbsp;on&nbsp;top&nbsp;correctly.&nbsp;Is&nbsp;there&nbsp;a&nbsp;way&nbsp;to&nbsp;have&nbsp;a&nbsp;custom&nbsp;LineStyle&nbsp;display&nbsp;on&nbsp;top&nbsp;of&nbsp;a&nbsp;preset&nbsp;LineStyle?

I&nbsp;can't&nbsp;seem&nbsp;to&nbsp;find&nbsp;a&nbsp;way&nbsp;to&nbsp;get&nbsp;the&nbsp;MapShapeLayer&nbsp;to&nbsp;show&nbsp;up&nbsp;in&nbsp;the&nbsp;PDF&nbsp;at&nbsp;all.&nbsp;Even&nbsp;if&nbsp;i&nbsp;use&nbsp;a&nbsp;preset&nbsp;LineStyle&nbsp;it&nbsp;still&nbsp;won't&nbsp;show&nbsp;up.&nbsp;I&nbsp;can&nbsp;provide&nbsp;a&nbsp;sample&nbsp;project&nbsp;if&nbsp;needed.

Thanks,  
  
Jesse

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [January 23, 2012, 10:11pm UTC](https://community.thinkgeo.com/t/pdfgeocanvas-issue-with-linestyles-and-mapshapelayer/1889/2 "2012-01-23T22:11:35Z")

</div>

Jesse,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;detail&nbsp;description&nbsp;for&nbsp;your&nbsp;problem,&nbsp;I&nbsp;think&nbsp;it’s&nbsp;maybe&nbsp;a&nbsp;bug&nbsp;in&nbsp;our&nbsp;MapSuiteCore,&nbsp;to&nbsp;find&nbsp;it&nbsp;quickly&nbsp;could&nbsp;you&nbsp;provide&nbsp;some&nbsp;sample&nbsp;code&nbsp;to&nbsp;help&nbsp;us&nbsp;recreate&nbsp;it&nbsp;and&nbsp;debug?&nbsp;  
&nbsp;&nbsp;  
&nbsp;At&nbsp;the&nbsp;same&nbsp;time,&nbsp;we&nbsp;are&nbsp;trying&nbsp;to&nbsp;write&nbsp;code&nbsp;to&nbsp;recreate&nbsp;it,&nbsp;any&nbsp;progress&nbsp;we&nbsp;will&nbsp;let&nbsp;you&nbsp;know&nbsp;ASAP&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;James

---

<div class="post-metadata">

**Author:** ![jmabon](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/jmabon/32/21163_2.png) [@jmabon](https://community.thinkgeo.com/u/jmabon)\
**Post date:** [January 24, 2012, 12:35am UTC](https://community.thinkgeo.com/t/pdfgeocanvas-issue-with-linestyles-and-mapshapelayer/1889/3 "2012-01-24T00:35:00Z")

</div>

Thanks&nbsp;James.&nbsp;I’ve&nbsp;uploaded&nbsp;a&nbsp;sample&nbsp;project&nbsp;to&nbsp;my&nbsp;ftp&nbsp;account&nbsp;on&nbsp;your&nbsp;site.&nbsp;Let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;issues&nbsp;with&nbsp;it.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Jesse

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [January 24, 2012, 12:37am UTC](https://community.thinkgeo.com/t/pdfgeocanvas-issue-with-linestyles-and-mapshapelayer/1889/4 "2012-01-24T00:37:43Z")

</div>

Jesse,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;quickly&nbsp;response.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;got&nbsp;the&nbsp;sample&nbsp;and&nbsp;are&nbsp;testing&nbsp;it.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;James

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [January 28, 2012, 8:20pm UTC](https://community.thinkgeo.com/t/pdfgeocanvas-issue-with-linestyles-and-mapshapelayer/1889/5 "2012-01-28T20:20:05Z")

</div>

&nbsp;Jesse,

I&nbsp;found&nbsp;the&nbsp;solution&nbsp;for&nbsp;you&nbsp;problems.

1,&nbsp;To&nbsp;show&nbsp;red&nbsp;line&nbsp;on&nbsp;pdf&nbsp;page,&nbsp;you&nbsp;need&nbsp;to&nbsp;add&nbsp;code&nbsp;for&nbsp;mobjShapesOverlay&nbsp;drawing&nbsp;in&nbsp;btnPDF\_Click&nbsp;method,&nbsp;I&nbsp;think&nbsp;you&nbsp;missed&nbsp;it:

`        Dim labelsInLayers As New Collection(Of SimpleCandidate)()        objGeoCanvas.BeginDrawing(page, Map1.CurrentExtent, Map1.MapUnit)        For Each layer As Layer In CType(Map1.Overlays(0), LayerOverlay).Layers            layer.Open()            layer.Draw(objGeoCanvas, labelsInLayers)            layer.Close()        Next        For Each layer As Layer In CType(Map1.Overlays(1), LayerOverlay).Layers            layer.Open()            layer.Draw(objGeoCanvas, labelsInLayers)            layer.Close()        Next        Try            objGeoCanvas.EndDrawing()`

2,&nbsp;To&nbsp;show&nbsp;blue&nbsp;line&nbsp;on&nbsp;pdf&nbsp;page,&nbsp;you&nbsp;can&nbsp;adjust&nbsp;the&nbsp;DrawingLevel&nbsp;for&nbsp;style&nbsp;of&nbsp;blue&nbsp;line,&nbsp;For&nbsp;example,&nbsp;I&nbsp;set&nbsp;it&nbsp;to&nbsp;LabelLevel&nbsp;so&nbsp;that&nbsp;it's&nbsp;topest.

`                        Case "SUPERVISORIAL_DISTRICTS"                            objLayer.Name = "Supervisor Districts"                            With objLayer.ZoomLevelSet                                Dim objZoom1 As ZoomLevel = .ZoomLevel01                                objZoom1.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20                                objZoom1.CustomStyles.Add(GetHaloLabelRender(12, "DISTRICT", GeoColor.StandardColors.DarkSlateBlue))                                Dim objStyle As New AreaStyle(New GeoPen(GeoColor.StandardColors.DarkSlateBlue, 5), New GeoSolidBrush(GeoColor.StandardColors.Transparent))                                objStyle.DrawingLevel = DrawingLevel.LabelLevel                                objZoom1.CustomStyles.Add(objStyle)                                .CustomZoomLevels.Add(objZoom1)                            End With`

Let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;more&nbsp;questions.

Thanks,

James
