Hi,
When rendering RTF, some font sizes seem to be much more blurrier than others.
Attached is an example when almost all text is of size 8.5pt and the blurry text is of size 8pt.
The first picture shows the text rendered by MS Word 2013 and the second by Aspose.Words. The last file is the source document.
How is it possible to improve the rendering?
Thanks for help,
Jaro
Hi Jaro,
Thanks for your inquiry. I have converted the shared document to Pdf and Tiff output and have not found the shared issue. Perhaps, you are using older version of Aspose.Words. I suggest you please use latest version of Aspose.Words for .NET 15.8.0. I have attached the output Pdf document with this post for your kind reference.
Hi,
Sorry, my fault that I haven’t posted also any code snippet. It seems you converted the RTF into PDF, which is then visualized correctly. What we are attempting to do is RTF rasterization into PNG (specific page). Here is a code snippet from our code:
string output = @“c:\temptest”;
string file = @“c:\Users\someone\Documents\zle_lorem_ipsum.rtf”;
using (Stream s = new FileStream(file, FileMode.Open, FileAccess.Read))
{
Aspose.Words.License lic = new Aspose.Words.License();
lic.SetLicense(@“c:\Users\someone\Documents\Aspose.Words.lic”);
// Open the document.
Aspose.Words.Document doc = new Aspose.Words.Document(s);
//Create an ImageSaveOptions object to pass to the Save method
int pageNum = 0;
ImageSaveOptions options = new ImageSaveOptions(Aspose.Words.SaveFormat.Png);
options.PageIndex = pageNum;
options.PageCount = 1;
options.Resolution = 96;
options.UseAntiAliasing = true;
options.UseHighQualityRendering = true;
doc.Save(Path.Combine(output, Path.ChangeExtension(Path.GetFileName(file), pageNum.ToString() + “.png”)), options);
}
We have also downloaded and tried the suggested version and the result was exactly the same as before.
Thanks,
Jaro
Hi Jaro,
Thanks for sharing the detail. I
have converted the shared document to Png using the shared code example. I have not found the shared issue. I have attached the output Png with this post for your kind reference. I have used the ImageSaveOptions.Resolution as 300.
Please let us know if you have any more queries.
Hi Tahir,
Pls, try other image resolutions… we have used 96, as it is displayed on the monitor.
This problem still persists. We have already bought the full version. Currently using version Aspose.Wrods 15.8.0.0.
Thanks and regards,
Jaro
Hi Jaro,
Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for .NET 15.10.0 and have not found the shared issue. Please use Aspose.Words for .NET 15.10.0. We have attached the output png with this post for your kind reference.
Please let us know if you have any more queries.
Hello,
We have tried hard to reproduce both behaviors on several OSes and came to this conclusion:
The error (our case and example picture) is reproducible only on Windows 8+, that is Win 8, Win 8.1, Win 10. The text is rendered normaly (your case and example picture) on Win 7 and Win XP.
We have used Aspose.Words 15.10 in the latest tests.
Can you please try to reproduce it on Win8+ system?
Thanks and regards,
Jaro
Hi Jaro,
Thanks for sharing the detail. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-12767. You will be notified via this forum thread once this issue is resolved.
Hi Tahir,
This is very nice, but, sorry, this provides absolutely no resolution to our problem. And the problem is still there. Maybe the “some parameters” are not the right ones for newer systems? The problem is reproducible on newer systems (now/soon the majority of Windows systems used), so please try to find a solution.
Now to your suggestion: Should we tell the user to use 1-inch letters on his/her monitor just to be able to read the text normally? This isn’t the way either…
Please, provide us at least some kind of workaround (like Windows tweak) so that it behaves consistently.
Thanks and regards,
Jaro
Document doc = new Document(MyDir + "in.rtf");
ImageSaveOptions options = new ImageSaveOptions(Aspose.Words.SaveFormat.Png);
options.PageIndex = 0;
options.PageCount = 1;
options.Resolution = 300;
options.UseAntiAliasing = true;
options.UseHighQualityRendering = true;
doc.Save(MyDir + "Out.png", options);
Hello Tahir,
Again, 300dpi won’t help us… We need 96, which is the default form most monitors.
Here are some very good articles which describe the merit of the problem and possible solutions and comparisons of results using different techniques:
http://theartofdev.com/2014/03/02/blurryfuzzy-gdi-text-rendering-using-antialias-and-floating-point-y-coordinates/
http://theartofdev.com/2014/04/21/text-rendering-methods-comparison-or-gdi-vs-gdi-revised/
Hope this helps your developers to make the visual quality much better…
Regards,
Jaro
Hi Tahir,
Again, send these articles to your dev team:
to let them reevaluate this issue. This is not closed for us.
Thanks,
Jaro
Hi Tahir,
Oh, nice. Yes, it will help us greatly. And not only to us, I believe…
I would suggest to add it to all rendering (even on screen or for printing).
Thanks and regards,
Jaro
Hello Tahir,
Can you please let us know when is this feature planned for release?
Thanks,
Jaro