Select to view content in your preferred language

EXPORT SIMPLE MARKER TO PDF/JPEG

516
1
07-20-2010 03:36 AM
hanswurst
New Contributor
Hi,

is still need help to Export my SimpleMarker´s on the map to an PDF or JPEG file.
I have posted an fist Topic to this problem, but it seems that nobody had read it.
(except AlBowe)

http://forums.arcgis.com/threads/8319-Newbie-needs-help-with-pdf-export?p=25255#post25255

I have tried this ESRI example too with the same result. No SimpleMarkers are shown on the exportet File/Picture.

http://edndoc.esri.com/arcobjects/9.2/net/ViewCodePages/ae109446-1798-41aa-b878-947425b360c9.ExportA...

Please ...... somebody must help me!!!
0 Kudos
1 Reply
PhilBlondin
Deactivated User
Below is the whole sub.  You can use it in ArcMap VBA.  I only a little C#.  Maybe someone like Kirk can help out.



Dim pMxApp As IMxApplication
Dim pMxdoc As IMxDocument
Dim pactiveview As IActiveView
Dim pPageLayout As IPageLayout
Dim pExporter As IExporter
Dim pPrinter As IPrinter

Dim pRECT As tagRECT
Dim hDc As OLE_HANDLE

Dim pDriverBounds As IEnvelope
Dim pVisibleBounds As IEnvelope
Dim pPixelBounds As IEnvelope
Dim ipPixelBounds As IEnvelope

Dim width  As Double
Dim height As Double
   
Dim FilePath As String
FilePath = "C:\"

Set pMxApp = Application
Set pMxdoc = ThisDocument
Set pactiveview = pMxdoc.ActiveView
Set pPageLayout = pMxdoc.PageLayout
Set pExporter = New PDFExporter
Set pPrinter = pMxApp.Printer

Set pVisibleBounds = New Envelope
Set pVisibleBounds = Nothing 'set to nothing unless clip to graphic extent is checked

Set pPixelBounds = New Envelope
  
pExporter.ExportFileName = FilePath & sFileName & ".pdf"
pExporter.Resolution = 300
    
pPrinter.QueryPaperSize width, height

pRECT.Left = 0
pRECT.Top = 0
pRECT.Right = width * pExporter.Resolution
pRECT.bottom = height * pExporter.Resolution

pPixelBounds.PutCoords pRECT.Left, pRECT.Top, pRECT.Right, pRECT.bottom
pExporter.PixelBounds = pPixelBounds

Dim pFME As IFontMapEnvironment
Set pFME = pExporter 'QI

Dim pFMC As IFontMapCollection
Set pFMC = pFME.FontMapCollection

Dim pFont As IFontMap2
Set pFont = New FontMap

'Arial is the TrueType font whereas Courier is the mapped font
pFont.SetMapping "Arial", "Arial"
pFMC.Add pFont
   
Set pFont = New FontMap
pFont.SetMapping "Arial Bold", "Helvetica-Bold"
pFMC.Add pFont
   
hDc = pExporter.StartExporting

pMxdoc.ActiveView.Output hDc, pExporter.Resolution, pRECT, pVisibleBounds, Nothing

pExporter.FinishExporting
0 Kudos