Annotations with pen with pressure not displayed in Pdf viewer


#1

I have a onyx boox note with firmware 2.1.2.

When I add scribbles on the pdf with the pen without pressure, I can then open the pdf on my computer, and annotations are correctly displayed on the pdf (I am using evince on linux, it also works with okular).

But when I add scribbles on the pdf with the pen with pressure, the annotations are not displayed on Evince or Okular (I can see them with Master PDF Editor though).

The difference I see between those two is that the pen without pressure have type “PolyLine”

<</AP<</N 1277 0 R >>/BS<</W 1.52308>>/C[ 0 0 0]/CA 1/F 4/Rect[ 308.956 716.836 338.656 738.921]/Subtype/PolyLine/Type/Annot/Vertices[ 309.718  ... ]/onyxtag({\n        "id": "03a0e4f2-773b-46e9-8253-fa1142f3d14b",\n "type": "PolyLine" \n} \n)>>^M

But the pen with pressure has type “Ink”, example :

<</AP<</N 1280 0 R >>/BS<</W 0>>/C[ 0 0 0]/CA 1/F 4/L[[]]/Rect[ 99.4139 ...  617.575]/Subtype/Ink/Type/Annot/onyxpoints 1279 0 R /onyxtag({\n        "id": "0b191bd9-1d34-45d3-9766-29fedc572eaf",\n "type": "BrushStroke" \n} \n)>>^M

This is annoying because I cannot use the pen with pressure, could this be solved ?

Thanks a lot !


Quality of exported scribbles is very poor
#2

I have the same problem here, although I didn’t realize that some annotations would work and not others. This was discussed here:

And reported as a bug in Evince here:

In the above bug report, the PolyLine entity is the one that causes the warning so I’m not sure this is exactly the same phenomenon.

A workaround is to use Ghostscript to convert the file to a Postscript file: because Ghostscript supports those wiggles, it can read them, but it means it rasterizes the entire page which then becomes incredibly ugly:

pdf2ps foo-Exported.pdf

Evince is not the only PDF reader having trouble with those. From circumstantial evidence, I think we can assert that those work:

  • Acrobat reader
  • Emacs (which apparently uses dvipdf, which comes with Ghostscript)
  • some versions of PDF.js (for some versions of Firefox and Google Chrome and others)

And that those don’t:

  • Evince
  • Okular
  • XPDF
  • Zathura

#3

I can confirm that Evince has trouble showing the “brush” (or “pen”?) strokes, but not the regular pencil, which works slightly better.

I’ve also expanded the test case in the Evince issue and also filed this in the underlying Poppler issue:


Please save the scribbles as Ink, not PolyLine
#4

@claire the issue was discussed in the gitlab issue mentionned by @anarcat.

The poppler/evince developers report that the issue happens because the Ink annotation doesn’t have the InkType property, which is required in the spec (even if it is not used in this case). So it should be added, with an empty value.
The issue was discussed here : https://gitlab.gnome.org/GNOME/evince/issues/1195
So the fix for onyx neoreader would be to add this empty property.

Also, they are currently studying to add a case to make it work in poppler (and evince) so that in the future, such annotations still work (even if not valid according to the spec). The fix is discussed here : https://gitlab.freedesktop.org/poppler/poppler/issues/784

I think the fix in onyx reader would still be appreciated, if other pdf readers have the same behaviour.


#5

Hi @claire, any update on this ? I believe this should be easily fixable as I explained in my last comment


#6

Dear, we have submitted this to our R&D department already. Will keep you updated.


#7

Thank you very much.


#8

Thanks. Very useful to know what codebase the device relies on…