Issue regarding rendering of vector graphics inside pdf
Background
I've created a pdf using Latex and the way it is rendered seems to depend on the pdf viewer that I use. I've opened an issues at the git of my default pdf viewer. However the issue appears in multiple poppler based viewers, hence I was referred to this repository.
The issue seems to be related to anti-aliasing. I first encountered this in TeXstudio's internal viewer (which uses poppler) and saw the same issue appear in Okular (which also uses poppler). However Envice (also with poppler) seems to work fine. I'm a bit at a loss to what is causing it.
File creation workflow
A detailed description of the file creation process. As it is unclear to me whether the issue exists in poppler (and some of the other render engines), the implementation of poppler in viewers, in Inkscape (used to create the image), or in Latex (used to create the pdf).
- The file was created using Inkscape as an
.svg
then it was exported to a.pdf
and.pdf_tex
using Inkscape's build in exporter. This separates text from the drawing, the text will later be rendered in Latex and ensures consistency of fonts throughout the resulting document. SVG-effect rasterisation was turned off. Drawing.zip - XeLaTeX was used to render the file, the process to include the figure in TeX is described in this manual.
The resulting pdf can be found here: Document.pdf
The issue in different PDF viewers
Below are screenshots of how the PDF gets rendered by different viewers and render engines.
TeXstudio (using poppler and splash renderer) suffers from bad aliasing: TeXstudio (using poppler and Arthur renderer) suffers from white lines in the drawing: Okular (using poppler) looks exactly like the TeXstudio-Splash renderer does: Envice/Gnome viewer (using poppler) does not have any issues:
Now some viewers that do not rely on poppler, they are not necessarily better. Firefox creates waivyness with the aliasing: WPS near perfect, but upon zooming on the screenshot it shows artefacts similar to TeXstudio-Arthur renderer but less pronounced: MuPDF is like the TeXstudio-Arthur renerer:
Questions
- Is the behaviour an issue of poppler or of Inkscape? (Many viewers with different engines have issues with this pdf. However not all of them, and the issues that appear are different between the different renderers).
- How come that the Envice viewer does not have any problems while it does use poppler. What voodoo magic do they use to make the artefacts disappear?
- A more generic question, why do these differences even appear, what part of the image makes it behave so unpredictable. Is this kind of images not part of the official pdf specification?
- How do I ensure that my readers are all getting a good-looking and consisting image, independent of the platform they use to view the pdf.