Text Wrap around image

I realize that the .insertHTML function does not support image wrap styles. Is that something that is in the works?
I thought that perhaps it would be possible create a workaround by doing something like after inserting a block of HTML that includes an image that needs to be wrapped:

Dim shapes as NodeCollection = outputDoc.GetChildNodes(NodeType.Shape, True)
For Each image as Aspose.Words.Node In shapes
' apply image wrap to the image based on whatever info we can gather from the shape
Next

Is something like that possible? Does the Shape node contain any info about the orginal image that was inserted (file name perhaps?)?

Hi

Thanks for your request. Could you please provide me snippet of HTML you are trying to insert? I will investigate the issue and provide you more information.
Regarding original image information, no, Shape object does not contain information about the original image.
Best regards,

I have some large blocks of HTML text that need to be inserted and which have imgs in them such as bellow.

<IMG src="http://www.domain.com/images/IMG_7161.JPG" align=left border=0>
<IMG src="http://www.domain.com/careers/IMG_7118.JPG" align=right border=0>

Also the text needs to wrap around the image and not just be inline.
The Image I attached has the incorect output on the left, and the corected output on the right. I corrected it manualy in word by going to Format Picture->Layout and setting Wrapping Style to Square and Horizontal alignment to Right

Hi

Thanks for your request. Alignment, space and borders are ignored during inserting IMG into the document. Please see the following link to learn more about restrictions in HTML import and export.
https://forum.aspose.com/t/95113
So only way to workaround that is post-processing.
Best regards

Yes I have read that document (I assume you ment to link the xls file with html insert items and not a link back to this post). Like I said i realize .insertHTML won’t work. I had to do similar post proccessing to change bullet types.
Can you provide me with the code I would need to loop through a document and programaticly set each images wrap and alignment?

Hi

Thanks for your request. You can try using the following code:

//Create docuemnt and DocumentBuilder
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
 
//Insert HTML
builder.InsertHtml(@"<p><IMG src='http://www.software112.com/images/Development/Oldies/Screenshots/3634-aspose-word.gif' align=left border=0></p>");
 
//Get collection of images from the document
NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);
 
//loop through all images
foreach (Shape shape in shapes)
{
    if (shape.ShapeType == ShapeType.Image)
    {
        //Set wrap type and alignment of image
        shape.WrapType = WrapType.Square;
        shape.HorizontalAlignment = Aspose.Words.Drawing.HorizontalAlignment.Right;
    }
}
 
//Save output docuemnt
doc.Save(@"Test007\out.doc");

Hope this helps.

Best regards.