INCLUDEPICTURE does not Render the Image in output DOC and PDF using .NET

We have the following piece of wordml code which was properly parsed in Aspose.Words 15.11, but unexpectedly parsed in Aspose.Words 20.2 (and higher, up to the very latest version):

        <w:pict>
          <v:shape id="d27" style="visibility:visible;mso-width-relative:margin;mso-height-relative:margin;mso-width-percent:1000;height:150px;" type="#_x0000_t75">
            <v:imagedata src="Input\HeaderImage.png"/>
          </v:shape>
        </w:pict>

On generating pdf/doc/docx by latest Aspose.Words a header image is not displayed.

Excerpt of wordml output generated by both Aspose.Words versions, pay attention on “width” value:

Aspose.Words 20.2:
<v:shape id="_x0000_i2049" type="#_x0000_t75" style=“width:0;height:112.5pt;visibility:visible”>

Aspose.Words 15.11:
<v:shape id="_x0000_i2049" type="#_x0000_t75" style=“height:112.5pt;visibility:visible;width:468pt”>

header_image.zip (20.6 KB)

Input samples attached. Probably you’ll need to correct image path here:
<v:imagedata src="**Input**HeaderImage.png"/>

@Vitaly_Filatenko

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input document.
  • Please attach the output file that shows the undesired behavior.
  • Please attach the expected output file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Demo_header_image.zip (86.9 KB)

15.11.* – expected
20.2.* - unexpected

Please note, .pdf in this sample is not working fully as expected, because it require fill path for source image (I specified relative one for the demo).

@Vitaly_Filatenko

We have logged this problem in our issue tracking system as WORDSNET-21857. 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-21857) have been fixed in this Aspose.Words for .NET 21.5 update and this Aspose.Words for Java 21.5 update.

Unfortunately, the issue was not fixed properly.

Here is expected output:
image.png (12.3 KB)

Unfortunately, 21.5 generates the following, which is not expected:
image.png (4.3 KB)

Also please find attached original files. The output produced based on samples provided at the begin of this topic.
Convert2Word.zip (32.7 KB)

@Vitaly_Filatenko

The behavior of old version of Aspose.Words is incorrect.

Please note that Aspose.Words mimics the behavior of MS Word. If you convert your document to DOC file format using MS Word, you will get the same output. Please open your XML in MS Word to check the image’s width.

Thanks. Sounds reasonable. As I just investigated, Word has some difficulties to work together with percent and absolute sizes. It works fine when I specifying only width in percent or height and width in px.

@Vitaly_Filatenko

Thanks for your feedback. Please let us know if you have any more queries.