pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: annotations not displayed in other viewers
Date Tue, 15 Aug 2017 06:59:23 GMT
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 <THausherr@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 <chitgoks@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
>>
>>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message