We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Converting DWF -> PDF StartIndex cannot be less than zero. (Parameter 'startIndex')

I have a DWF file (see attachment) that I’m trying to convert to PDF.

This is the code:

try
{
    var image = Image.Load(@"C:\Users\niels\Downloads\130041 Final Construction Release (2).DWF");
    var imageOptions = new PdfOptions();
    image.Save(@"C:\Users\niels\Downloads\sample.pdf", imageOptions);
}
catch (Exception exception)
{
    Console.WriteLine(exception);
}

With Aspose.CAD 22.12.0 I’m getting this error

Aspose.CAD.CadExceptions.ImageLoadException: Image loading failed: StartIndex cannot be less than zero. (Parameter 'startIndex')
 ---> System.ArgumentOutOfRangeException: StartIndex cannot be less than zero. (Parameter 'startIndex')
   at System.String.Substring(Int32 startIndex, Int32 length)
   at System.String.Substring(Int32 startIndex)
   at #=zh7rCfvCBQQARnWiWRjNGNsMQau7k_kEfBAJZLWo=.#=zjUDo$1f1Yo43(String #=zUYyDzz0=)
   at #=zh7rCfvCBQQARnWiWRjNGNsMQau7k_kEfBAJZLWo=.#=z30hKtws=(StreamReader #=zRpyXf5E=)
   at #=zh7rCfvCBQQARnWiWRjNGNsMQau7k_kEfBAJZLWo=.#=z0QGuOpoP2XZc(StreamContainer #=zCA8yrCHFc10i, LoadOptions #=zEoGjoEF7DIzu)
   at #=zUFTXlFo6cdCbDHUdmahOaMP_vOV6WsSBnzeshTc=.#=z0QGuOpoP2XZc(StreamContainer #=zCA8yrCHFc10i, LoadOptions #=zEoGjoEF7DIzu)
   at #=zVPIX7ACeDAb0hvUpTmuLxEfLWeFXsjb7lg==.#=zHQfbRSEwUHcl(Stream #=zZN6W_S4=, LoadOptions #=zEoGjoEF7DIzu, Boolean #=zrFza3spLaOcA)
   at #=zVPIX7ACeDAb0hvUpTmuLxEfLWeFXsjb7lg==.#=zvveSPcfAo$Cd(Stream #=zZN6W_S4=, LoadOptions #=zEoGjoEF7DIzu, Boolean #=zrFza3spLaOcA)
   at #=zVPIX7ACeDAb0hvUpTmuLxEfLWeFXsjb7lg==.#=zvveSPcfAo$Cd(Stream #=zZN6W_S4=, LoadOptions #=zEoGjoEF7DIzu)
   at Aspose.CAD.Image.#=zJ8SOvxus3MTh(StreamContainer #=zCA8yrCHFc10i, LoadOptions #=zEoGjoEF7DIzu)
   --- End of inner exception stack trace ---
   at Aspose.CAD.Image.#=zJ8SOvxus3MTh(StreamContainer #=zCA8yrCHFc10i, LoadOptions #=zEoGjoEF7DIzu)
   at Aspose.CAD.Image.Load(String filePath)
   at Program.<Main>$(String[] args) in C:\Repos\Filestar\experimental\AsposeCad\Program.cs:line 6

With Aspose.CAD 22.11.0 the file is produced, there’s no error but I’m getting this in the console:

Font resource is not eot stream: Symbol

A library shouldn’t print to stdout.

With Aspose.CAD 22.10.0 I get the best result where all the drawings of this DWF are fit nicely. WIth Aspose.CAD.11.0 some of the pages are “cut”.

Problematic DWF.zip (2.2 MB)

@nielsbosma,
Hello, I can confirm this, I created CADNET-8930 to cover this issue.