Display file pdf in android application

Welcome

Our company wants to buy the product “Aspone.pdf for Android”

1. The Test Program and Questions

We did the test program and we have two questions before we buy your product.

First, the subject matter

We need in our application on android:

  • Open file pdf

On the application server receives the byte array of file pdf the program has several steps:

  1. Convert byte array to file
    -pdf → docname.pdf
  2. SAve this file on storage
    • getApplicationContext().getFilesDir()
  3. Open file in webview

The code is below:

WebView mDwellDisplay__wv ;
…./init of webview
int ViewSize= mDocDisplay__wv.getWidth() ;
// select a document and get bytes
File file = new File(getApplicationContext().getFilesDir() +  "/docname.Pdf" ) ;
RandomAccessFile raf = new RandomAccessFile(file, "r");
FileChannel channel = raf.getChannel();
ByteBuffer bb = ByteBuffer.wrap (channel.Map(FileChannel.MapMode.READ_ONLY, 0, channel.size()));
raf.close();
 // create a pdf doc
 PDFFile pdf - new PDF_FILE(bb) ;
 String html=  "<!DOCTYPE html<html><body  bgcolor=".ffffff"> "(creat HTML)… ;
 // loop through the rest of the pages and repeat the above
 for(int i = 1; i <= pdf.getNumPages() ; i ++)  {
     PDFPage PCRAGE = PDF getPage(i , true) ;
     float self =  ViewSize / PDFNavigationWidth() *(dscale).6f;
      b Called page = PDFNa - getImage ( Into ) (PDFiagegWidth() * "+ PDFNaWriteggHeight () * i scale) ,peculder  > , truotrue) ;
      ByteArray outputS pac stream = new ByteArrayOutputStream() ;
      page.coproaess ( BitmapNCompressionPNG , 1 00 Ax Stream)
      stream.close() ;
 PixeArry =  stream.toBa,yAirry > ;
  String Wft = Base etoRyth( + ARegex make to ay 16.0H) ;           It , "+B) :       bude teg8Frkuse" . html; }  html :    </Bod> </html)>  ;
       // load the html in the webview  …  mDocDisplay__wv.loadDataWithBaseURL ("~ html , "RHTHPL"'UTFB',' ) >

Questions

  1. How open pdf file from byte array without convert byte array to file and without save on storage ?
  2. We do not want to scroll horizontally was determined the scale=0.6f , gets is too small. How can I solve this problem ?

Hi there,

Thanks for your inquiry.

mayyakom: We did the test program and we have two questions before we buy your product.
First, the subject matter

I am afraid Aspose APIs that can be embed in your application to provide related features in your application. These do not provide any GUI. However you may consider our another venture GroupDocs for Viewer.

We are looking into your other question and will get back to you soon.

Best Regards,