<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif">Hello, everyone...<br>
<br>
I'm having problems with the following code:<br>
<br>
MgDwfVersion dwfVersion = new MgDwfVersion("6.01", "1.2");<br>
MgPlotSpecification plotSpec = new
MgPlotSpecification(8.5f, 11, MgPageUnitsType.Inches, 0f, 0f, 0f, 0f);<br>
plotSpec.SetMargins(0.5f, 0.5f, 0.5f, 0.5f);<br>
<br>
mappingService =
siteConnection.CreateService(MgServiceType.MappingService) as
MgMappingService;<br>
<br>
MgLayout layout = null;<br>
if ((useLayout != "FALSE" && useLayout == "TRUE"))<br>
{<br>
MgResourceIdentifier layoutRes = new
MgResourceIdentifier("Library://Project/Maps/Project.PrintLayout");<br>
layout = new MgLayout(layoutRes, "Project",
MgPageUnitsType.Inches);<br>
}<br>
<br>
double scale = map.GetViewScale();<br>
MgByteReader byteReader = null;<br>
if (scale <= 0)<br>
{<br>
byteReader = mappingService.GeneratePlot(map, plotSpec,
layout, dwfVersion);<br>
}<br>
else<br>
{<br>
MgCoordinate mapCenter =
map.GetViewCenter().GetCoordinate();<br>
byteReader = mappingService.GeneratePlot(map,
mapCenter, scale, plotSpec, layout, dwfVersion);<br>
}<br>
<br>
// Now output the resulting DWF.<br>
utilityfunctions.OutputReaderContent(Response, byteReader);<br>
<br>
<br>
<br>
When I call the function, a new window is displayed, but there's
nothing in it. Also, if I change the last code for this:<br>
<br>
MgByteSink bytesink = new MgByteSink(byteReader);<br>
bytesink.ToFile("c:\\project\\test" +
DateTime.Today.ToString("ddMMyy") + ".dwf");<br>
<br>
<br>
The following error appears: <span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<pre>A file IO exception occurred: c:\<font
face="Helvetica, Arial, sans-serif">project</font>\<font
face="Helvetica, Arial, sans-serif">test</font>120309.dwf</pre>
</span><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<pre>Exception occurred in method MgByteSink.ToFile at line 220 in file</pre>
</span><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<pre>...\service\data\ByteSink.cpp</pre>
</span><br>
<span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span><br>
<span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span>I
need to create the dwf. I checked the php code and the .net examples
and the code I'm using is the same that the one in the examples. <br>
Is there an error I'm not seeing? What can I do to solve this?<br>
<br>
Thanks.<span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span></font>
</body>
</html>