We're sorry Aspose doesn't work properply without JavaScript enabled.

# Rendering EMF images in XPS documents results in right-aligned text

After upgrading from Aspose.Words v10.8 to v11.8, I have stumbled across a regression when rendering an XPS document which contains an embedded vector graphic which was originally sourced from an EMF.

In the latter (v11.8), most of the text is much further to the right than it should be. I have attached an example for reference. My code did not change between runs, I only swapped the Aspose DLLs.

Hi Russell,

Thanks for your inquiry. Could you please also attach your input Word document (.doc/.docx file) here for testing? I will investigate the issue on my side and provide you more information.

Best Regards,

Here is an EMF file that has this issue when rendered to XPS.

I have tried this in Aspose.Words v11.9 and it looks the same as it did in v11.8.

Hi Russell,

Thanks for your inquiry. While using the latest version of Aspose.Words i.e. 11.9.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-7351. Your request has been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best Regards,

Hi Russell,

Thanks for your patience. In the mean time while you’re waiting for the fix, please use the following code as a temporary work around:

Document doc = new
Document(@"C:\Temp\in.docx");
XpsSaveOptions xpsOptions = new XpsSaveOptions();
xpsOptions.MetafileRenderingOptions.EmfPlusDualRenderingMode = EmfPlusDualRenderingMode.Emf;
doc.Save(@"C:\Temp\out.xps", xpsOptions);


I hope, this helps.

Best regards,

Hi Russell,

In Aspose.Words 11.3 we switched to rendering of EMF+ part of EMF+ dual metafiles instead of EMF part. So your problem is not a regression but a bug in EMF+ rendering. As Awais said you could switch back to rendering of EMF part of EMF+ dual metafiles if the result is acceptable for you.

Indeed, that change got it back to how it was.

However, I think the EMF+ renderer (minus the text alignment bug) looks much nicer with all the antialiasing and whatnot. I look forward to seeing it fixed so I can use it in future.

Hi Russell,

Thanks for your request. Sure, we will keep you informed of the status of this issue and let you know once it is resolved.

Best regards,

Bump.

We would really like to move our product to EMF+ for the next release, and this issue has become a showstopper. Would it be possible to get the priority of this ticket raised? Thanks.

Hi Russell,

Thanks for the additional information. I have raised the priority of this issue to High. We will be sure to inform you of any developments and let you know once it is resolved.

Best regards,

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

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

The fix appears to work from this end. Thanks

Hi Russell,

Thanks for your feedback. Please let us know any time you have any further queries. We are always glad to help you.

Best regards,