2
我想創建一個格式化的PdfPCell,其中我的文本在左側,圖像(QRCode)「浮動」(在css意義上)向右。我目前的代碼將圖像移動到右側,但文本在下一行,與圖像不在同一行。如何「漂浮」一個單元格中的圖像 - iTextPDF
想法?
PdfPCell cell = new PdfPCell();
Paragraph p = new Paragraph();
p.add(new Paragraph("Ciao Baby",RESTNAME));
BarcodeQRCode qrcode = new BarcodeQRCode("http://www.tvfoodmaps.com", 72, 72, null);
Image img = qrcode.getImage();
img.scaleToFit(32,32);
img.setAlignment(Element.ALIGN_RIGHT);
cell.addElement(img);
cell.addElement(p);