i got it to work. my first mistake was that the subtype is Ink not InkList.

it shows the drawing now. however, the issue is that the points are
scattered and not interconnected. I expected pdfbox to link the points so
they would be displayed as one continuous drawing.

any idea on what might be lacking? perhaps a COSName?

mark

On Mon, Mar 6, 2017 at 4:04 PM, chitgoks <[email protected]> wrote:

> hi tilman
>
> thanks for the reply
>
> i tried this but nothing gets shown. i only get an icon with a question
> mark in it.
>
> looks like the only way is to draw it in the content stream
>
> Mark.
>
> On Mon, Mar 6, 2017 at 3:40 PM, Tilman Hausherr <[email protected]>
> wrote:
>
>> Am 06.03.2017 um 07:56 schrieb chitgoks:
>>
>>> hi.
>>>
>>> would like to ask if anyone has successfully created these types of
>>> annotation?
>>>
>>> please share your sample code.
>>>
>>> searching through google did not yield any results regarding sample code
>>> on
>>> PDAnnotationMarkup.
>>>
>>> so I pass this as the parameter of the constructor for a drawing
>>> annotation
>>>
>>> COSDictionary dict = new COSDictionary();
>>> dict.setItem(COSName.SUBTYPE, COSName.INKLIST);
>>>
>>> then im stuck because there is no method to set the points. please
>>> advise?
>>>
>>>
>> You can still use the COS methods, i.e. 
>> annotation.getCOSObject().setItem(COSName.INKLIST,
>> param);
>>
>> where param is an array of arrays.
>>
>> there's some code in an unrelated method:
>>
>>
>>     public final void setInkList(List<float[]> inklist)
>>     {
>>         COSArray newInklist = new COSArray();
>>         for (float[] array : inklist)
>>         {
>>             COSArray newArray = new COSArray();
>>             newArray.setFloatArray(array);
>>             newInklist.add(newArray);
>>         }
>>         annot.setItem(COSName.INKLIST, newInklist);
>>     }
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>

Reply via email to