Skip to content

alaeddinejebali/Android-ConvertToPDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

Using iText

To use the library.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Using Aspose

  • The project is "/ConvertToPdf-Aspose/"
  • Download Aspose zip from http://www.aspose.com/community/files/74/android-components/aspose.pdf-for-android/default.aspx
  • When you extract it you'll find:
  • Add "aspose-words-x.xx-android-jdkxx.jar" to your "lib" folder (with Android-Studio, you may need to right-click the "lib/aspose-words-x.xx-android-jdkxx.jar" -> "Add as Library...")
  • Add "aw-classes_dex2jar.jar" to your "lib" folder (with Android-Studio, you may need to right-click the "lib/aw-classes_dex2jar.jar" -> "Add as Library...")
  • Add permission and MultiDex to your AndroidManifest
<application android:name="android.support.multidex.MultiDexApplication"
(...)
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  • Add those lines to your "app/build.gradle"
	(...)
	
    defaultConfig {
        multiDexEnabled true
    }
	
	(...)
    
	dexOptions {
        javaMaxHeapSize "4g"
    }
	
	(...)
	
	dependencies {
		provided files('libs/aw-classes_dex2jar.jar')
		compile 'com.google.code.gson:gson:2.3'
		compile 'com.android.support:multidex:1.0.0'
	}	
	
  • Copy/paste "resources" folder to "/main/assets/"

  • Convert your files

    try{
        Document document = new Document(filePath);
        document.save(outputPath);
    } catch (Exception e) {
        e.printStackTrace();
    }

About

How to convert a document to a PDF using iText and Aspose?

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages