I want to convert doc/docx to pdf, and then convert it to thumbnail. But all chinese characters in original doc file change to trash code after convert it to pdf, how to solve this problem? The product I used is 'aspose.word aspose.pdf.kit aspose.pdf ’
In addition, is there any way to set the size, width and height of the thumnail?
The samp code is:
Document doc = new Document(@"C:\Documents and Settings\Administrator\Desktop\MyDocument.doc");
doc.Save(@"C:\Documents and Settings\Administrator\Desktop\MyDocument.xml", SaveFormat.AsposePdf);
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.BindXML(@"C:\Documents and Settings\Administrator\Desktop\MyDocument.xml", null);
pdf.IsImagesInXmlDeleteNeeded = true;
pdf.Save(@"C:\Documents and Settings\Administrator\Desktop\MyDocument.pdf");
// Convert Each page of a pdf Document to a image.
PdfConverter converter = new PdfConverter();
converter.BindPdf(@"C:\Documents and Settings\Administrator\Desktop\MyDocument.pdf");
converter.DoConvert();
String prefix = @"C:\Documents and Settings\Administrator\Desktop\";
String suffix = ".jpg";
int imageCount = 1;
while (converter.HasNextImage())
{
if (imageCount == 5)
break;
converter.GetNextImage(prefix + imageCount + suffix, ImageFormat.Jpeg);
imageCount++;
}