Am 14.01.2018 um 13:51 schrieb chitgoks:
hi tilman
yeah  but try to move or resize the annotation and its rectangle becomes inverted

Oops, yes, indeed :-(

I set /Rotate 270 on the page of AnnotationSample.Standard.pdf and then tried to move the custom stamps and no problem. So how about a totally different strategy:

     rotate the image not in the form matrix, but either when creating the image, or within the content stream. This way Adobe won't notice it.

So you'd have to rotate it 90° and then translate height and weight to move it back at the correct place.

Btw PDPageContentStream does support PDAppearanceStream (see the signature code) so you're making your life difficult by using the raw commands.

Tilman




mark

On Sun, 14 Jan 2018 at 8:48 PM Tilman Hausherr <[email protected] <mailto:[email protected]>> wrote:

    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<[email protected]> 
<mailto:[email protected]>
    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:[email protected]
    <mailto:[email protected]>
    For additional commands, e-mail:[email protected] 
<mailto:[email protected]>




Reply via email to