Annotations not shown in some other readers because we don't save appearance streams
PDF 2.0 requires annotations to be saved along with an appearance stream (a pre-generated visual representation). This was optional in PDF 1.7. Poppler doesn't write them and also doesn't claim (yet) to produce PDF 2.0, so it's fine from that perspective. But a consequence in practice is that some wide spread readers like PDF.js don't show our annotations.
To be more precise, poppler actually generates appearance streams quite well for a lot of annotations types, but it keeps them in memory and doesn't save them to the document.
This is related to
- Okular bug 410642
- Okular bug 413819
-
#522 (closed), it is/was about generating in-memory appearance streams so that poppler can render
/AP
-less annotations. #839 is about saving those in-memory appearances back into the file so that other readers are unburdened from generating their own in-memory/AP
.