Tiny space between in merged borders after exporting to PDF

I’ve written a small script that converts a given XLSX into a PDF, and it works like a charm, except for one minor thing that I’m very confused about: merged borders have a super tiny bit of space between them.

For reference, here’s the view from within Microsoft Excel 365:
grafik.png (723 Bytes)

And after zooming in on the exported PDF created by Aspose.Cells:
grafik.png (14.2 KB)

I know this is a super petty complaint, but I’d still like to see this fixed or get a workaround. :slight_smile:

PS: I’m also curious why the text isn’t properly vertically centered after PDF export.

@Selbi,
Could you please share your source template file and sample code which you have used for testing? We will use this information to reproduce the issue here and provide assistance accordingly.

You can use any Excel file and create some borders, then export them to PDF using this code:

Workbook work = new Workbook("C:\\bordertest.xlsx");
work.save("C:\\bordertest_aspose.pdf", SaveFormat.PDF);

Here’s a simple Excel file inclding the exports with both Aspose and Excel 365, the latter not having any issues:
bordertest.zip (37.9 KB)

@Selbi,

Thanks for the files.

I did evaluate your issue a bit. I am afraid, I could not see the issue. I opened your both files into Adobe acrobat and set zoom values, e.g 400%, 800% or above but still could not see the difference or issue. Could you share some screenshots comparing Aspose output Vs Office output taken in Adobe acrobat to highlight the issue, we will check it soon.

Hmm, you’re right, it doesn’t appear in Acrobat Reader. It does, however, show up when displayed in Firefox.

@Selbi,

We noticed those tiny lines/space (seen only when using higher zoom values) when viewing the file into FireFox. Aspose.Cells generates PDF files to display for Adobe acrobat and it follows Adobe acrobat standards in most cases. But if you still want us to evaluate the issue, we can log a ticket for investigation into our database, please confirm?

That would be amazing, thank you!

@Selbi,
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSJAVA-43045 – Tiny space in border after converting Excel to PDF

@Selbi,

Please try the following sample code, it will figure out your issue:
e.g
Sample code:

Workbook workbook = new Workbook("bordertest.xlsx");
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setOptimizationType(PdfOptimizationType.MINIMUM_SIZE);

workbook.save(outFile.pdf, pdfSaveOptions);

The output will be better. The option PdfOptimizationType.MINIMUM_SIZE will try to merge some border lines but it does not work for double border line type.
You will see in the output PDF, the tiny space disappears for the first two lines, but does not work for the third line.

Thank you very much, it works!

Will this get fixed?

@Selbi,

As the issue is still open, so we will fix it in future versions.