You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Tam chilun <Ta...@outlook.com> on 2024/01/26 06:39:36 UTC

The annotations generated by PDFBOX cannot be displayed in the browser, but they can be displayed in adobe pdf reader

Dear developer

I use getAnnotations().add(anno) to generate annotations, ,but they won't display in my browser. Do you need any other method or is it not supported yet.

        Addannotations annoadder = new Addannotations();
        PDAnnotationFreeText anno = annoadder.setanno(param);


        PDPage page = document.getPage(Integer.parseInt(param[0])-1);
        page.getAnnotations().add(anno);

best

Re: The annotations generated by PDFBOX cannot be displayed in the browser, but they can be displayed in adobe pdf reader

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,

Please include more of your code. It does not show how this 
PDAnnotationFreeText is created, and whether you called 
*constructAppearances()* on it. Also upload your PDF to a sharehoster, 
and mention what PDFBox version you're using.
Tilman

On 26.01.2024 07:39, Tam chilun wrote:
> Dear developer
>
> I use getAnnotations().add(anno) to generate annotations, ,but they won't display in my browser. Do you need any other method or is it not supported yet.
>
>          Addannotations annoadder = new Addannotations();
>          PDAnnotationFreeText anno = annoadder.setanno(param);
>
>
>          PDPage page = document.getPage(Integer.parseInt(param[0])-1);
>          page.getAnnotations().add(anno);
>
> best
>