Hello
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thank you for reporting this problem to us. I managed to reproduce the problem 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 using the following code before saving to PDF:
// 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 raster 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 the document to PDF temp file
doc.Save(@"C:\Temp\out.pdf", pdfOps);
Best regards,
Thank you for the confirmation.
Hi,
Hello
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thank you for additional information. Let me clarify, as you know Aspose.Words is a class library for processing Word documents programmatically. On the one hand, MS Word document is flow document and does not contain any information about its layout into lines and pages. On other hand PDF format is “fixed page format”. So the task of conversion Word document to PDF is converting between flow and fixed page models. When you save document as PDF, document is layout into pages first (this process takes most of time of conversion) and then each page is saved to PDF.
Regarding the issue, it is difficult to provide you any reliable estimate regarding this problem. You will be notified as soon as it is fixed. And unfortunately, currently I cannot suggest you any other way to work this problem around.
Best regards,
Hi Andrey,
Hi Esteban,
Thanks for your inquiry.
The reason why PDFCreator does not encounter any of these problems is because it is a virtual printer, which just intercepts the layout of a sent document in lines and pages (just like how a document is sent to the printer) and renders this to PDF instead. It does not store the actual data of the document (like Aspose.Words does).
Aspose.Words on the other hand loads in document formats and stores them in a dynamic format in the DOM. This allows you to fully add, modify and remove content before then saving or rendering to a different format.
In this case the issue is occuring during rendering because of some sort of issue to do with the font in the vector image. The only work around we can suggest for now is to convert it to raster first
We will inform you when the fix to this issue is avaliable through a post in this thread.
Thanks,
Hi Adam,
Hi Esteban,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your inquiry. We will be sure to inform you of any developments regarding this issue.
Best regards,
The issues you have found earlier (filed as 22077) have been fixed in this .NET update and in this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
Thank you for the notification. I will give the new version a try a.s.a.p. and report back here my results.