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

Free Support Forum - aspose.com

Cant convert word to images

Hi

Im trying to convert the attach word to images

this is my code
ImageSaveOptions imgOptions = new ImageSaveOptions(SaveFormat.Jpeg);

//imgOptions.Scale = 0.95f;
imgOptions.JpegQuality = 90;
//imgOptions.Scale = 0.5f;
//imgOptions.PixelFormat = ImagePixelFormat.;

//var i = word.PageCount;
for (int pageIndex = 0; pageIndex < 10; pageIndex++)
{
imgOptions.PageIndex = pageIndex;
sw.Restart();

word.Save(outputFileName + pageIndex + “.jpg”, imgOptions);
sw.Stop();
Console.WriteLine(sw.ElapsedMilliseconds);
}

Im getting this exception



System.ArgumentException was unhandled
HResult=-2147024809
Message=Parameter is not valid.
Source=System.Drawing
StackTrace:
at System.Drawing.Graphics.MultiplyTransform(Matrix matrix, MatrixOrder order)
at . ( , Boolean , Boolean )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( , Graphics )
at . ( , Size )
at . ()
at . (Stream )
at . ( , SizeF , Stream , ImageSaveOptions )
at . (Stream )
at . ( )
at Aspose.Words.Document. (Stream , String , SaveOptions )
at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
at AsposeTest.AsposeWord.SaveWordToImages(String outputFileName, Document word, Stopwatch sw) in c:\Users\Ram\Downloads\Useful\AsposeWord.cs:line 197
at AsposeTest.AsposeWord.SaveWordToFormat() in c:\Users\Ram\Downloads\Useful\AsposeWord.cs:line 113
at AsposeTest.Program.Main(String[] args) in c:\Users\Ram\Downloads\Useful\Program.cs:line 30
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

Hi Eidan,


Thanks for reporting this problem to us. While using the latest version of Aspose.Words i.e. 14.5.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-10268. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-10268) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.