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

Does Radaee provide encription

More
IP: 192.168.0.71 11 years 3 months ago - 11 years 3 months ago #8047 by asliyanage
I tried with below
byte[] key = "MySecretKeyABCDE".getBytes()
stream.open(path,key);
Then it gives me below error .
The method open(AssetManager, String) in the type PDFAssetStream is not applicable for the arguments (String, byte[])

How to get the AssetManager value to this method ?
Last edit: 11 years 3 months ago by Docrishav.
More
IP: 192.168.0.71 11 years 3 months ago #8071 by asliyanage
Hi Radaee ,
Please tell me what is the AssetManager and how do i add this to encryption for pdf ?
More
IP: 192.168.0.71 11 years 3 months ago - 11 years 3 months ago #8073 by radaee
it is very simple:
//stream from AES
//private PDFAESStream stream = new PDFAESStream();

//stream from AES
//byte[] key = "MySecretKeyABCDE".getBytes();
//stream.open("/sdcard/ttt.pdf", key);
//stream.ImportFromFile("/sdcard/test.pdf");
//stream.ExportToFile("/sdcard/test1.pdf");
//stream.close();
//stream.open("/sdcard/EncryptedCatalog.pdf", key);
//stream.ExportToFile("/sdcard/decrypt.pdf");
Last edit: 11 years 3 months ago by .
More
IP: 192.168.0.71 11 years 3 months ago #8075 by asliyanage
Hi Radaee,

Can you explain what each of this line doing as i am confusing both open and ImportFromFile doing same thing?
below are the my imagination for each line.please explain

byte[] key = "MySecretKeyABCDE".getBytes(); = get byte array
//stream.open("/sdcard/ttt.pdf", key); = get the pdf file from sdcard
//stream.ImportFromFile("/sdcard/test.pdf"); = open pdf file from sdcard
//stream.ExportToFile("/sdcard/test1.pdf"); = save the encrypted pdf file
//stream.close(); = close the pdf file
//stream.open("/sdcard/EncryptedCatalog.pdf", key);
//stream.ExportToFile("/sdcard/decrypt.pdf");
More
IP: 192.168.0.71 11 years 3 months ago #8077 by radaee
byte[] key = "MySecretKeyABCDE".getBytes(); // get byte array as key to encryption
stream.open("/sdcard/ttt.pdf", key); //create PDF file as encrypted PDF file.
stream.ImportFromFile("/sdcard/test.pdf"); //load contents, and then encrypt it to ttt.pdf
stream.ExportToFile("/sdcard/test1.pdf"); //decrypt contents, and then export ro test1.pdf, so test1.pdf shall same to test.pdf, this step just for test purpose.
stream.close(); //flush ttt.pdf and close file.

//now open the encrypted PDF file:
byte[] key = "MySecretKeyABCDE".getBytes(); // get byte array as key to encryption
stream.open("/sdcard/ttt.pdf", key);
m_doc.OpenStream(stream);
//to do...
m_doc.Close();
More
IP: 192.168.0.71 11 years 3 months ago #8080 by asliyanage
1)byte[] key = "MySecretKeyABCDE".getBytes(); // get byte array as key to encryption
2)stream.open("/sdcard/ttt.pdf", key); //create PDF file as encrypted PDF file.
3)stream.ImportFromFile("/sdcard/test.pdf"); //load contents, and then encrypt it to ttt.pdf
4)stream.ExportToFile("/sdcard/test1.pdf"); //decrypt contents, and then export ro test1.pdf, so test1.pdf shall same to test.pdf, this step just for test purpose.
5)stream.close(); //flush ttt.pdf and close file

6)stream.open("/sdcard/ttt.pdf", key);
7)m_doc.OpenStream(stream);
8)m_doc.Close();

I tried with above then it gives me below error in 7th line.what is the Sting do i need to add here?


The method OpenStream(Document.PDFStream, String) in the type Document is not applicable for the arguments (PDFAESStream)
Time to create page: 0.400 seconds
Powered by Kunena Forum