<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18939">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hi all,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>If I try to export dwf via MG API, I get a file
that I can't open. If I try to open it by DWG TrueView 2011 I get the
message:</FONT></DIV>
<DIV><FONT size=2 face=Arial>"The DWF viewing component needed to open this file
is not installed. Would you like to open a web page where it can be
downlaoded?"</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>The code I use is:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>public void
MapOutput()<BR>
{<BR>
try<BR>
{<BR>
MgResourceService resService =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);<BR>
MgMappingService mapService =
(MgMappingService)siteConnection.CreateService(MgServiceType.MappingService);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2
face=Arial>
MgMap map = new
MgMap();<BR>
map.Open(resService, "Default");</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
string mapAgentURL = "<A
href="http://localhost/mapguide/mapagent/mapagent.fcgi">http://localhost/mapguide/mapagent/mapagent.fcgi</A>";<BR>
MgDwfVersion dwfVersion = new MgDwfVersion("6.01",
"1.2");<BR>
MgByteReader byteReader = mapService.GenerateMap(map, mapAgentURL,
dwfVersion);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
MgByteSink byteSink = new
MgByteSink(byteReader);<BR>
string filePath =
"C:\\Temp\\Map.DWF";<BR>
byteSink.ToFile(filePath);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
<BR>
}<BR> catch
(Exception
ex)<BR>
{<BR>
ShowError(ex.ToString());
<BR>
}<BR> }</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Any idea?...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Best regards</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Francesco</FONT></DIV><BR>
<BR>
__________ Information from ESET NOD32 Antivirus, version of virus signature database 5463 (20100920) __________<BR>
<BR>
The message was checked by ESET NOD32 Antivirus.<BR>
<BR>
<A HREF="http://www.eset.com">http://www.eset.com</A><BR>
</BODY></HTML>