ODT to PDF and background images

Hi I’m trying to convert an ODT doc to PDF and it doesn’t seem to be parsing the ODT background image. The code im using is


string srcDoc = @“C:\Users\xxx\Desktop\TestFile.odt”;
Document doc = new Document(srcDoc);
Document dstDoc = (Document)doc.Clone(true);
// Save the document.
dstDoc.Save(@“C:\Users\xxx\Desktop\TestFile-converted.pdf”);

Any help would be greatly appreciated.

I’m using .NET with Aspose.words 11.5.0.0 Openoffice 3.4.0

Hi Neil,

Thanks for your query. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-6675 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi,

Have you done something about this issue ? One of ours customers need this feature to.

Thank you

Hi there,

Thanks for your inquiry.

It
is to update you that our development team has completed the
analysis of your issue (WORDSNET-6675) and has come to a conclusion that this issue has
been closed with ‘‘Won’t Fix’’ resolution. I am quoting the developer’s comments here:

“style:page-layout-properties”-> “style:background-image” is section property in ODT.
But it is document property (Document. BackgroundShape) in Aspose.Words.

MS Word does not import this element. Aspose.Words imports it when pages layouts count is equal to one.

This test file contains an element “style:page-layout” -> “style:page-layout-properties” -> “style:background-image” and two “style:page-layout” elements:

<office:document-styles …>
office:automatic-styles

<style:page-layout style:name=“Mpm1”>
<style:page-layout-properties …>
<style:background-image xlink:href=“Pictures/100000000000031D0000046625858818.png” … />
</style:page-layout-properties>
</style:page-layout>

<style:page-layout style:name=“Mpm2”>
<style:page-layout-properties …/>
</style:page-layout>

</office:automatic-styles>
office:master-styles
<style:master-page style:name=“Standard” style:page-layout-name=“Mpm1”/>
<style:master-page style:name=“HTML” style:page-layout-name=“Mpm2”/>
</office:master-styles>
</office:document-styles>

Therefore the picture is not imported.

Hi,

You wrote : "Aspose.Words imports it when pages layouts count is equal to one."

I manage to change the styles of my document and now there is only one page layout in the styles.xml.

However when I convert this document to PDF, the background-image is imported, but appears with a different size and is replicated in the document, as a mozaïc.

Is there another problem in the configuration of my ODT document.
I join you the 2 files : ODT original and PDF result.

Thanks for your help.

Hi Nadi,

Thanks for your inquiry. I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-10706. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

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


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