itextg

Adding itextg to gradle

只谈情不闲聊 提交于 2019-12-24 13:25:45
问题 I want to add itextg via gradle to avoid having to maintain a set of library jars. Maybe it's me but I can't find the correct gradle compile statement anywhere. dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:20.0.0' compile 'com.google.code.gson:gson:2.3.1' compile 'com.itextg:itextg:5.4.3' } Regular itext works just fine but I'm trying to do stuff with images. compile 'com.itextpdf:itextpdf-5.5.6' 回答1: I think that's because we

Add an image to iText pdf in Android

爱⌒轻易说出口 提交于 2019-12-23 18:28:01
问题 I have an String containing images like "My string [img src=image_from_drawable/] blablabla". I'm able to parse this string as Spannable to show that drawable on my TextView, with the following code: static public Spannable formatAbility(String _ability) { Spannable spannable = spannableFactory.newSpannable(_ability); addImages(mContext, spannable); return spannable; } private static boolean addImages(Context context, Spannable spannable) { Pattern refImg = Pattern .compile("\\Q[img src=\\E(

iTextG causing application crash(Android)

↘锁芯ラ 提交于 2019-12-11 17:28:19
问题 My objective is to superimpose contents of a pdf onto another PDF. this is the code that I have used: AssetManager assetManager = getAssets(); InputStream istr = null; PdfReader reader = null; String str = null; int n = 0; try { istr =(InputStream) assetManager.open("Chemistry.pdf"); reader=new PdfReader(istr); Document document = new Document(); PdfWriter writer= PdfWriter.getInstance(document, new FileOutputStream(Environment.getExternalStorageDirectory()+ "/newhelloPrayToGod.pdf"));

Including iTextG in an Android Project using Android Studio

人盡茶涼 提交于 2019-12-02 22:34:41
问题 I'm getting the following error when including iTextG in Android Studio, com.android.dex.DexException: Multiple dex files define Lcom/itextpdf/awt/geom/AffineTransform; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171) at com.android.dx.merge.DexMerger.merge(DexMerger