[mapguide-users] Troubles on exporting dwf

Francesco Sozzi fsozzi at intercad.ch
Mon Sep 20 15:36:48 EDT 2010


Hi all,

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:
"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?"

The code I use is:

public void MapOutput()
        {
            try
            {
                MgResourceService resService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
                MgMappingService mapService = (MgMappingService)siteConnection.CreateService(MgServiceType.MappingService);

                MgMap map = new MgMap();
                map.Open(resService, "Default");

                string mapAgentURL = "http://localhost/mapguide/mapagent/mapagent.fcgi";
                MgDwfVersion dwfVersion = new MgDwfVersion("6.01", "1.2");
                MgByteReader byteReader = mapService.GenerateMap(map, mapAgentURL, dwfVersion);

                MgByteSink byteSink = new MgByteSink(byteReader);
                string filePath = "C:\\Temp\\Map.DWF";
                byteSink.ToFile(filePath);

                
            }
            catch (Exception ex)
            {
                ShowError(ex.ToString());                
            }
        }

Any idea?...

Best regards

Francesco


__________ Information from ESET NOD32 Antivirus, version of virus signature database 5463 (20100920) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20100920/713b744e/attachment.html


More information about the mapguide-users mailing list