0

When I print to pdf, my cells have some spacing between them, which I cannot get rid of.

Basically I have similar problems as this: How to generate a nice PDF with php Excel? (see the first picture) which is described as solved

By setting cellspacing to 0 borders are handled almost as expected,

So I guess I need to set cellspacing to 0, it's just that I can't find out how to do that.

Update:

I found this http://phpexcel.codeplex.com/discussions/249376. But the solution involves messing with the source code of PHPexcel, I would much rather find a way to achieve this within my project, not changing the PHPexcel files..

Community
  • 1
  • 1
Oriesok Vlassky
  • 797
  • 1
  • 13
  • 26
  • Given that PHPExcel gives you a choice of PDF renderer, it might help if you indicated which of the supported renderers you're actually using – Mark Baker Oct 09 '13 at 11:24

1 Answers1

2

See lines 1028 to 1032 of the HTML Writer. Cellspacing is set to 0 unless you're writing to PDF and getShowGridLines() for the sheet is true (which is the default value), in which case it's set to 1... so calling setShowGridLines(false) for the worksheet(s) before saving should set cellspacing to 0.

Mark Baker
  • 209,507
  • 32
  • 346
  • 385