Why do some files display fractional white lines?

When converting PDF to HTML5 or SVG, you may notice a small subset of files where thin white lines appear in the generated output. Sometimes the white lines can be seen to a lesser extent in the original PDF file, and sometimes they may appear or disappear when zooming in or out.


Why are some PDF files like this?

This phenomenon is commonly seen in PDF files that were either produced by Adobe InDesign or compressed using Adobe’s PDF Optimizer/Compressor tools. Specifically, it is caused by the “transparency flattening” feature which works by cutting up the PDF content around areas of transparency and flattening those areas. We have also observed that this feature causes large images to be subdivided into smaller tiles regardless of transparency.

You can learn more about this here:

What causes the white lines?

When dividing the PDF content, the transparency flattening process adds a clip area around each of the subsections. This is done with very fine tolerances which creates a fraction of a pixel between the subdivisions that is outside the clip areas, thereby resulting in the appearance of thin lines between sections where those pixels are not being fully painted.

Why are the lines more prominent in BuildVu?

They occur more prominently in some PDF viewers due to differences in how graphics rendering engines paint pixels where content only partially overlaps them. The files that exhibit this issue are relying on a feature of PDF called Scan Conversion. Scan Conversion is a process controlled by the graphics renderer which determines how to paint a pixel when content only partially overlaps it.

The PDF specification calls for very forgiving scan conversion, to fully paint a pixel even when content only partially overlaps it. However converting to HTML and SVG means that we rely on the web browsers to render the content, which do not provide control of scan conversion.

Is there a workaround?

Sadly we are yet to find a viable workaround for files that exhibit this issue. Where possible, we recommend advising users to avoid the transparency flattening feature when creating or compressing PDF files. We have looked into this issue extensively in the past, and will continue to experiment with solutions as and when new ideas arise.