I am evalutating Aspose.Words to determine if it is a tool that we will be able to use to convert Word docs to .html on the fly for users on an Intranet. So far it seems to convert from .doc to .html very quickly. Our documents are very image intensive with screenshots and Visio drawings. These images do not appear with the same quality as they have in the original document or in an html document that was created using a third party batch converter. If I convert a document that contains photo images, like a .jpg, then the photo maintains it’s quality. Is there something that I can do with your api that will allow these screenshots and visio drawings to maintain their quality too?
Normally, Aspose.Words saves images saves images in the same format they were in the document. If the image was PNG, it is exported as PNG, JPEG exported as JPEG and so on.
The exception if WMF and EMF metafiles when exporting to HTML (or to Aspose.Pdf.XML for that matter). HTML does not allow metafiles in it directly. Therefore, we convert them to raster images and save as PNG.
By default, conversion is done at 96dpi so the images come out reasonably small size and reasonably okay for viewing. Since Aspose.Words 4.0 you can specify higher resolution for exporting if you want. This is specified in Document.SaveOptions.
If this does not answer your question, please attach your file here so we can check it for you.
I do not know the original format of the images, but Aspose.Words saves them as PNG.
Changing the resolution may do the trick, but I can not find a method for this in Document.SaveOptions. I can only find the following methods: ExportImagesFolder, GetType, HtmlExportHeaders, HtmlExportImagesFolderAlias, HtmlExportTextInputFormFieldAsText, and PdfExportBookmarkLevel. None of these seem applicable.
///
/// Specifies resolution at which metafiles are converted to raster images when exporting to HTML.
///
///
/// Default is 96 dpi.
/// Metafiles are not normally displayed by browsers and therefore Aspose.Words converts
/// WMF and EMF images into PNG files when exporting to HTML. This settings specifies the
/// resolution of the created PNG files. If the HTML file is intended to be viewed on the
/// screen, the default setting will produce images of adequate quality and small size.
///
SaveOptions.HtmlExportMetafileResolution
I downloaded and installed Aspose.Words 4.0 and adjusted the resolution many times between 250 and 900. While the Visio drawings got better at around 700, the screenshots never became truly legible. Is there anything else that I can try? The product seems to work well for what we are trying to do otherwise, but we need the content to be legible. I have attached a document per your suggestion.
Remember your screel resolution is most likely 96dpi. So just by increasing resolution much you will not make drawings look nicer on the screen in the browser. If you try to print them or zoom in, then higher resolution certainly helps.
Screenshots in your document are probably PNG or JPEG or already, they are not changed by Aspose.Words and exported as is. Changing resolution for export has no effect on them. I don’t know why they look good in MS Word and bad when exported to HTML. Maybe your browser is configured to scale images so they fit into the browser window?
I’ve viewed the document on multiple computers and it has the same outcome. The images look perfect in Word and also look perfect when converted by a third party batch converter.
The document is attached to the third post by myself in this thread. Please try it and let me know how it comes out.
Thanks, this helps heaps. We are in Aspose.Words for 3 years already and yet learn something new every day.
Basically, the screenshot is 1024x768 at 96dpi inside the DOC file. When it is exported by Aspose.Words to HTML it is exported as 1024x768 pixels at 96dpi without changes. But it also specifies in HTML that the image on the screen should be displayed as 603x452 pixels. The browser does fast scaling of the image which results in bad quality in the browser window.
I think your 3rd party batch converter uses Microsoft Word itself to convert DOC to HTML. We just looked at how Microsoft Word produces HTML for this image and it does an interesting thing. It exports both the original-sized image and a better quality image that is already scaled to the required size. Then it outputs some “nasty” HTML that involves VML actually that displays either the original sized image badly scaled to the required size or the properly scaled image, I guess, depending on the capabilities of the browser.
All in all, this gives us an idea how to export HTML images with better quality. Thanks for bringing the issue to our attention, it might be fixed and released in final Aspose.Words 4.0 within 2 weeks.
Was this issue addressed in Aspose.Words 4.0? I downloaded 4.0 and used it convert the same document, and ended up with the same quality of output. Is there some other function I need to use to make those images display more clearly?
Sorry for delay. The fix somehow have not made way into the latest release. We have assigned it top priority now to make sure it will be fixed within the next week. Thank you for your patience.
When false, the image is exported to HTML without scaling by Aspose.Words. Scaling is done by the browser. Therefore output file is normally bigger (full sized image), better quality when printed, but could be poor quality when viewing in the browser (because browser berforms cheap and quick scaling).
When true, the image is scaled using high quality scaling by Aspose.Words to the shape size when exporting to HTML. The result is normally smaller file sizes (images are scaled down), better quality when viewed in the browser and poorer quality when printing.
You need to set this option to true (actually it is now a default value).
Use the attached 4.0.2.2 build to test. If you have no further issues, just use it as an upgrade.
It all works perfectly for me. The images are perfectly readable, same quality as when exported from Microsoft Word. Maybe you viewed some cached files? Try latest version of Aspose.Words once again.
If you are still not happy, attach results of your export (html and image files) or email them to auckland @ aspose . com
I can email you results of my conversion to html if you want.
The screenshots from SAP are acceptable with the Aspose conversion, but the Visio drawings still are not legible. I have attached the Aspose files to this post and will be posting another with the results from a Word to HTML conversion.
The other issue is the metadata is not contained in the Aspose conversion. When you look at the second html conversion I send (html.zip/index.htm), you will see Meta tags that contain the document properties extracted from Word. These properties are an abosolute necessity for our solution.
Attached is the result of the doc to html conversion I made with a document you attached earlier. As you can see all images are scaled and visible nicely in html.
There could be two reasons why you don’t get the same result:
You don’t use latest version of Aspose.Words.
You have a different document that has some unusual settings that Aspose.Words does not handle as well as in the document you attached before.
First make sure you really use the proper version of Aspose.Words. Uninstall Aspose.Words on your machine. Download latest. Install it. Rebuild your project. Check in the properties of the reference to Aspose.Words what version it is, it should be the one you downloaded.
The thing with VS.NET is that you took the DLL I attached in the forum and copied it into your bin folder and rebuilt the project, it was overridden. VS.NET will take the “original” from C:\Program Files\Aspose\Aspose.Words\bin\net1.1 folder because this is what was added as a reference to the project.
Once you sort out the version, run conversion on the document you attached in the forum. If that converts okay, run conversion on other documents. If something does not convert well, attach those documents here so I can fix. But I’m sure all should be just fine.
Regarding document properties I’ll see what can be done. I really want to make you happy and close this issue asap.
Thank you for your help, and I too am sorry this is going on so long. I do appreciate the help and attention that you are putting towards it. This is our preferred method of displaying our word docs to the end user, but we need to make sure it gives us exactly what we need.
I will uninstall and reinstall again, checking the version used on my vs.net.
There was no file attached to your response that I could see. You can email it to me at allisonvpjwc@yahoo.com
I’ll let you know what my results are and you let me know about the document properties.
I uninstalled Aspose.Words and installed version 4.0.4.0. The screen flows which were taken from screen shots in visio still do not look as good as when it is converted by word or another converter. The text in the screenshot appears to be bold in the Aspose conversion, but not in a word conversion.
Besides that (which we may just deal with as is), we are only lacking the custom properties contained in metatags in the html.
I will be exploring the Aspose.Words api while I wait for a response about the custom properties.
I emailed you the results of my conversion. There must be something different in what we are doing or comparing as my results of conversion are perfect text.
Regarding exporting of custom document properties, we are happy to support that, but it also affects built in document properties and import from HTML to DOC. I want to give it a bit of thought here <A href=". How soon do you need export of those properties supported?
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.