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

Free Support Forum - aspose.com

Problem Cells style Export PDF

Hi, I’m testing a version of aspose cells. But in the last test, i found that aspose cells doesn’t copy background color in the export process(and maybe font color ).

Hi,

Thanks for your posting and using Aspose.Cells.

Please download and try the latest version: Aspose.Cells for Java v8.7.2.2
and see if it makes any difference and resolves your issue.

If your issue still occurs, then please provide us your sample code and sample excel files which you are converting to pdf as well as some screenshots highlighting your issue. We will look into it and help you asap.

Hi shakell,

thanks for your answer and interest in this case.

the sample code is:


package aspose;

import com.aspose.cells.SaveFormat;
import com.aspose.cells.Workbook;

public class PruebaAsposeExcel {

public static void main(String[] args) throws Exception {
String path="/home/desarrollo-16/ruta/plantillas/";
String src=path+“CIR.xls”;
String dest=path+“CIRASPOSE.pdf”;
//Instantiate a new workbook with Excel file path
Workbook workbook = new Workbook(src);
//Save the document in PDF format
workbook.save(dest, SaveFormat.PDF);
}

}

In the image Selection_090.png , i marked the difference with the original file(background color cell and font color).


Thanks


Hi,

Thanks for using Aspose.Cells.

We have looked into this issue and found that your issue is occurring because of Black and white setting. If you uncheck it, then it will render your style and background colors.

Please see this screenshot for your reference.

( http://prnt.sc/as73s4 )

You can use the following sample code to render pdf as per your needs.

Java

Workbook book = new Workbook(dir + “cir.xls”);
Worksheet sheet = book.getWorksheets().get(0);
sheet.getPageSetup().setBlackAndWhite(false);
book.save(dir + “output.pdf”);