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: stamp annotation in pdf page 270 degree rotation incorrectly disdplayed
Date Sun, 14 Jan 2018 12:48:14 GMT
I played around a bit more... just reactivating
form.setMatrix(AffineTransform.getRotateInstance(Math.toRadians(270)));
and not setting the /Rotate entry in the annotation shows correct 
boundaries.



Tilman

Am 14.01.2018 um 13:06 schrieb chitgoks:
> i see
>
> i did try that before but did not notice the handle. you are right, the
> handle is now placed on top.
>
> when i tried that, i was so focused on the resulting rectangle when this
> property was added to dictionary because the rectangle became vertical,
> although calling form.setMatrix() to rotate it displayed it right, and
> resizing and moving did not change its orientation but its rectangle got
> inverted.
>
> mark
>
> On Sun, Jan 14, 2018 at 7:56 PM, Tilman Hausherr <THausherr@t-online.de>
> wrote:
>
>> I looked at the file AnnotationSample.Standard.pdf (google for it) and it
>> has many stamps... They do also have the problem with the "X" except on
>> standard stamps.
>>
>> I saw a "Rotate" entry in the dictionaries. Changing it changes the
>> handle. This must be something non standard, i.e. for Adobe only.
>>
>> stampAnnot.getCOSObject().setItem(COSName.ROTATE, COSInteger.get(270));
>>
>> Tilman
>>
>> Am 14.01.2018 um 02:52 schrieb chitgoks:
>>
>>> hi. i have a question on stamps getting displayed in a pdf page that is of
>>> 270 degree rotation
>>>
>>> i use batik to convert svg to a BufferedImage object
>>>
>>> please see source files
>>>
>>> svg file  -
>>> https://drive.google.com/open?id=16WmOTp-9ReIhmsld7kU5N5VUevPF7duP
>>> java file -
>>> https://drive.google.com/open?id=12TUQIgx5eGy4JGuwCVeizEEH8lWXPHTZ
>>> src pdf - https://drive.google.com/open?id=19dBD31kGDGpLOGS8zVwyIH1wkM
>>> 7nkTXN
>>>
>>> i copied the sample source code for rubber stamp appearance stream. i use
>>>
>>> form.setMatrix(AffineTransform.getRotateInstance(Math.toRadi
>>> ans(pageRotation)));
>>>
>>> to rotate the image 270 degrees and it displays right. however, when i
>>> resize, it rotates back to 90/180(not sure what degree this is) degrees
>>> and
>>> the bounding box becomes a vertical rectangle instead of a horizontal
>>> rectangle.
>>>
>>> also, the rotation handle is on the left side in acrobat instead of it
>>> being at the top (though, in itext code resizing and moving the stamp
>>> annotation will not change it orientation and size, using an
>>> ImageTemplate,
>>> but rotation handle is also on the left side), though this part is not
>>> important. i am more concerned on when the annotation gets moved or
>>> resized, and its orientation and size gets swapped instead of preserving
>>> it.
>>>
>>> maybe in pdfbox, the issue of my code is somewhere in the form object?
>>>
>>> if anyone has time to check the source code, thank you.
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>


Mime
View raw message