I am using Qoppa pdf Toolkit for android tablet application to convert images to pdf document. I want to convert this without connecting to network i.e. offline. Is there any possibility to convert images to pdf document offline?
Asked
Active
Viewed 155 times
2 Answers
0
Qoppa qPDF Toolkit runs on the device itself. It does not need to contact any server and thus does not require internet connection.
Here is sample code to extract the image of the first page of a PDF document:
//this static allows the sdk to access font assets,
//it must be set prior to utilizing libraries
StandardFontTF.mAssetMgr = getAssets();
// Load a PDF document and get the first page
PDFDocument pdf = new PDFDocument("/sdcard/input.pdf", null);
PDFPage page = pdf.getPage(0);
// Render the page at a default 72DPI
Bitmap bm= page.getBitmap();
// Save the bitmap
OutputStream outStream = new FileOutputStream("/sdcard/output.jpg");
bm.compress(CompressFormat.JPEG, 80, outStream);
outStream.close();

Tunaki
- 132,869
- 46
- 340
- 423

Leila Holmann
- 96
- 6