pgfplots icon indicating copy to clipboard operation
pgfplots copied to clipboard

incorrect pdf Operator S

Open teepeemm opened this issue 8 months ago • 2 comments

Brief outline of the bug

PDF Accessibility Checker says that the MWE leads to two errors because Operator 'S' not allowed in this current state. The pdf file has S at the following lines:

299 97.13599 80.69843 m 
...
324 S 
...
528 97.13599 80.69843 m 
529 B 
530 S 

Looking at the PDF 1.7 spec (https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf), I think Figure 9 (p113) says that the m operator begins a path object, and that Section 8.5.3.1 (p134) says the first S or B operator ends the path object. I think this means that the S on line 530 is invalid. Would it be possible to not have a superfluous S operation? Where in the code do the B and S operators originate?

Minimal working example (MWE)

% !TEX program = LuaLaTeX
\DocumentMetadata{testphase=latest,lang=en,pdfversion=1.7,pdfstandard=ua-1,uncompress}
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\title{title}
\begin{document}
\begin{tikzpicture}[alt={alt text}]
\begin{axis}[xmin=-1,xmax=1,ymin=0,ymax=1,axis x line=none,axis y line=none]
\addplot[mark=*,draw=black](0,.5);
\end{axis}
\end{tikzpicture}
\end{document}

teepeemm avatar Jul 21 '25 18:07 teepeemm

Looks like a https://github.com/pgf-tikz/pgfplots issue. Does a tikzpicture with simple drawings complained by the PDF Accessibility Checker too?

muzimuzhi avatar Jul 22 '25 00:07 muzimuzhi

It does appear that a tikzpicture without an axis environment is ok according to the PDF Accessibility Checker, so I think this may indeed be a pgfplots issue. Are you able to move this over?

teepeemm avatar Jul 22 '25 00:07 teepeemm