[英]How can I draw rectangle with MatOfKeyPoint for Text Detection | Java
[英]How can I draw a rectangle into pdf file and fill it with text?
我最近開始從事一個簡單的Android項目,在該項目中,我必須從數據庫中收集一些數據並將其放入pdf文件中。
我想將這些數據放到一些矩形中,以獲得如下所示的內容:
我已經在這篇文章中閱讀了有關矩形的內容,並且我認為它也可以在Android中使用。 我唯一無法獲得的是如何將數據填充到矩形中。
請給我任何建議嗎?
先感謝您...
我在使用table並設置value的地方也有類似的代碼,它可能為您提供一些提示:
private static Font blackFont = new Font(Font.FontFamily.TIMES_ROMAN, 10, Font.BOLD);
private void createSeg_Table(Document document)throws DocumentException,IOException{
PdfPTable table = new PdfPTable(1);
table.setWidthPercentage(100);
try{
PdfPCell c1 = new PdfPCell(new Paragraph("text you want to show",blackFont));
c1.setVerticalAlignment(Element.ALIGN_LEFT);
c1.setBorder(Rectangle.BOX);
table.addCell(c1);
document.add(table);
}
catch(Exception ex){
System.out.println(ex);
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.