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 6 months ago #7353 by asliyanage
I need to know does radaee library provide encryption facility for pdf ?
More
IP: 192.168.0.156 11 years 6 months ago #7357 by Davide
Yes,

there are simple codes in PDFTestAct.

Code:
//byte key[] = new byte[16]; //stream.open("/sdcard/ttt.pdf", key);//pdf file to encrypt. //stream.ImportFromFile("/sdcard/test.pdf");//import test.pdf and encrypt to ttt.pdf //stream.ExportToFile("/sdcard/test1.pdf");//decrypt to test1.pdf //stream.close();
More
IP: 192.168.0.71 11 years 4 months ago #7906 by asliyanage
can you please tell me what is stream and what is the need for byte array?

I have a pdf file in sdcard/pdf/abc.pdf .I need to encrypt the abc.pdf file.could you please tell me the way to do this ?
More
IP: 192.168.0.71 11 years 4 months ago - 11 years 4 months ago #7916 by radaee
2 level encryptin supported.
1. PDF standard encryption, see Doument.EncryptAs()
2. APP level encryption, which Davide memtioned.
//byte key[] = new byte[16];
//stream.open("/sdcard/ttt.pdf", key);//pdf file to encrypt.
//stream.ImportFromFile("/sdcard/test.pdf");//import test.pdf and encrypt to ttt.pdf
//stream.ExportToFile("/sdcard/test1.pdf");//decrypt to test1.pdf
//stream.close();
the key must be 16 bytes long, can be any values to set, which both used to encryption and dcryption.
in sample, key not set any value, so java init as all 0.
Last edit: 11 years 4 months ago by .
More
IP: 192.168.0.71 11 years 4 months ago #8008 by asliyanage
I used below code to open the pdf file.Please tell me the way to encrypt this pdf file.path has the pdf file path.


m_doc.Close();
int ret = m_doc.Open(path, null);
if (ret == 0) {

m_reader.setVisibility(View.VISIBLE);
m_reader.PDFOpen(m_doc, false, this);
m_reader.PDFOpen(m_doc, false, this);


mContentView.removeAllViews();
mContentView.addView(m_layout);

}
More
IP: 192.168.0.71 11 years 4 months ago - 11 years 4 months ago #8011 by radaee
first you can use this to encrypt PDF file:
byte file_id[] = new byte[16];
//set any bytes to file_id.
int ret = m_doc.Open("sdcard/pdf1.pdf", null);
m_doc.EncryptAs( "sdcard/pdf2.pdf", "owner password", "user password", -1, 0, file_id );
m_doc.Close();
now it saved to pdf2.pdf, and then open pdf2.pdf
int ret = m_doc.Open("sdcard/pdf2.pdf", "user password");//do not forgot password, that passed to EncryptAs
//to do ...
m_doc.Close();
NOTICE:this need premium license.
Last edit: 11 years 4 months ago by .
Time to create page: 0.447 seconds
Powered by Kunena Forum