Как отобразить изображение и текст рядом друг с другом Itext
Привет, я пытаюсь создать счет, где логотип компании и адрес отображаются рядом друг с другом. Логотип компании отображается слева, а текст под ним. Я пытался отобразить текст рядом с логотипом в направлении справа, но он не пришел. Пожалуйста, помогите.
public class Test {
/** Path to the resulting PDF */
public static final String RESULT = "C:/ex/test.pdf";
/**
* Main method.
* @param args no arguments needed
* @throws DocumentException
* @throws IOException
*/
public static void main(String[] args) throws IOException, DocumentException {
new ComCrunchifyTutorials().createPdf(RESULT);
}
/**
* Creates a PDF with information about the movies
* @param filename the name of the PDF file that will be created.
* @throws DocumentException
* @throws IOException
*/
public void createPdf(String filename)
throws IOException, DocumentException {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream(filename));
document.open();
Image image = Image.getInstance("C:/Users/user/Desktop/New folder (3)/shoes/shoes/web/images/abc.jpg");
image.scaleAbsolute(150f, 50f);//image width,height
Paragraph p = new Paragraph();
Phrase pp = new Phrase(200);
p.add(new Chunk(image, 0, 0));
pp.add(" a text after the image.");
p.add(pp);
document.add(p);
document.close();
}
}