Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Read pdf file from InputStream

More
9 years 11 months ago #10487 by half65
Hello,

How I can read pdf file from InputStream directly?
I tried to use my own wrapper that implements PDFStream but nothing.
By the way, InputStream from getAssets() working good. If I'm trying to use another streams -- still getting an error "Open Failed: Damaged or Invalid PDF file"

Please help me
More
9 years 11 months ago #10500 by Davide
Hi,
please check PDFSimple class from RDPDFReader module, go to Open method, here you will find an example of open file from InputStream.
Check PDFFileStream class.

You can also try with
Code:
m_doc.OpenMem(byte[] data, String password)
For more info check this : www.radaeepdf.com/documentation/javadocs...:A-java.lang.String-
More
9 years 11 months ago #10503 by half65
Hi,

I've checked code with PDFStream and PDFFileStream classes. I want to open file from InputStream directly (using ZipInputStream) but not from file/buffer. Also I think that we can use only "seekable' streams (with reset(), skip() and markSupported() flag).
More
9 years 11 months ago #10504 by Davide
Hi,
sorry but with our sdk you can open stream only using one of the methods I suggested you before.
More
9 years 11 months ago #10516 by nermeen
Hi,

What you need to do, is to create you own class that implements PDFStream in that class you can use your input stream..and pass your class to m_doc.OpenStream

What problems did you face while implementing this behavior?
More
9 years 11 months ago #10523 by half65
Hi,

Yes, As I wrote before, I've created my own class that implements PDFStream (similar to PDFAssetStream). And unfortunately my source stream can't support skip() and reset() methods -- they raises IOException. By the way, main task is opening PDF from InputStream from ZIP archive directly.

Tnahks.
Time to create page: 0.462 seconds
Powered by Kunena Forum