This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Problems with border width

adwire wrote on 2011-03-01:
Hi,

When I use you service for converting a website containing a table to PDF, the table borders are thicker then specified. I specify the border width (1px) in a CSS document and if I browse the page the borders are OK, but when converting to PDF the border width turns into 2px. Is there something I can do to prevent this behaviour?

Thank you in advance!
support wrote on 2011-03-01:
Unfortunately, there is not much you can do about this.

PDF internally uses a device-independent coordinate system so in general, it is not possible to simply specify N device pixels in PDF. As for the line width, here is a quote from the PDF specification:

"The line width parameter specifies the thickness of the line used to stroke a path. It is a non-negative number expressed in user space units; .... A line width of 0 denotes the thinnest line that can be rendered at device resolution: 1 device pixel wide. However, some devices cannot reproduce 1-pixel lines, and on high-resolution devices, they are nearly invisible. Since the results of rendering such zero-width lines are device-dependent, their use is not recommended."

So we are somewhat reluctant to support the zero line width (and thus 1 device pixel wide lines) since the PDF reference discourages from that.