Ejemplo n.º 1
0
        void SetupUserInterface()
        {
            mPdfViewCtrl = new pdftron.PDF.PDFViewCtrl();
            string path = System.IO.Path.Combine(Windows.ApplicationModel.Package.Current.InstalledLocation.Path, "sample.pdf");

            pdftron.PDF.PDFDoc doc = new pdftron.PDF.PDFDoc(path);
            mPdfViewCtrl.SetDoc(doc);
            mPdfViewCtrl.SetPagePresentationMode(pdftron.PDF.PDFViewCtrlPagePresentationMode.e_single_page);

            mToolManager = new pdftron.PDF.Tools.ToolManager(mPdfViewCtrl);
            mToolManager.EnablePopupMenuOnLongPress = true;
            mToolManager.IsPopupMenuEnabled         = true;
            mToolManager.PanToolTextSelectionMode   = pdftron.PDF.Tools.ToolManager.TextSelectionBehaviour.AlwaysPan;
            mToolManager.TextMarkupAdobeHack        = true;

            mAnnotationToolbar = new pdftron.PDF.Tools.Controls.AnnotationCommandBar(mToolManager);

            var stackPanel = new StackPanel();

            stackPanel.Children.Add(mAnnotationToolbar);
            stackPanel.Children.Add(mPdfViewCtrl);

            page         = new Page();
            page.Content = stackPanel;
        }
Ejemplo n.º 2
0
        private void SetupUserInterface()
        {
            IsChangesMade = false;
            mPdfViewCtrl  = new PDFViewCtrl();
            string path = Path.Combine(Windows.Storage.ApplicationData.Current.TemporaryFolder.Path, "sample.pdf");
            PDFDoc doc  = new PDFDoc(path);

            mPdfViewCtrl.SetDoc(doc);
            mPdfViewCtrl.SetPagePresentationMode(pdftron.PDF.PDFViewCtrlPagePresentationMode.e_single_page);

            mToolManager = new pdftron.PDF.Tools.ToolManager(mPdfViewCtrl);
            mToolManager.EnablePopupMenuOnLongPress = true;
            mToolManager.IsPopupMenuEnabled         = true;
            mToolManager.PanToolTextSelectionMode   = pdftron.PDF.Tools.ToolManager.TextSelectionBehaviour.AlwaysPan;
            mToolManager.TextMarkupAdobeHack        = true;

            mToolManager.AnnotationAdded           += MToolManager_AnnotationAdded;
            mToolManager.AnnotationEdited          += MToolManager_AnnotationEdited;
            mToolManager.AnnotationGroupAdded      += MToolManager_AnnotationGroupAdded;
            mToolManager.AnnotationGroupEdited     += MToolManager_AnnotationGroupEdited;
            mToolManager.AnnotationGroupPreEdited  += MToolManager_AnnotationGroupPreEdited;
            mToolManager.AnnotationGroupPreRemoved += MToolManager_AnnotationGroupPreRemoved;
            mToolManager.AnnotationGroupRemoved    += MToolManager_AnnotationGroupRemoved;
            mToolManager.AnnotationPreRemoved      += MToolManager_AnnotationPreRemoved;
            mToolManager.AnnotationRemoved         += MToolManager_AnnotationRemoved;

            mAnnotationToolbar = new pdftron.PDF.Tools.Controls.AnnotationCommandBar(mToolManager);

            var stackPanel           = new StackPanel();
            var horizontalStackPanel = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            closeButton = new Button()
            {
                Content = "Close"
            };

            resavePageButton = new Button()
            {
                Content = "Resave first page"
            };

            addNewPageButton = new Button()
            {
                Content = "New Page"
            };

            horizontalStackPanel.Children.Add(closeButton);
            horizontalStackPanel.Children.Add(resavePageButton);
            horizontalStackPanel.Children.Add(addNewPageButton);

            stackPanel.Children.Add(horizontalStackPanel);
            stackPanel.Children.Add(mAnnotationToolbar);
            stackPanel.Children.Add(mPdfViewCtrl);
            closeButton.Click      += CloseButton_Click;
            resavePageButton.Click += resavePageButton_Click;
            addNewPageButton.Click += AddNewPageButton_Click;

            page         = new Windows.UI.Xaml.Controls.Page();
            page.Content = stackPanel;
        }