We have made a tool that uses the Aspose.CAD Cloud API to convert DWG files to SVG. This solution worked for a while, but a few days ago we started getting HTTP 500 errors for all of our DWG files:
{"code":"internalError","message":"Aspose.CAD.CadExceptions.ImageLoadException: Image loading failed: Cannot process loading further due to incorrect file format structure, may be file is corrupted.
---> System.Exception: Cannot process loading further due to incorrect file format structure, may be file is corrupted.
at #=z4TrGkrCMhy8_Tzs_mdYzIHmbCz$2FHGewbzdteHAIMPV.ReadDwg(Stream #=zIHh3RV8=, #=zc_24fZbtUVNNnNxGZff6OoH7iuxRgRbXP_YKmw4G4oK3 #=zH0otClkn1dHU, #=zZFDnCEeNRVV3_Hh4_dc6U7IvDSzR8qeMIFo9eDlaXt_S #=zVaoWWkY=, CancellationToken #=zInFhJok=)
at #=zKJRtGGJBoUtojl5yAVoyIQv4drLqMsMFnPgRQlUNpCVfsWBmjA==.#=zoAhd_48=(Stream #=zIHh3RV8=, LoadOptions #=zm5uRuC3w0$6N)
at #=zG7N06i2QVLd66$fDpStAsR94$gZIQRQmU2WAZaD8C5g7.#=zHL9BakY=(StreamContainer #=z1jBduO4Nvkds, LoadOptions #=zm5uRuC3w0$6N)
at Aspose.CAD.Image.#=zc9TFOiVe1x8a(StreamContainer #=z1jBduO4Nvkds, LoadOptions #=zm5uRuC3w0$6N)
--- End of inner exception stack trace ---
at Aspose.CAD.Image.#=zc9TFOiVe1x8a(StreamContainer #=z1jBduO4Nvkds, LoadOptions #=zm5uRuC3w0$6N)
at Aspose.CAD.Image.Load(Stream stream, LoadOptions loadOptions)
at Aspose.CAD.Cloud.Core.Business.CadManager..ctor(Stream drawingStream, String outputFormat, DrawingOptionsBaseDTO exportOptions) in C:\\build\\src-microservice\\Aspose.CAD.Cloud.Core\\Business\\CadManager.cs:line 131
at Aspose.CAD.Cloud.Core.Controllers.BaseApiController.ProcessStreamedDrawing(String outPath, String outputFormat, DrawingProcessingDelegate processingDelegate, String storage, String contentFileName, Boolean dispose) in C:\\build\\src-microservice\\Aspose.CAD.Cloud.Core\\Controllers\\BaseApiController.cs:line 191","description":"Operation Failed. Internal error.","dateTime":"2022-09-23T20:06:23.7820518Z","innerError":null}
An example DWG can be found in this zip file:
GasFlare.zip (59.4 KB)
Sample code:
var api = new Aspose.CAD.Cloud.Sdk.Api.CadApi(AppKey, AppSid);
using var response = api.PostDrawingSaveAs(new Aspose.CAD.Cloud.Sdk.Model.Requests.PostDrawingSaveAsRequest
{
DrawingData = stream,
OutputFormat = "svg",
});