MapGuide API Reference
 All Classes Functions Variables Enumerations Enumerator Friends
virtual MgByteReader* MgDrawingService::GetSectionResource ( MgResourceIdentifier resource,
CREFSTRING  resourceName 
) [pure virtual]

Gets a specific resource from the DWF.

.NET Syntax
virtual MgByteReader GetSectionResource(MgResourceIdentifier resource, string resourceName);
Java Syntax
virtual MgByteReader GetSectionResource(MgResourceIdentifier resource, String resourceName);
PHP Syntax
virtual MgByteReader GetSectionResource(MgResourceIdentifier resource, string resourceName);
Parameters:
resource(MgResourceIdentifier) Resource identifier specifying the drawing source which has the DWF resource data.
resourceName(String/string) Name of the resource. Resource names can be retrieved via EnumerateSectionResources or from the manifest.xml file via DescribeDrawing.
Returns:
Returns an MgByteReader object containing the resource. The MIME type will be what is specified in manifest.xml for the specified resource (for example, image/png or text/xml).
Example (PHP)
 // Assuming the drawing service has already been initialized
 $drawing_ID = new MgResourceIdentifier('Library://DrawingService/Floorplan.DrawingSource');
 $resourceName = 'com.autodesk.dwf.ePlot_9E2723744244DB8C44482263E654F7644AA701C2E18DD99948F3C0D4FDFAC165.png';
 $byteReader = $drawingService->GetSectionResource($drawing_ID, $resourceName);
Exceptions:
MgInvalidArgumentExceptionif the requested resourceName does not specify a section name.
MgDwfSectionNotFoundExceptionif the requested section does not exist in the DWF package.
MgDwfSectionResourceNotFoundExceptionif the requested section resource does not exist in the DWF package.
MgInvalidCastExceptionif there are problems reading the DWF into memory.
MgServiceNotAvailableExceptionif the underlying resource service cannot be obtained to access the drawing in the resource repository.
MgXmlParserExceptionif there are problems parsing the resource content specified by the resource identifier.
MgInvalidDwfPackageExceptionif the DWF specified by the resource identifier is not a DWF of version 6.0 or greater.
MgDwfExceptionif the DWF component encounters errors.
MgTemporaryFileNotAvailableExceptionif a temporary file needed to complete the operation cannot be generated or accessed.
Note:
See MgResourceService for additional exceptions.