Hi,
We’re encountering issues trying to render Arial Narrow text in a png image with different text sizes and render resolutions.
Arial Narrow 10 pt renders fine at 96 dpi but, at 200 or 300, spaces tend to change in size or even disappear.
Any idea why this is happening ?
The code used to generate images was as follow :
System.out.println(“opening workbook”);
Workbook book = new Workbook(“test.xls”);
// Create an object for ImageOptions
System.out.println(“setting options”);
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
// Set the image type
imgOptions.setImageFormat(ImageFormat.getPng());
imgOptions.setOnlyArea(true);
imgOptions.setOnePagePerSheet(true);
// Get the first worksheet.
Worksheet sheet = book.getWorksheets().get(0);
// Create a SheetRender object for the target sheet
System.out.println(“rendering sheets”);
SheetRender sr;
// Test at 96 dpi
imgOptions.setHorizontalResolution(96);
imgOptions.setVerticalResolution(96);
sr = new SheetRender(sheet, imgOptions);
System.out.println(“creating png 96”);
for (int j = 0; j < sr.getPageCount(); j++) {
System.out.println(“page “+(j+1)+”/”+sr.getPageCount());
// Generate an image for the worksheet
sr.toImage(j, “png_output_” + (j+1) + “096.png");
}
// Test at 200 dpi
imgOptions.setHorizontalResolution(200);
imgOptions.setVerticalResolution(200);
sr = new SheetRender(sheet, imgOptions);
System.out.println(“creating png 200”);
for (int j = 0; j < sr.getPageCount(); j++) {
System.out.println(“page “+(j+1)+”/”+sr.getPageCount());
// Generate an image for the worksheet
sr.toImage(j, "png_output” + (j+1) + “200.png");
}
// Test at 300 dpi
imgOptions.setHorizontalResolution(300);
imgOptions.setVerticalResolution(300);
sr = new SheetRender(sheet, imgOptions);
System.out.println(“creating png 300”);
for (int j = 0; j < sr.getPageCount(); j++) {
System.out.println(“page “+(j+1)+”/”+sr.getPageCount());
// Generate an image for the worksheet
sr.toImage(j, "png_output” + (j+1) + “_300.png”);
}
System.out.println(“png creation complete”);
Test files are attached to this post.
Best regards.
Charles
Hi Charles,
Thanks for your posting and using Aspose.Cells for Java.
We were able to observe this issue using your sample code and source file with the latest version. Arial Narrow 10 pt does not render fine at 200 or 300 dpi, It renders fine at 96 dpi. We have logged this issue in our database. We will look into it and resolve this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.
This issue has been logged as CELLSJAVA-40642.
Hi,
Thanks for your posting and using Aspose.Cells for Java.
We have fixed this issue.
Please download and try this fix: Aspose.Cells for Java v7.6.0.3 and let us know your feedback.
The issues you have found earlier (filed as CELLSJAVA-40642) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi,
We were able to test it without problems.
Spaces now render fine with Arial Narrow regardless of the resolution.
Thank you very much.
C.
Hi,
Thanks for your feedback and using Aspose.Cells.
It’s good to know that your issue is fixed now. If you encounter any other issue, please feel free to post. We will be glad to help you further.