1

I`m using pdfbox 1.8.9 for creating PDF . To add signature image i use PDPixelMap but i need to make signature larger or bolded . So far i tried to manipulate signature image (size) but didn't work. Here is my code example how i add signature(png or jpg file) to pdf:

BufferedImage signatureData;
signatureData = ImageIO.read(filename);
                signatureImage = new PDPixelMap(document, signatureData);
                contentStream.drawXObject(signatureImage, 600, 300, 100, 25);

Signature image size is w:965, h:625 bit dept:32 Here is example how it looks on pdf : signature inserted into pdf

  • 1
    Not sure what your problem is... why not use bigger values for the two last parameters? (Ideally, use w and h and divide them by a common scaling factor) – Tilman Hausherr Aug 03 '16 at 10:50
  • I can't use bigger w and h because signature is surrounded by other fields and this is the max space . I need to zoom in the signature image or something like that. – Владимир Гичев Aug 03 '16 at 11:59
  • 1
    Sounds like your question is something else. If this is a one time only thing, why not cut out the signature so that there is less blank space? Alternatively create an ARGB image and make all blank (or almost blank) pixels transparent, i.e. alpha value = 0. – Tilman Hausherr Aug 03 '16 at 12:03
  • Yes, this essentially is an image processing task: prepare the signature image so it can be added without covering anything else. – mkl Aug 03 '16 at 14:25

0 Answers0