Search code examples
itext

Question with display graphic and description from signature using itext v5.6.xx


I'm learning digital signature from this book, it's very helpful. When I read the "Custom rendering mode" section, I see this one:

RenderingMode.GRAPHIC_AND_DESCRIPTION—this will split the signature field in two and add an image on one side, the description on the other side.

I have tried and found the result is to divide 2 parts by left and right, I'm wondering if there's a way to make it 2 parts according to top and bottom?


Solution

  • According to the source code of the iText PdfSignatureAppearance class, iText decides whether to split left/right or top/bottom based on the height and width of the appearance rectangle: If it is strictly higher than it is wide, the area is split top/bottom. Otherwise it's split left/right.