`ActualText` with referenced objects doesn't work
Attached file code-debug.pdf
is the output of LuaTeX where the hyphen is enclosed by an ActualText
span that effectively suppresses the hyphen from being copied and pasted. Also attached is file code-debug-gs.pdf
, produced by a forthcoming Ghostscript version (i.e., Ghostscript 10.0.0. together with the bug fix from https://bugs.ghostscript.com/show_bug.cgi?id=706256); the call was
ps2pdf -dPreserveMarkedContent=true code-debug.pdf code-debug-gs.pdf
'okular' (tested version 21.12.3) and 'evince' (tested version 41.4) both handle the origin input file fine but not the gs
output: it seems that 'poppler' doesn't handle referenced objects for this case.
The original PDF contains
...
/Span<</ActualText()>>BDC
1 0 0 1 519.816 726.054 Tm [(-)]TJ
EMC
...
while the Ghostscript output is
...
/Span/R11 BDC
q
10 0 0 10 0 0 cm BT
/R9 10.9091 Tf
1 0 0 1 519.816 726.054 Tm
(-)Tj
ET
Q
EMC
...
14 0 obj
<<
/ActualText ()
>>
endobj
7 0 obj
<<
/R11 14 0 R
>>
endobj
...
Both PDF viewers use libpoppler.so.124
on my GNU/Linux box.