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

Free Support Forum - aspose.com

Wrong font color appears for tables and ranges

Hello,


I am using Aspose.Cells v8.6.3.6.

In case of tables and ranges, wrong font color appears when converting them to any format - Pdf, Image and Html. The issue appears for all these formats.

This is a break in v8.6.3.6. as compared to v8.6.3.

I have attached the Excel file, Html, PNG and PDF output, and Sample code used to generate the output in attachments.rar

Can you please analyse this issue.

Thanks,
Neha

Hi,


Thanks for the template file, sample code segments and generated files.

After an initial test, I observed the issue as you mentioned by using your template file with sample code segments you provided. I found that wrong font color appears for tables and ranges in the generated HTML/Image/PDF format(s).
e.g
Sample code:

String dynamicRange = “‘Daily Schedule’!B4:C36”;
String worksheetName = “Daily Schedule”;

Workbook workbook = new Workbook(“f:\files\wrong font color\font_color_issue.xlsx”);
Worksheet worksheet = workbook.getWorksheets().get(worksheetName);
// workbook.calculateFormula();
int rangeIndex = workbook.getWorksheets().getNames().add(“dummyrange”);
Name name = workbook.getWorksheets().getNames().get(rangeIndex); name.setRefersTo(dynamicRange );
name = workbook.getWorksheets().getNames().get(rangeIndex);
Range sourceRange = name.getRange();

Workbook newWorkbook = new Workbook(FileFormatType.XLSX);
WorksheetCollection targetWsc = newWorkbook.getWorksheets();
Worksheet targetWs = (Worksheet)targetWsc.get(0);

Range targetRange = targetWs.getCells().createRange(0, 0, sourceRange.getRowCount(), sourceRange.getColumnCount());

PasteOptions options = new PasteOptions();

//Copy column widths
options.setPasteType(PasteType.COLUMN_WIDTHS);
targetRange.copy(sourceRange, options);

// Copy row heights
int rowCount = sourceRange.getRowCount();
int firstRow = sourceRange.getFirstRow();

for (int i = 0; i < rowCount; i++) {
double rowHeight = sourceRange.getWorksheet().getCells().getRowHeight(firstRow++);
targetWs.getCells().setRowHeight(i, rowHeight);
}

//Copy everything else
options.setPasteType(PasteType.ALL);

targetRange.copy(sourceRange, options);

HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions(SaveFormat.HTML);
htmlSaveOptions.setHiddenColDisplayType(1);
htmlSaveOptions.setHiddenRowDisplayType(1);
htmlSaveOptions.setParseHtmlTagInCell(true);

newWorkbook.save(“f:\files\out1.html”, htmlSaveOptions);



Worksheet sheetForPDF = newWorkbook.getWorksheets().get(0);
sheetForPDF.getPageSetup().setTopMargin(0);
sheetForPDF.getPageSetup().setBottomMargin(0);
sheetForPDF.getPageSetup().setRightMargin(0);
sheetForPDF.getPageSetup().setLeftMargin(0);
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setOnePagePerSheet(true);

Worksheet sheetForImage = newWorkbook.getWorksheets().get(0);
sheetForImage.getPageSetup().setTopMargin(0);
sheetForImage.getPageSetup().setBottomMargin(0);
sheetForImage.getPageSetup().setRightMargin(0);
sheetForImage.getPageSetup().setLeftMargin(0);
ImageOrPrintOptions imageOrPrintOptions = new ImageOrPrintOptions();
imageOrPrintOptions.setHorizontalResolution(600);
imageOrPrintOptions.setVerticalResolution(600);
imageOrPrintOptions.setOnePagePerSheet(true);
imageOrPrintOptions.setOnlyArea(true);
imageOrPrintOptions.setImageFormat(ImageFormat.getPng());
SheetRender sr = new SheetRender(sheetForImage, imageOrPrintOptions);
sr.toImage(0, “f:\files\out1.png”);


newWorkbook.save(“f:\files\out1.pdf”, pdfSaveOptions);

I have logged a ticket with an id “CELLSJAVA-41697” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

Thank you.

Hi,


This is to inform you that we have fixed your issue logged earlier as “CELLSJAVA-41697”. We will soon provide the fix after performing QA and incorporating other enhancements and fixes.

Once the new version/fix is available for public use, we will let you know here by sharing the download link.

Thank you.

The issues you have found earlier (filed as CELLSJAVA-41697) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.