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

Free Support Forum - aspose.com

Missing Logo and Fuzzy / Light Text when converting XLS to TIFF using SheetRender

Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We are using Aspose.Cells.dll 4.9.1.5. When converting the XLS to TIFF, the logo image is missing and the print quality is much worse using SheetRender vs. SheetToImageByPage. If you look at the uploaded XLS and TIFF files, you will see that images created by SheetToImageByPage are good. The images created by SheetRender are fuzzier and are missing data, the logo in particular. We have to use SheetRender because of previous issues that were fixed only in SheetRender.

The code sample we are using to perform the conversion can be seen in the thread, “SheetRender Creates Blank Pages But Excel Does Not”

Please let us know when we can expect a fix for this issue.

Thank you,

Robert.

Hi Robert,

We have logged your issue into our issue tracking system with an issue id: CELLSNET-17485. We will investigate your issue to figure them out and let you know about it very soon.

Thank you.

Hello,

I have uploaded another sample of the problem. The zip has the original xls as well as TIFs created by SheetToImageByPage and SheetRender. See how the characters are destroyed when converted using SheetRender.

Please let us know when we can expect a fix.

Thank you.

Hi,

Thanks for sharing us the additional archive containing the template files.

We will further look into your issue and get back to you soon. Your issue is already added with a ticket: CELLSNET-17485

Thank you.

Hi,

Please try the attached version.

And, please set higher resolution, it will be fine for your need.

image.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;
image.TiffCompression = TiffCompression.CompressionCCITT3;
image.HorizontalResolution = 200;
image.VerticalResolution = 200;


Thank you.

Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We have tested the new Aspose.Cells 4.9.1.11 build. While the characters are now darker and the logo is being displayed, there is still an outstanding problem and new problems have been introduced. I have uploaded 3 ZIP files that show each of the problems with the original XLS and the converted TIF files. I have also put a readme.txt in each ZIP file to restate the problem for each.

1. MissingCharacters.zip – You have fixed the logo on this one but all the characters are still not rendering correctly using SheetRender. I have re-attached the original XLS along with all of the generated TIF files from Sheet Render 4.9.1.11.

The file ABC-Before-SheetToImageByPage.tif shows how the XLS was rendered using "SheetToImageByPage" (which looks good.)

The file ABC-SheetRender-4.90.1.11.tif show how XLS was rendered using SheetRender in Aspose.Cells version 4.9.1.11.

Notice that all of the Chinese text is missing. It is replaced with garbage characters.

2. TooManyPages.zip – The text is better in this XLS. However cells are being rendered at the wrong size.

If you compare the 0100000.xls in print preview mode in Microsoft Excel to the generated TIF files from the SheetRender conversion, you will see these problems. I have re-attached the original XLS along with all of the generated TIF files from Sheet Render.

a. On the first XLS sheet, Excel prints 2 pages. SheetRender produces 4 pages. SheetRender moves part of the grids on the right hand side onto their own pages, creating two extra pages.

b. On the second XLS sheet, Excel prints 20 pages. SheetRender creates 58 pages. SheetRender is creating the cells much larger than Excel, causing many additional pages to be created.

3. BadHeading.zip – This is a very simple XLS that was previously working. Aspose.Cells.DLL 4.9.1.11 has broken existing functionality.

If you look at "01010000-SheetRender-4.9.1.5.tif", you will see the heading on the TIF is correct using SheetRender 4.9.1.5.

If you look at "01010000-SheetRender-4.9.1.11.tif", you will see the heading is now mangled.

Please let me know when I can expect fixes to these issues. Thank you.

There hasn’t been a response since I posted these 3 issues last week. I have retested with the new Aspose.Cells 5.0.0.0 but the problems still exist.

The MissingCharacters.ZIP file shows that the original problem from this thread is still not fully fixed. Please let me know when I can expect an update.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

The TooManyPages.zip and BadHeading.zip shows new regression problems from the last Aspose.Cells update. Do I need to put those in a new thread to get them resolved or should I leave them here?

Thank you,

Robert

Hi,

We are looking into your mentioned issues, we will get back to you soon.

Sorry for any inconvenience caused!

Hi,

Please try the attached version.

For the issue regarding MissingCharacters: please install Mingliu or Simsun
and set it as system default font to show the characters fine. Please see the
attachment for reference.


For the issue regarding TooManyPages: please auto-fit row before saving to tiff:
e .g
AutoFitterOptions options = new AutoFitterOptions();

options.OnlyAuto = true;

sheet.AutoFitRows(options);

SheetRender sr = new SheetRender(sheet, imgOptions);

For the issue regarding BadHeading: we fixed it.


Thank you.

Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your new update. There are still some problems.

1. MissingCharacters.zip.

I do not understand why we have to install the fonts you mentioned for the following reasons:

a. If you look at the original uploaded zip, you can see that SheetToImageByPage properly rendered the fonts, without any additional fonts installed.

b. If you view or print this XLS in Excel, the fonts display and print properly, without any additional fonts installed.

c. We cannot install either of these fonts as the default font on the systems running the conversion.

Why would we need to install any font when Aspose SheetToImageByPage and Microsoft Excel both properly render this XLS without installing any additional fonts? Can’t you fix SheetRender to work the same way?

(We were forced to change to use SheetRender since you are no longer supporting SheetToImageByPage.)

2. TooManyPages.zip.

I have added the sample code you provided to perform the autofit, but these issues exist.

a. Even with autofit, for the first worksheet 4 pages are created but in Microsoft Excel you only get 2 pages. If you look at the second work sheet, the autofit still does not match what Microsoft Excel outputs. The first page of the second sheet has 19 rows when viewed in print preview from Excel but there are 20 rows when converted with Aspose. Please see the XLS and rendered TIFs I uploaded in PagesWith5.0.0.2.zip.

b. I am concerned that this change will have other ripple effects on other XLS files, changing them from the original. We need it to match the output of Excel without changing the XLS formatting. We did not have to use autofit when we were using SheetToImageByPage.

3. Badheading.zip.

This problem is fixed. Thank you.

Hi,

Thanks for your feedback,

We will further look into your mentioned issues and get back to you soon.

Thank you.

Hi,

Please try the attached version. v5.0.0.3.

For Missing characters issue:

Please try this version, if some characters are still
blocked, please use Workbook.SaveOptions.DefaultFont to solve the missing
characters issue:

e.g
book.SaveOptions.DefaultFont= “mingliu”;



For TooManyPage issue:


We have attached the result shown in Excel 2003, the first page of the excel
file will be splited into 4 pages. And, AutoFitRow is not exactly the same as Excel, so, if you want exactly
the same result as Excel, please save the template using Excel, then convert it to
image.



Thank you.

Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I have tested your new build 5.0.0.3. Thank you for the fast response. There are still some issues.

1. MissingCharacters.zip.

This is an improvement. Yes there are still characters missing. I have an issue about setting the default font. We are processing all sorts of XLS files coming from around the world in an automated batch environment. In this specific case, the font happens to be “mingliu”. In some other XLS, it may not use that font. I cannot blindly set the default font to that for every XLS.

Can you create a fix that works without having to set this font? SheetToImageByPage works without having to set any font. If not, how can we generically handle XLS files with different fonts in an automated fashion?

2. Annotated-Alignment-Cutoff.zip

Please see this new ZIP file that I have uploaded. It is the same XLS as above converted to TIF using SheetRender and using SheetToImageByPage. I have marked up the TIF file showing problems in the conversion from SheetRender. The problems include 4 missing lines of text, text that is chopped off, text that is wrapped wrong and text that is aligned wrong. If you take a look at the same TIF created by SheetToImageByPage, it rendered correctly. Please let me know when you have corrected this issue.

3. Excel2007-Pagination.zip

Hmm. OK, I’ll accept the fact that Excel 2003 and Excel 2007 are paginating the file slightly differently. I have uploaded Excel2007-Pagination.zip which shows how the XLS is displayed in Excel 2007 and how the first two pages are displayed in print preview (and it prints the same way too).

I need to have the XLS print at the same cell sizes from when it is opened without having to call “autofit” and without having to resave the XLS first. SheetToImageByPage worked fine in this respect. Can’t you make SheetRender work the same way?

Thanks,

Robert

Hi,

Thanks for your feedback.

We will further look into your issues and get back to you soon.

Thank you.

Hello.

Any updates for these fixes?

Thank you,

Robert

Hi Robert,

1. There are several fonts such as
“Arial Unicode MS” which cover most of the Unicode characters. For further information, please refer to
http://en.wikipedia.org/wiki/Unicode_typeface. You can set fallback font as above Unicode font to solve that
“some characters are shown as block when the template do not set
correct workbook default font or font in cell” problem.



2. Please try using the latest hotfix v5.0.0.13 of Aspose.Cells for .NET in which we have fixed cut off and alignment issues.



3. The page break:

After the testing, we have found that when we set windows default printer to certain
type like Foxit PDF printer, then same xls will show in different
page breaks strategy in print preview.

It’s not good idea for Aspose.Cells to read client’s printer setting
because there might occur some access rights issues.

Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the update. It did improve the rendering but there are still some issues. I uploaded a new ZIP file “SheetRender-MissingText-Baseline.zip“ with examples. The ZIP file contains these 3 files:

“28595 Missing Logo-TM000001.xls” - is the XLS file I was testing.

“Using-SheetToImageByPage.tif” - is how it renders with “SheetToImageByPage”, which looks great.

“Using-SheetRender-Text-Baseline.tif” - is how it renders with SheetRender and is annotated to show the problems. There are 3 basic problems.

(Notice that none of these issues occur using SheetToImageByPage).

1. In the lower right in box “22”, there are still some characters that are not being displayed properly. They appear as empty squares. I tried setting “book.SaveOptions.DefaultFont = "Arial Unicode MS";” as suggested, but it did not help. Be aware that we never actually save the worksheet. We just open it, render to tiff, then close it. We also do not do anything with the printer settings. Is there something wrong with the way I am doing it? Is there something you can do since SheetToImageByPage doesn’t have this problem? (Again, we are processing XLS files in bulk and need to make sure we do not ruin other XLS files.)

2. There is some text in the middle right that should wrap, but does not. As a result, text is missing.

3. There are a number of places where the bottom baseline of the text does not line up. The bottom of the text is not a straight line which will affect our processing of the tiff after converting it.

Thank you,

Robert.

Hi,

Please try the attached version.

We have improved the baseline and figure out the text wrap problem. For “In the lower right in box “22”, there are still some characters that
are not being displayed properly but the character” we do not find the issue in our environment, could you send your OS environment and make sure the “Arial Unicode MS” is
installed on your computer.


Thank you.

Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I have tested your new version 5.1.0.1.

Missing Character Problem:

There are still some characters that appear as empty boxes, like before.

You can see the code I am using if you look in my other thread: “SheetRender ToImage Throws Exception: Index was out of range”. The only difference is that for this test, I added the line about setting the font like this:

Workbook book = new Workbook();

book.Open(fullPath);

book.SaveOptions.DefaultFont = "Arial Unicode MS";

The font “Arial Unicode MS” is installed on my system. I have included a JPG in my new zip file, MissingChars.zip, that shows the font in my font dialog. I am running Windows XP Pro in a standard U.S. configuration.

The ZIP file also contains the TIF generated by using Cells 5.1.0.1. These missing characters display properly when viewed in MS Excel and were rendered properly when we were previously using SheetToImageByPage on the same machine. Let me know if you need additional information about this one.

Text Baseline Alignment Problem:

I looked at the baseline of the characters. I see some of the alignments that were really off, are slightly improved. Overall, the baseline isn’t even. Is this the best I can expect for this issue using SheetRender?

Thank you,

Robert.

Hi,

Thanks for your feedback,

We will further look into your issue and get back to you soon.

Thank you.