【发布时间】:2011-11-03 16:58:24
【问题描述】:
我正在尝试创建一个格式化的 PdfPCell,其中我的文本位于左侧,图像(QRCode)“浮动”(在 css 意义上)到右侧。我当前的代码将图像向右移动,但文本在下一行与图像不同。
想法?
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);
【问题讨论】:
标签: java pdf-generation itext