You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by chitgoks <ch...@gmail.com> on 2017/08/15 03:43:05 UTC

annotations not displayed in other viewers

hi

i think this is a pretty common problem

anontations created by pdfbox get shown in acrobat reader

but in some other reader? like chrome, osx viewer, skype preview and
pdf.js? they do not get displayed

i came across an issue thread in pdf.js which states:

So PDF.js fallback to use base annotation implementation to render them,
which means it is rendering those annotations use its AP field (appearance
stream). Most of the PDF reader/editor generates this filed by default.
That's why resave the file using some reader will fixes the file. However
because this field is optional, some PDF tool (pdfbox) may generate the
annotation without this field, then the fallback rendering no longer works.

any idea what this field could be? so i can manually add it?

please advise

Re: annotations not displayed in other viewers

Posted by chitgoks <ch...@gmail.com>.
hehe i managed to make it work. i called stroke but i set line width to 0.

thank you for the replies tillman

Website/Java Games: http://www.chitgoks.com
My Blogs:
http://tech.chitgoks.com
http://wuhtevah.chitgoks.com
http://disneyusa.blogspot.com

On Tue, Aug 15, 2017 at 2:59 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> Am 15.08.2017 um 08:40 schrieb chitgoks:
>
>> im coding my own appearance stream for each annotation instead. seems like
>> there's no other way.
>>
>> i have a quick question. is there some sort of PDColor.NONE value
>> equivalent?
>>
>
> No. Don't stroke. Or use an extgstate with a stroking alpha constant.
> (page 130 of the PDF 32000 specification)
>
> |PDExtendedGraphicsStateextendedGraphicsState
> =newPDExtendedGraphicsState();extendedGraphicsState.setStrok
> ingAlphaConstant((float)alpha);contents.saveGraphicsState();
> contents.setGraphicsStateParameters(extendedGraphicsState);// do your
> stuff contents.restoreGraphicsState();|
>
>
> Alpha should be 0.
>
> Tilman
>
>
>> im using a PDPageContentStream and i wish to set the setStrokingColor to
>> none.
>>
>> On Tue, Aug 15, 2017 at 2:26 PM, Tilman Hausherr <TH...@t-online.de>
>> wrote:
>>
>> Am 15.08.2017 um 06:03 schrieb chitgoks:
>>>
>>> by the way
>>>>
>>>> came across a post that confirmed this a bug for pdfbox
>>>>
>>>> seems creating annotations, no appearance stream is included. that's why
>>>> viewers dont show any annotations
>>>>
>>>> is this still a bug? or has this been fixed? if so, please advise how ?
>>>>
>>>> thank you very much
>>>>
>>>> Yes this is a known missing feature and it has not been fixed. It is
>>> more
>>> than just a field, it is a content stream, i.e. PDF operators with the
>>> parameters. There was some work last year but only for some simple
>>> annotations, not for the complex ones, this can be seen when building the
>>> trunk (get it from svn) from source.
>>>
>>> You can see the differences by looking at the files (before and after
>>> Adobe Reader) with PDFDebugger.
>>>
>>> Tilman
>>>
>>>
>>>
>>> On Tue, Aug 15, 2017 at 11:43 AM, chitgoks <ch...@gmail.com> wrote:
>>>>
>>>> hi
>>>>
>>>>> i think this is a pretty common problem
>>>>>
>>>>> anontations created by pdfbox get shown in acrobat reader
>>>>>
>>>>> but in some other reader? like chrome, osx viewer, skype preview and
>>>>> pdf.js? they do not get displayed
>>>>>
>>>>> i came across an issue thread in pdf.js which states:
>>>>>
>>>>> So PDF.js fallback to use base annotation implementation to render
>>>>> them,
>>>>> which means it is rendering those annotations use its AP field
>>>>> (appearance stream). Most of the PDF reader/editor generates this filed
>>>>> by
>>>>> default. That's why resave the file using some reader will fixes the
>>>>> file.
>>>>> However because this field is optional, some PDF tool (pdfbox) may
>>>>> generate
>>>>> the annotation without this field, then the fallback rendering no
>>>>> longer
>>>>> works.
>>>>>
>>>>> any idea what this field could be? so i can manually add it?
>>>>>
>>>>> please advise
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>>
>>>
>

Re: annotations not displayed in other viewers

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 15.08.2017 um 08:40 schrieb chitgoks:
> im coding my own appearance stream for each annotation instead. seems like
> there's no other way.
>
> i have a quick question. is there some sort of PDColor.NONE value
> equivalent?

No. Don't stroke. Or use an extgstate with a stroking alpha constant. 
(page 130 of the PDF 32000 specification)

|PDExtendedGraphicsStateextendedGraphicsState 
=newPDExtendedGraphicsState();extendedGraphicsState.setStrokingAlphaConstant((float)alpha);contents.saveGraphicsState();contents.setGraphicsStateParameters(extendedGraphicsState);// 
do your stuff contents.restoreGraphicsState();|


Alpha should be 0.

Tilman

>
> im using a PDPageContentStream and i wish to set the setStrokingColor to
> none.
>
> On Tue, Aug 15, 2017 at 2:26 PM, Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> Am 15.08.2017 um 06:03 schrieb chitgoks:
>>
>>> by the way
>>>
>>> came across a post that confirmed this a bug for pdfbox
>>>
>>> seems creating annotations, no appearance stream is included. that's why
>>> viewers dont show any annotations
>>>
>>> is this still a bug? or has this been fixed? if so, please advise how ?
>>>
>>> thank you very much
>>>
>> Yes this is a known missing feature and it has not been fixed. It is more
>> than just a field, it is a content stream, i.e. PDF operators with the
>> parameters. There was some work last year but only for some simple
>> annotations, not for the complex ones, this can be seen when building the
>> trunk (get it from svn) from source.
>>
>> You can see the differences by looking at the files (before and after
>> Adobe Reader) with PDFDebugger.
>>
>> Tilman
>>
>>
>>
>>> On Tue, Aug 15, 2017 at 11:43 AM, chitgoks <ch...@gmail.com> wrote:
>>>
>>> hi
>>>> i think this is a pretty common problem
>>>>
>>>> anontations created by pdfbox get shown in acrobat reader
>>>>
>>>> but in some other reader? like chrome, osx viewer, skype preview and
>>>> pdf.js? they do not get displayed
>>>>
>>>> i came across an issue thread in pdf.js which states:
>>>>
>>>> So PDF.js fallback to use base annotation implementation to render them,
>>>> which means it is rendering those annotations use its AP field
>>>> (appearance stream). Most of the PDF reader/editor generates this filed
>>>> by
>>>> default. That's why resave the file using some reader will fixes the
>>>> file.
>>>> However because this field is optional, some PDF tool (pdfbox) may
>>>> generate
>>>> the annotation without this field, then the fallback rendering no longer
>>>> works.
>>>>
>>>> any idea what this field could be? so i can manually add it?
>>>>
>>>> please advise
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>


Re: annotations not displayed in other viewers

Posted by chitgoks <ch...@gmail.com>.
im coding my own appearance stream for each annotation instead. seems like
there's no other way.

i have a quick question. is there some sort of PDColor.NONE value
equivalent?

im using a PDPageContentStream and i wish to set the setStrokingColor to
none.

On Tue, Aug 15, 2017 at 2:26 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> Am 15.08.2017 um 06:03 schrieb chitgoks:
>
>> by the way
>>
>> came across a post that confirmed this a bug for pdfbox
>>
>> seems creating annotations, no appearance stream is included. that's why
>> viewers dont show any annotations
>>
>> is this still a bug? or has this been fixed? if so, please advise how ?
>>
>> thank you very much
>>
>
> Yes this is a known missing feature and it has not been fixed. It is more
> than just a field, it is a content stream, i.e. PDF operators with the
> parameters. There was some work last year but only for some simple
> annotations, not for the complex ones, this can be seen when building the
> trunk (get it from svn) from source.
>
> You can see the differences by looking at the files (before and after
> Adobe Reader) with PDFDebugger.
>
> Tilman
>
>
>
>>
>> On Tue, Aug 15, 2017 at 11:43 AM, chitgoks <ch...@gmail.com> wrote:
>>
>> hi
>>>
>>> i think this is a pretty common problem
>>>
>>> anontations created by pdfbox get shown in acrobat reader
>>>
>>> but in some other reader? like chrome, osx viewer, skype preview and
>>> pdf.js? they do not get displayed
>>>
>>> i came across an issue thread in pdf.js which states:
>>>
>>> So PDF.js fallback to use base annotation implementation to render them,
>>> which means it is rendering those annotations use its AP field
>>> (appearance stream). Most of the PDF reader/editor generates this filed
>>> by
>>> default. That's why resave the file using some reader will fixes the
>>> file.
>>> However because this field is optional, some PDF tool (pdfbox) may
>>> generate
>>> the annotation without this field, then the fallback rendering no longer
>>> works.
>>>
>>> any idea what this field could be? so i can manually add it?
>>>
>>> please advise
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: annotations not displayed in other viewers

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 15.08.2017 um 06:03 schrieb chitgoks:
> by the way
>
> came across a post that confirmed this a bug for pdfbox
>
> seems creating annotations, no appearance stream is included. that's why
> viewers dont show any annotations
>
> is this still a bug? or has this been fixed? if so, please advise how ?
>
> thank you very much

Yes this is a known missing feature and it has not been fixed. It is 
more than just a field, it is a content stream, i.e. PDF operators with 
the parameters. There was some work last year but only for some simple 
annotations, not for the complex ones, this can be seen when building 
the trunk (get it from svn) from source.

You can see the differences by looking at the files (before and after 
Adobe Reader) with PDFDebugger.

Tilman


>
>
> On Tue, Aug 15, 2017 at 11:43 AM, chitgoks <ch...@gmail.com> wrote:
>
>> hi
>>
>> i think this is a pretty common problem
>>
>> anontations created by pdfbox get shown in acrobat reader
>>
>> but in some other reader? like chrome, osx viewer, skype preview and
>> pdf.js? they do not get displayed
>>
>> i came across an issue thread in pdf.js which states:
>>
>> So PDF.js fallback to use base annotation implementation to render them,
>> which means it is rendering those annotations use its AP field
>> (appearance stream). Most of the PDF reader/editor generates this filed by
>> default. That's why resave the file using some reader will fixes the file.
>> However because this field is optional, some PDF tool (pdfbox) may generate
>> the annotation without this field, then the fallback rendering no longer
>> works.
>>
>> any idea what this field could be? so i can manually add it?
>>
>> please advise
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: annotations not displayed in other viewers

Posted by chitgoks <ch...@gmail.com>.
by the way

came across a post that confirmed this a bug for pdfbox

seems creating annotations, no appearance stream is included. that's why
viewers dont show any annotations

is this still a bug? or has this been fixed? if so, please advise how ?

thank you very much


On Tue, Aug 15, 2017 at 11:43 AM, chitgoks <ch...@gmail.com> wrote:

> hi
>
> i think this is a pretty common problem
>
> anontations created by pdfbox get shown in acrobat reader
>
> but in some other reader? like chrome, osx viewer, skype preview and
> pdf.js? they do not get displayed
>
> i came across an issue thread in pdf.js which states:
>
> So PDF.js fallback to use base annotation implementation to render them,
> which means it is rendering those annotations use its AP field
> (appearance stream). Most of the PDF reader/editor generates this filed by
> default. That's why resave the file using some reader will fixes the file.
> However because this field is optional, some PDF tool (pdfbox) may generate
> the annotation without this field, then the fallback rendering no longer
> works.
>
> any idea what this field could be? so i can manually add it?
>
> please advise
>