Web API Reference MapGuide Open Source
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:
MgInvalidArgumentException if the requested resourceName does not specify a section name.
MgDwfSectionNotFoundException if the requested section does not exist in the DWF package.
MgDwfSectionResourceNotFoundException if the requested section resource does not exist in the DWF package.
MgInvalidCastException if there are problems reading the DWF into memory.
MgServiceNotAvailableException if the underlying resource service cannot be obtained to access the drawing in the resource repository.
MgXmlParserException if there are problems parsing the resource content specified by the resource identifier.
MgInvalidDwfPackageException if the DWF specified by the resource identifier is not a DWF of version 6.0 or greater.
MgDwfException if the DWF component encounters errors.
MgTemporaryFileNotAvailableException if a temporary file needed to complete the operation cannot be generated or accessed.
Note:
See MgResourceService for additional exceptions.


Comments or suggestions? Send us feedback.