Free Support Forum - aspose.com

Worddocument has display issues after saving to pdf with aspose words

Hi
i have a worddocument that has display issues after saving to pdf with aspose words.

i attached the word and the pdf document. As you can see the month on the x-axis of the charts that can be read in the doc are just black squares in pdf.

here is the code i used:

Aspose.Words.Document doc = new Aspose.Words.Document(@“d:\dok8.doc”);
doc.SaveToPdf(@“D:\doc8.pdf”);

I use the Version 9.1.0.0 of the Aspose.Word.dll

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for reporting this problem to us. I managed to reproduce it on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

As a temporary workaround, you can try converting vector images in your document to raster images. Please see the following code:

Document doc = new Document(@"Test001\document.doc");

// Get all shapes in the document.

NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);

// Loop through all shapes.

foreach (Shape shape in shapes)

{

// If shape contains a vector image, convert it to rester image.

if (shape.HasImage && (shape.ImageData.ImageType == ImageType.Wmf || shape.ImageData.ImageType == ImageType.Emf))

{

using (MemoryStream vectorImageStream = new MemoryStream(shape.ImageData.ImageBytes))

using (Image image = Image.FromStream(vectorImageStream))

using (MemoryStream resterImageStream = new MemoryStream())

{

image.Save(resterImageStream, ImageFormat.Png);

shape.ImageData.SetImage(resterImageStream);

}

}

}

// Save output docuemnt to PDF.

doc.Save(@"Test001\out.pdf");

But you should note quality of images will be worse than quality of the original images after converting to raster images.

Best regards.

Hi Oliver,

We investigated the issue and decided to postpone it for now. Hope the suggested workaround works fine for you.

Best regards,

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


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