Just got this error converting DWG Sample File downloaded from DocumentUltimate demo.
Parameter is not valid.
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
at _Jc.CreateBitmap(_YBA model, _nqA transform, _Vi graphicsConfig, SmoothingMode smoothingMode, Int32 width, Int32 height)
at _Jc.CreateAutoSizedBitmap(_YBA model, _nqA transform, _Vi graphicsConfig, SmoothingMode smoothingMode)
at _FTj._fBj(_YBA model, _Vi graphicsConfig, Stream stream, DocumentFormat format)
at _FTj._faj._fqj(Stream stream)
at _FzI._f3I(ConversionContext conversionContext, Action`1 diskSaveCallback, Action`1 streamSaveCallback)
at _FTj._f3I(OutputContext outputContext)
at GleamTech.DocumentUltimate.DocumentConverter._FLj(OutputContext outputContext, Nullable`1 engine)
at GleamTech.DocumentUltimate.DocumentConverter.ConvertTo(Stream outputStream, OutputOptions outputOptions, Nullable`1 engine)
at GleamTech.DocumentUltimate.DocumentConverter.ConvertTo(Stream outputStream, DocumentFormat outputFormat, Nullable`1 engine)
And here's the code:
using (var inputStream = await blob.OpenReadAsync())
{
var converter = new DocumentConverter(inputStream, format.Value);
using (var outputSream = new System.IO.MemoryStream())
{
converter.ConvertTo(outputSream, DocumentFormat.Png);
outputSream.Seek(0, System.IO.SeekOrigin.Begin);
//resize image in outputStream and upload to storage
}
}
With some dwg sample files from autocad website it does work without exceptions...
Am I making something wrong?