Hello everyone !

A 'visible signature' question (iText Java) :
When I use a 500*300 pixels image as signature graphic for a 270*30 points
signature rectangle, the graphic part of the visible signature is not
rendered as expected (by me at least :) ). The image is stuck to the
bottommost/rightmost half of its rectangle instead of being at its center
with balanced margins. Looks like the left margin is too big, and the bottom
margin has disappeared.

In PdfSignatureAppearance's source code, I see :
                // must calculate the point to draw from to make image
appear in middle of column
                float x = 0;
                // experimentation found this magic number to counteract
Adobe's signature graphic, which
                // offsets the y co-ordinate by 15 units
                float y = -im.getScaledHeight() + 15;

                x = x + (signatureRect.getWidth() - im.getScaledWidth()) /
2;
                y = y - (signatureRect.getHeight() - im.getScaledHeight()) /
2;
                p.add(new Chunk(im, x + (signatureRect.getWidth() -
im.getScaledWidth()) / 2, y, false));

Couldn't the duplicate "x + (signatureRect.getWidth() - im.getScaledWidth())
/ 2" explain the problem on the left margin ?
Also, could anyone explain what is attempted with the "-im.getScaledHeight()
+ 15" offset ?

Thx

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/margins-for-the-graphic-part-of-a-signature-with-SignatureRenderGraphicAndDescription-rendering-mode-tp3461128p3461128.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to