Hi
This sample runs me ok, inside ArcGis 10.
But if runs in a windows form application (with automated arcgis opened), the result its blank PDF.
Please, Anyone can you help me ??
JMJ98
Sample for SDK Argis 10:
Public Sub ExportActiveViewParameterized(ByVal ExportFormat As String, ByVal iOutputResolution As Long, ByVal lResampleRatio As Long, ByVal bClipToGraphicsExtent As Boolean)
'Export the active view using the specified parameters
Dim docActiveView As IActiveView
Dim docExport As IExport
Dim docPrintAndExport As IPrintAndExport
Dim RasterSettings As IOutputRasterSettings
Dim sNameRoot As String
Dim sOutputDir As String
Dim bReenable As Boolean
If (GetFontSmoothing()) Then
bReenable = True
DisableFontSmoothing()
If (GetFontSmoothing()) Then
MsgBox("Cannot Disable Font Smoothing. Exiting.")
Return
End If
End If
docActiveView = My.ArcMap.Document.ActiveView
' Create an Export* object and cast the docExport interface pointer onto it.
' To export to any format, we simply create the desired Class here
ExportFormat = "PDF"
Select Case ExportFormat
Case "PDF"
docExport = New ExportPDF
Case "EMF"
docExport = New ExportEMF
Case "BMP"
docExport = New ExportBMP
Case "EPS"
docExport = New ExportPS
Case "SVG"
docExport = New ExportSVG
Case "GIF"
docExport = New ExportGIF
Case "TIF"
docExport = New ExportTIFF
Case "JPEG"
docExport = New ExportJPEG
Case "PNG"
docExport = New ExportPNG
Case "AI"
docExport = New ExportAI
Case Else
MessageBox.Show("Unrecognized output format, defaulting to EMF")
ExportFormat = "EMF"
docExport = New ExportEMF
End Select
docPrintAndExport = New PrintAndExport
' Output Image Quality of the export. The value here will only be used if the export
' object is a format that allows setting of Output Image Quality, i.e. a vector exporter.
' The value assigned to ResampleRatio should be in the range 1 to 5.
' 1 corresponds to "Best", 5 corresponds to "Fast"
If TypeOf docExport Is IOutputRasterSettings Then
' for vector formats, assign a ResampleRatio to control drawing of raster layers at export time
RasterSettings = docExport
RasterSettings.ResampleRatio = lResampleRatio
' NOTE: for raster formats output quality of the DISPLAY is set to 1 for image export
' formats by default which is what should be used
End If
'assign the output path and filename. We can use the Filter property of the export object to
' automatically assign the proper extension to the file.
sOutputDir = System.Environment.GetFolderPath(Environment.Speci alFolder.Personal) + "\"
sNameRoot = "VBExportActiveViewSampleOutput"
docExport.ExportFileName = sOutputDir & sNameRoot & "." & Right(Split(docExport.Filter, "|")(1), _
Len(Split(docExport.Filter, "|")(1)) - 2)
docPrintAndExport.Export(docActiveView, docExport, iOutputResolution, bClipToGraphicsExtent, Nothing)
MessageBox.Show("Finished Exporting " & sOutputDir & sNameRoot & "." & Right(Split(docExport.Filter, "|")(1), _
Len(Split(docExport.Filter, "|")(1)) - 2) & ".", "Export Active View Sample")
'cleanup for the exporter
docExport.Cleanup()
If (bReenable) Then
EnableFontSmoothing()
bReenable = False
End If
End Sub