Exemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Global.Init(this);

            m_vPDF = new CustomPdfView(this);

            var doc = new Document();
            int ret = doc.Open("/mnt/extSdCard/test.pdf", null);

            switch (ret)
            {
                case -1://need input password
                    Finish();
                    break;
                case -2://unknown encryption
                    Finish();
                    break;
                case -3://damaged or invalid format
                    Finish();
                    break;
                case -10://access denied or invalid file path
                    Finish();
                    break;
                case 0://succeeded, and continue
                    break;
                default://unknown error
                    Finish();
                    break;
            }
            m_vPDF.Document = doc;
            SetContentView(m_vPDF);
        }
Exemplo n.º 2
0
 protected override void OnDestroy()
 {
     if (m_vPDF != null)
     {
         m_vPDF.Dispose();
         m_vPDF = null;
     }
     Global.RemoveTmp();
     base.OnDestroy();
 }