Hi,
I got a “PleaseReportException” with the text:
Exception ‘Uknown texture.’ occured in Aspose.Words for .NET 6.0.0.0. For free technical support, please post this error and the file in the Aspose.Words Forums http://www.aspose.com/forums/ShowForum.aspx?ForumID=75
.
This occured only when calling renderToScale on the attached .doc. Interestingly, if you open this file in Word 2007 and change the landscape to “portrait” and then back to “landscape” and then save it, this issue no longer arises.
(Edit: Sorry, this post was not complete.)
Here is a small C# program that I wrote to reproduce the error using Aspose.Cells 4.5, Aspose.Slides 2.9, and Aspose.Words 6.0:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Drawing.Imaging;
using System.Drawing;
using Aspose.Words;
namespace asposeRepro
{
class Program
{
static void Main(string[] args)
{
int PageIndex = 0;
float Resolution = 96;
Aspose.Words.License license = new Aspose.Words.License();
license.SetLicense("Aspose.Custom.lic");
FileStream fs = new FileStream(@"c:\test.doc", FileMode.Open);
Document doc = new Document(fs);
Aspose.Words.Rendering.PageInfo info = doc.GetPageInfo(PageIndex);
Size pageSize = info.GetSizeInPixels(1.0f, Resolution);
Bitmap image = new Bitmap(pageSize.Width, pageSize.Height, PixelFormat.Format48bppRgb);
Graphics g = Graphics.FromImage(image);
doc.RenderToScale(PageIndex, g, 0.0f, 0.0f, 1.0f);
}
}
}
This looks for C:/test.doc, so either save the docs as that or change the path in my code. The licensing file must be in the same directory as this code. The zip contains the doc that causes the unhandled exception (test.doc) and also has a file created by opening test.doc and toggling its orientation and then toggling it back and then saving it (test2.doc).
Thanks,
Brett