Losing formatting after converting word file to HTML file

Hi,

I am converting Word file to HTML file using Aspose Word dll.
**But after converting it to HTML file , I am losing format in HTML file.

I have added Word file and HTML file in attachment.**

Plz suggest me possible solution.

Thanks in advance.
Jitendra

Hi Jitendra,

Thanks for your inquiry. Using latest Aspose.Words 10.8, i managed to reproduce the problem on my side. I have logged this issue in our bug tracking system. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.

Hi **Imran,

I am waiting for your response, from my site my have tried with different options but no luck.

Plz let me know any possible suggestion for this.

Thanks

Jitendra**

Hi there,

Thanks for your inquiry.

Actually the reason the alignment is missing is because the floating horizontal alignment option is not exported to HTML.

Instead to achieve a centered appearance for the image in HTML output, you can modify your source document and make the image inline (No text wrapping) and make the paragraph which contains the image center aligned instead.

If we can help with anything else, please feel free to ask.

Thanks,

Hi,

I can’t update source file, because it is not fixed that Image will be in center,

It can be in left or right also.

If you have any other solution then plz let me know.

Thanks

Jitendra

Hi
Jitendra,

Thanks for your inquiry. You can achieve this by aligning parent paragraph of each image.
Please follow this code snippet:

Document doc = new Document(@"d:\temp\samples\Word File.doc");
NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true, false);
foreach(Aspose.Words.Drawing.Shape shape in shapes)
{
    shape.ParentParagraph.ParagraphFormat.Alignment = ParagraphAlignment.Center;
}
doc.Save(@"d:\temp\samples\WordFileOut.html", SaveFormat.Html);

Hope this will help.

I can’t align all images to center, because some images can be in left or right side.

means we can’t hard code for setting image position.

I want same format as word document.

Thanks

Jitendra

Hi Jitendra,

Thanks for your details. Please note that there is no guarantee that there is such a work around at the moment, you may need to wait for the original fix.

Hi Jitendra,

Thanks for this additional information.

Do you mean you have many images in one paragraph that all have different alignment? If so you can split these into separate paragraphs and use different paragraph alignments for each one.

Thanks,

While converting only from Word document to HTML file, it is loosing formatting.
Image position of images are not fixed, it can be left , right or center.

So Can not give any fix position for image.

I want same format as word file.

Plz suggest me possible solution.

Thanks

Jitendra

Hi Jitendra,

Thank you for additional information. In this case, you have to wait for the fix of the original issue. We will keep you informed and let you know once it is resolved.

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

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