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;
//i mgOptions.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: