Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>We can do it using Qoppa PDF toolkit.</p> <p>Steps to follow to use Qoppa PDF toolkit.</p> <p>Download it from <a href="http://www.qoppa.com/android/pdfsdk/download" rel="nofollow">http://www.qoppa.com/android/pdfsdk/download</a></p> <p>This file contains four items:</p> <ol> <li>version_history.txt – This text file will be updated with each new version of the toolkit.</li> <li>qoppapdf.jar – This is the main jar file for the toolkit. This jar file needs to be added to the classpath for your project.</li> <li>assets folder – This folder contains assets used by the toolkit, such as fonts and icons. After extracting from the zip files, you will need to copy the files inside this folder to the assets folder in your project.</li> <li>libs folder – This folder contains native Android libraries, these libraries are needed to decode certain JPEG images as well as JPEG 2000 images that are not supported by Android. The contents of the libs folder need to be copied to the libs folder in your project. If you don’t have a libs folder in your project, create one and copy the contents of this folder into it.</li> </ol> <p>Code is:</p> <pre><code> //Converting PDF to Bitmap Image... StandardFontTF.mAssetMgr = getAssets(); //Load document to get the first page try { PDFDocument pdf = new PDFDocument("/sdcard/PDFFilename.pdf", null); PDFPage page = pdf.getPage(0); //creating Bitmap and canvas to draw the page into int width = (int)Math.ceil(page.getDisplayWidth()); int height = (int)Math.ceil(page.getDisplayHeight()); Bitmap bm = Bitmap.createBitmap(width, height, Config.ARGB_8888); Canvas c = new Canvas(bm); page.paintPage(c); //Saving the Bitmap OutputStream os = new FileOutputStream("/sdcard/GeneratedImageByQoppa.jpg"); bm.compress(CompressFormat.JPEG, 80, os); os.close(); } catch (PDFException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload