OS: Windows 11
Target Framework: .NET 8.0
Sample Code:
var fs = new FileStream(@"Test.doc", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
Aspose.Words.Document doca = new Aspose.Words.Document(fs);
Aspose.Words.Saving.ImageSaveOptions options = null;
options = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Tiff);
options.UpdateFields = false;
doca.LayoutOptions.RevisionOptions.InsertedTextColor = Aspose.Words.Layout.RevisionColor.Auto;
doca.LayoutOptions.RevisionOptions.DeletedTextColor = Aspose.Words.Layout.RevisionColor.Auto;
doca.LayoutOptions.RevisionOptions.CommentColor = Aspose.Words.Layout.RevisionColor.Auto;
doca.LayoutOptions.RevisionOptions.MovedToTextColor = Aspose.Words.Layout.RevisionColor.Auto;
options.TiffCompression = Aspose.Words.Saving.TiffCompression.Lzw;
options.PixelFormat = Aspose.Words.Saving.ImagePixelFormat.Format24BppRgb;
options.Resolution = 300;
doca.StopTrackRevisions();
int resolution = 300;
options.ImageSize = new System.Drawing.Size((int)(8.5 * resolution), (int)(11.0 * resolution));
for (int page = 0; page < doca.PageCount; page++)
{
if (doca.GetPageInfo(page).Landscape)
options.ImageSize = new System.Drawing.Size((int)(11.0 * resolution), (int)(8.5 * resolution));
else
options.ImageSize = new System.Drawing.Size((int)(8.5 * resolution), (int)(11.0 * resolution));
options.PageSet = new PageSet(page);
try
{
doca.Save(Path.Combine(@"New folder", "Abc" + string.Format("_{0:" + "D6" + "}", page + 1) + ".tif"), options);
}
catch (Exception ex)
{ }
}
File: Test.zip (6.4 KB)
Note: It Works Properly In Targeted Framework: .Net Framework 4.8