0

Is it possible to set down an image into paragraph, something like that :

image.setBotom(-2)

??

I have the following code and my image is on the same position that "My text" and "abcd", and I want set down for 2px.

Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("C://myPDF.pdf"));
document.open ();
Paragraph p = new Paragraph();
Image image = Image.getInstance("C://myJPG.JPG");
Chunk ch = new Chunk(image, 0, 0, true);
p.add("My text");
p.add(ch);
p.add(new Chunk(" abcd "));
document.add(p);
document.close();
2

1 Answer 1

1

I resolved it :

float offsetY = -4;
Chunk ch = new Chunk(image1, 0, offsetY, true);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.