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

Free Support Forum - aspose.com

Images not displaying when opening docx file from website

We have been having issues with images in docx files not displaying once opened and saved with ASPOSE 5.2.
Steps to reproduce:

  1. Create new docx file with text and an image
  2. Opened docuement and then saved with no modifications
  3. Placed image on webserver using IIS 6.0
  4. Clicked on link on website that links to file, using IE 7
  5. When open/save dialog displays, we select Open (If you save then open the problem does not occur)
  6. When document opens the image is not show, there is an empty rectangle where the image should be

I compared the document.xml file from the origional file to the new file by extracting with winzip.
The following is different in the files and looks like it could be the cause:
Origional

<w:drawing>
    <wp:inline distT="0" distB="0" distL="0" distR="0">
        <wp:extent cx="5727700" cy="3605530" />
        <wp:effectExtent l="19050" t="0" r="6350" b="0" />
        <wp:docPr id="1" name="Picture 1" />
        <wp:cNvGraphicFramePr>
            <a:graphicFrameLocks xmlns:a=""<A href=" http: //schemas.openxmlformats.org/drawingml/2006/main">http://schemas.openxmlformats.org/drawingml/2006/main</A>" noChangeAspect="1"/>
        </wp:cNvGraphicFramePr>
        <a:graphic xmlns:a=""
			<A href=" http: //schemas.openxmlformats.org/drawingml/2006/main">http://schemas.openxmlformats.org/drawingml/2006/main</A>">
			<a:graphicData uri=""
				<A href=" http: //schemas.openxmlformats.org/drawingml/2006/picture">http://schemas.openxmlformats.org/drawingml/2006/picture</A>">
				<pic:pic xmlns:pic=""
					<A href=" http: //schemas.openxmlformats.org/drawingml/2006/picture">http://schemas.openxmlformats.org/drawingml/2006/picture</A>">
					<pic:nvPicPr>
						<pic:cNvPr id="0" name="Picture 1" />
						<pic:cNvPicPr>
							<a:picLocks noChangeAspect="1" noChangeArrowheads="1" />
						</pic:cNvPicPr>
					</pic:nvPicPr>
					<pic:blipFill>
						<a:blip r:embed="rId4" />
						<a:srcRect />
						<a:stretch>
							<a:fillRect />
						</a:stretch>
					</pic:blipFill>
					<pic:spPr bwMode="auto">
						<a:xfrm>
							<a:off x="0" y="0" />
							<a:ext cx="5727700" cy="3605530" />
						</a:xfrm>
						<a:prstGeom prst="rect">
							<a:avLst />
						</a:prstGeom>
						<a:noFill />
						<a:ln w="9525">
							<a:noFill />
							<a:miter lim="800000" />
							<a:headEnd />
							<a:tailEnd />
						</a:ln>
					</pic:spPr>
				</pic:pic>
			</a:graphicData>
		</a:graphic>
    </wp:inline>
</w:drawing>

New

<w:pict>
	<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path=""
		<A href=" mailto:m@4@5l@4@11@9@11@9@5xe">m@4@5l@4@11@9@11@9@5xe</A>" filled="f" stroked="f">
		<v:stroke joinstyle="miter" />
		<v:formulas>
			<v:f eqn="if lineDrawn pixelLineWidth 0" />
			<v:f eqn="sum @0 1 0" />
			<v:f eqn="sum 0 0 @1" />
			<v:f eqn="prod @2 1 2" />
			<v:f eqn="prod @3 21600 pixelWidth" />
			<v:f eqn="prod @3 21600 pixelHeight" />
			<v:f eqn="sum @0 0 1" />
			<v:f eqn="prod @6 1 2" />
			<v:f eqn="prod @7 21600 pixelWidth" />
			<v:f eqn="sum @8 21600 0" />
			<v:f eqn="prod @7 21600 pixelHeight" />
			<v:f eqn="sum @10 21600 0" />
		</v:formulas>
		<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" />
		<o:lock v:ext="edit" aspectratio="t" />
	</v:shapetype>
	<v:shape id="Picture 1" o:spid="_x0000_i1025" type="#_x0000_t75" style="width:451pt;height:283.9pt;mso-wrap-distance-left:0;mso-wrap-distance-top:0;mso-wrap-distance-right:0;mso-wrap-distance-bottom:0" o:bwmode="auto" filled="f" stroked="f" strokeweight="0.75pt">
		<v:imagedata r:id="rId4" />
		<o:lock v:ext="edit" aspectratio="t" />
	</v:shape>
</w:pict>

I replaced that section in the new file with the extract from the old file and the issue is fixed. However doing this is not a good solution as it requires manual intervention after every file is processed.

Hi
Thanks for your request. I tried the same on my side and it seems that all works fine. Image is displayed correctly. Which version of Aspose.Words are you using? I use the latest version v5.2.1 for testing.
Also please attach your document for testing.
Best regards.

Hi,
I am using version 5.2 of Aspose.Words.
The issue only happens when opening in IE7 from IIS6.
I have attached a sample file that uses both a pict and drawing to render the same image. I have also included a seciton of a screen shot that shows what we see when the issue occurs.
Is there a reason that ASPOSE changes the existing drawing areas into pict areas? Is there an option to stop this from happening?
If you want to arrange for a sample of this to be hosted, can you please email us directly?

Attached screen shot

Hi
Thank you for additional information. I managed to reproduce this issue. Could you also please attach your source document for testing? (I mean document before processing by Aspose.Words) I will consult with our developers and provide you more information.
Best regards.

Here is the origional file before it was passed through Aspose.

Hi
Thank you for additional information. I created new issue #5530 in our defect database. We will investigate this issue and provide you more information. Most probably this is some kind of restriction of IE.
Best regards.

The issues you have found earlier (filed as 5530) have been fixed in this update.