3

DroidText次のコードを使用してPDFに画像を追加する方法-

Document document = new Document();
File f=new File(Environment.getExternalStorageDirectory(), "SimpleImages.pdf");
PdfWriter.getInstance(document,new FileOutputStream(f));
document.open();
document.add(new Paragraph("Simple Image"));

Image image =Image.getInstance("file:///mnt/sdcard/img.png");
document.add(image);
document.close();
4

2 に答える 2

2

解決しました...

Image image =Image.getInstance("sdcard/img.png");
于 2012-08-21T11:33:01.720 に答える
0

あなたはこのようにそれを行うことができます.それは働いています

画像 image = Image.getInstance ("file:///mnt/sdcard/Wallpapers/i_love_you.jpg"); document.add(画像);

于 2013-03-05T17:23:19.157 に答える