Exemplo n.º 1
0
        public void ShowReader()
        {
            //Plugin init
            plugin = RadaeePDFPlugin.PluginInit;

            //Activate license
            plugin.ActivateLicenseWithBundleId("com.radaee.pdf.PDFViewer", "Radaee", "*****@*****.**", "89WG9I-HCL62K-H3CRUZ-WAJQ9H-FADG6Z-XEBCAO", 2);

            //Thumbnail settings
            plugin.SetThumbnailBGColor(Convert.ToInt32("0x88000000", 16)); //AARRGGBB
            plugin.SetThumbHeight(100);

            // Global properties (render mode, markup colors...)
            // Info: global.g_ink_color replaced "setColor forFeature"

            /*
             * 0: Vertical
             * 1: Horizontal LTOR
             * 2: Horizontal RTOL
             * 3: Single Page (LTOR, paging enabled)
             * 4: Double Page (LTOR, paging enabled)
             */

            RDVGlobal.SharedInstance.G_render_mode = 3; // Set render mode

            //Open from assets
            UIViewController controller = (UIKit.UIViewController)plugin.Show("file://help.pdf", "");

            //Set Callback for RadaeeDelegate
            selector = new RadaeeDelegate(plugin);
            plugin.SetDelegate(selector);

            this.NavigationController.NavigationBar.BarTintColor = UIColor.Black;
            this.NavigationController.NavigationBar.TintColor    = UIColor.Orange;

            if (controller != null)
            {
                //Show reader
                this.NavigationController.PushViewController(controller, true);
            }
            else
            {
                UIAlertView alert = new UIAlertView();
                alert.Title   = "Error";
                alert.Message = "PDF not found";
                alert.AddButton("OK");
                alert.Show();
            }
        }
Exemplo n.º 2
0
        partial void OpenBtn_TouchUpInside(UIButton sender)
        {
            //Reader settings init
            plugin = RadaeePDFPlugin.PluginInit;

            //Activate license
            plugin.ActivateLicenseWithBundleId("com.radaee.pdf.PDFViewer", "Radaee", "*****@*****.**", "89WG9I-HCL62K-H3CRUZ-WAJQ9H-FADG6Z-XEBCAO", 2);

            //General settings

            //render type

            /*
             *
             * 0: Vertical
             * 1: Horizontal continous (LRM)
             * 2: Horizontal continous (RTL)
             * 3: Horizontal mixed (LRM): paging and doublePage feature are availble only in this mode
             *
             */
            plugin.SetReaderViewMode(4);             //Set Reader Mode
            plugin.SetPagingEnabled(true);           //paging
            plugin.SetDoublePageEnabled(true);       //double page render
            plugin.ToggleThumbSeekBar(0);            //Toggle Thumbnail/SeekBar

            //plugin.SearchImage = UIImage.FromBundle("btn_add.png");

            //Set thumbnail view background
            plugin.SetThumbnailBGColor(Convert.ToInt32("0x88000000", 16));             //AARRGGBB

            //Set reader background
            //plugin.SetReaderBGColor(Convert.ToInt32("0xFFFF0000", 16)); //AARRGGBB

            //Set thumbnail view height
            plugin.SetThumbHeight(100);

            //In double page mode, show the first page as single page
            plugin.SetFirstPageCover(true);

            //Set immersive mode
            //plugin.SetImmersive(true);

            /*
             * SetColor, Available features
             *
             * 0: inkColor
             * 1: rectColor
             * 2: underlineColor
             * 3: strikeoutColor
             * 4: highlightColor
             * 5: ovalColor
             * 6: selColor
             */

            //plugin.SetColor(Convert.ToInt32("0xFF00FF00", 16), 0); //Set Ink Annotation color to green (ARGB)

            //Open from url
            UIViewController controller = plugin.Show("file://help.pdf", "");

            //Set Callback for RadaeeDelegate
            selector = new RadaeeDelegate(plugin);
            plugin.SetDelegate(selector);

            this.NavigationController.NavigationBar.BarTintColor = UIColor.Black;
            this.NavigationController.NavigationBar.TintColor    = UIColor.Orange;

            //UIViewController controller = plugin.OpenFromAssets("test.pdf", "");

            //Create image of a specific page (needs a valid pdf opened instance)

            /*
             * //Create data of the image
             * NSData pageData = plugin.GetImageForPage(0);
             *
             * //Create the UIImage from NData
             * UIImage image = new UIImage(pageData);
             */

            if (controller != null)
            {
                //show reader
                this.NavigationController.PushViewController(controller, true);
            }
            else
            {
                UIAlertView alert = new UIAlertView();
                alert.Title   = "Error";
                alert.Message = "PDF not found";
                alert.AddButton("OK");
                alert.Show();
            }
        }