public override void ViewDidAppear(bool animated)
 {
     PDFView.LoadRequest(new NSUrlRequest(NSUrl.FromFilename(PdfFileName)));
     this.NavigationController.SetToolbarHidden(false, true);
     this.NavigationController.SetToolbarItems(this.ToolbarItems, true);
     base.ViewDidAppear(animated);
 }
示例#2
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            string pdfFileName = (this.NavigationController as SigningNavigationController).Tabs._payment.pdfReceiptFileName;

            PDFView.LoadRequest(new NSUrlRequest(NSUrl.FromFilename(pdfFileName)));
        }
示例#3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            PDFView = FindViewById <PDFView> (Resource.Id.pdfView1);
        }
 private async void PDFView_InitializationCompletedHandlerAsync(PdfView sender, PSPDFKit.Pdf.Document document)
 {
     // If we already have a file to open lets proceed with that here.
     if (_fileToOpen != null)
     {
         await PDFView.OpenStorageFileAsync(_fileToOpen);
     }
     _pdfViewInitialised = true;
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.pdfView);
            resourcePdf = Intent.Extras.GetString("src");
            pdfView     = FindViewById <PDFView>(Resource.Id.pdfView);
            pdfView.FromAsset(resourcePdf).Load();
        }
示例#6
0
 private void LoadDocument()
 {
     PDFView.FromAsset(PDFPath)
     .DefaultPage(1)
     .OnPageChange(this)
     .EnableDoubletap(true)
     .EnableSwipe(true)
     .ShowMinimap(false)
     .Load();
 }
示例#7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Norton);
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            PdfNU = FindViewById <PDFView>(Resource.Id.PdfNU);
            PdfNU.FromAsset("Test.pdf").Load();
            SetActionBar(toolbar);
            ActionBar.Title = "សាកលវិទ្យាល័យន័រតុន";
        }
示例#8
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.softdevelope);
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            PdfSD = FindViewById <PDFView>(Resource.Id.PdfSD);
            PdfSD.FromAsset("Test.pdf").Load();
            SetActionBar(toolbar);
            ActionBar.Title = "អភិវឌ្ឈន៍កម្មវិធី";
        }
        public override void ViewDidAppear(bool animated)
        {
            hasBeenSigned = false;
            string pdfFileName = Tabs._prePlumbView.pdfPrePlumbingFileName;             // Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), pdfID+"_NotSigned.pdf");;

            PDFView.LoadRequest(new NSUrlRequest(NSUrl.FromFilename(pdfFileName)));

            Tabs.SigningNav.SetToolbarHidden(false, true);
            Tabs.SigningNav.SetToolbarItems(this.ToolbarItems, true);

            base.ViewDidAppear(animated);
        }
        protected override ViewEngineResult FindView(ControllerContext context)
        {
            ViewEngineResult result = base.FindView(context);

            if (result.View == null)
            {
                return(result);
            }
            PDFView view = new PDFView(result, DownloadFileName);

            return(new ViewEngineResult(view, view));
        }
示例#11
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.localDocuments_fragment, container, false);

            if (!string.IsNullOrEmpty(fileName))
            {
                pdfView = view.FindViewById <PDFView>(Resource.Id.pdfView);
                pdfView.FromAsset(fileName).DefaultPage(10).SwipeVertical(true).EnableDoubletap(true).Load();
            }

            return(view);
        }
        protected override void OnElementChanged(ElementChangedEventArgs <SamplePDFView> e)
        {
            var layout = Inflate(Context, Resource.Layout.PDFLayout, null);

            if (pdfView == null)
            {
                uiLayout = layout as Android.Widget.RelativeLayout;
            }

            pdfView = uiLayout.FindViewById <PDFView>(Resource.Id.pdfView);

            pdfView.FromAsset("sample.pdf").Load();

            SetNativeControl(uiLayout);
        }
示例#13
0
        public override void ViewDidAppear(bool animated)
        {
            hasBeenSigned = false;
            string pdfFileName = Tabs._jobService.pdfServiceReportFileName;             // Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), pdfID+"_NotSigned.pdf");

            try
            {
                PDFView.LoadRequest(new NSUrlRequest(NSUrl.FromFilename(pdfFileName)));
            }
            catch (Exception e) {
                this.Tabs._scView.Log(e.Message);
            }

            Tabs.SigningNav.SetToolbarHidden(false, true);
            Tabs.SigningNav.SetToolbarItems(this.ToolbarItems, true);

            base.ViewDidAppear(animated);
        }
        public void RedrawDailyStockPDF(bool DocumentSigned)
        {
            // render created preview in PDF context
            NSMutableData pdfData = new NSMutableData();

            UIGraphics.BeginPDFContext(pdfData, GeneratedPDFView.Bounds, null);
            UIGraphics.BeginPDFPage();
            GeneratedPDFView.Layer.RenderInContext(UIGraphics.GetCurrentContext());
            UIGraphics.EndPDFContent();

            // save the rendered context to disk
            NSError err;
            string  pdfID = String.Format("{0}_{1}_{2}_UsedStock", MyConstants.EmployeeID, MyConstants.EmployeeName, DateTime.Now.Date.ToString("yyyy-MM-dd"));
            string  pdfFileName;

            if (DocumentSigned)
            {
                pdfFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), pdfID + "_Signed.pdf");
            }
            else
            {
                pdfFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), pdfID + "_Not_Signed.pdf");
            }
            pdfData.Save(pdfFileName, true, out err);

            if (err != null)
            {
                err.Dispose(); err = null;
            }
            if (pdfData != null)
            {
                pdfData.Dispose(); pdfData = null;
            }

            // set up UIWebView in signature view controller
            this.PDFView.MultipleTouchEnabled = true;
            this.PDFView.ScalesPageToFit      = true;
            this.PdfFileName = pdfFileName;

            if (DocumentSigned)
            {
                PDFView.LoadRequest(new NSUrlRequest(NSUrl.FromFilename(PdfFileName)));
            }
        }
示例#15
0
        /// <summary>
        /// Take the file and call the conroller to open the document.
        /// </summary>
        /// <param name="file">File to open.</param>
        internal async Task OpenFileAsync(StorageFile file)
        {
            _fileToOpen = file;

            // If the PdfView is already initialised we can show the new document.
            if (_pdfViewInitialised)
            {
                try
                {
                    await PDFView.OpenStorageFileAsync(file);
                }
                catch (Exception e)
                {
                    // Show a dialog with the exception message.
                    var dialog = new MessageDialog(e.Message);
                    await dialog.ShowAsync();
                }
            }
        }
示例#16
0
        private async void Control_LoadCompleted(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            PDFView pdfView = Element as PDFView;

            if (string.IsNullOrEmpty(pdfView?.FileName))
            {
                return;
            }
            try
            {
                var Base64Data = await OpenAndConvert(pdfView?.FileName);

                var obj = await Control.InvokeScriptAsync("openPdfAsBase64", new[] { Base64Data });
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            pdfView = FindViewById <PDFView>(Resource.Id.pdfView);

            pdfView.SetBackgroundColor(Color.LightGray);
            if (uri != null)
            {
                DisplayFromUri(uri);
            }
            else
            {
                DisplayFromAsset(SAMPLE_FILE);
            }
            Title = pdfFileName;
        }
示例#18
0
 public void OnPDFPosChanged(PDFView.PDFPos p0)
 {
 }
示例#19
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            View view = inflater.Inflate(Resource.Layout.uiClassView, container, false);

            PDFView = view.FindViewById <PDFView>(Resource.Id.pdfView1);



            _btbSub1         = view.FindViewById <Button>(Resource.Id.btnSub1);
            _btbSub1.Click  += (o, e) => { Toast.MakeText(this.Context, _btbSub1.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub2         = view.FindViewById <Button>(Resource.Id.btnSub2);
            _btbSub2.Click  += (o, e) => { Toast.MakeText(this.Context, _btbSub2.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub3         = view.FindViewById <Button>(Resource.Id.btnSub3);
            _btbSub3.Click  += (o, e) => { Toast.MakeText(this.Context, _btbSub3.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub4         = view.FindViewById <Button>(Resource.Id.btnSub4);
            _btbSub4.Click  += (o, e) => { Toast.MakeText(this.Context, _btbSub4.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub5         = view.FindViewById <Button>(Resource.Id.btnSub5);
            _btbSub5.Click  += (o, e) => { Toast.MakeText(this.Context, _btbSub5.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub6         = view.FindViewById <Button>(Resource.Id.btnSub6);
            _btbSub6.Click  += (o, e) => { Toast.MakeText(this.Context, _btbSub6.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub7         = view.FindViewById <Button>(Resource.Id.btnSub7);
            _btbSub7.Click  += (o, e) => { Toast.MakeText(this.Context, _btbSub7.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub8         = view.FindViewById <Button>(Resource.Id.btnSub8);
            _btbSub8.Click  += (o, e) => { Toast.MakeText(this.Context, _btbSub8.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub9         = view.FindViewById <Button>(Resource.Id.btnSub9);
            _btbSub9.Click  += (o, e) => { Toast.MakeText(this.Context, _btbSub9.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub10        = view.FindViewById <Button>(Resource.Id.btnSub1);
            _btbSub10.Click += (o, e) => { Toast.MakeText(this.Context, _btbSub10.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub11        = view.FindViewById <Button>(Resource.Id.btnSub11);
            _btbSub11.Click += (o, e) => { Toast.MakeText(this.Context, _btbSub11.Text + "No implementation", ToastLength.Long).Show(); };
            _btbSub12        = view.FindViewById <Button>(Resource.Id.btnSub12);
            _btbSub12.Click += (o, e) => { Toast.MakeText(this.Context, _btbSub12.Text + "No implementation", ToastLength.Long).Show(); };


            _simpleCalendarView = view.FindViewById <CalendarView>(Resource.Id.simpleCalendarView); // get the reference of CalendarView
            _simpleCalendarView.FocusedMonthDateColor       = Android.Graphics.Color.Red;
            _simpleCalendarView.UnfocusedMonthDateColor     = Android.Graphics.Color.Blue;          // set the yellow color for the dates of an unfocused month
            _simpleCalendarView.SelectedWeekBackgroundColor = Android.Graphics.Color.Red;
            _simpleCalendarView.WeekSeparatorLineColor      = Android.Graphics.Color.Green;         // green color for the week separator line

            _btnBookView        = view.FindViewById <Button>(Resource.Id.btnBook);
            _btnBookView.Click += _btnBookView_Click;

            _btnBook2View = view.FindViewById <Button>(Resource.Id.btnBook2);

            _btnBook2View.Click += (o, e) =>
            {
                _dialog = new fragPDFViewer("CAPS_SAL_XITSONGA_FP.pdf");

                var trans = FragmentManager.BeginTransaction();
                _dialog.Show(trans, "book1");
            };
            _btnBook3View        = view.FindViewById <Button>(Resource.Id.btnBook3);
            _btnBook3View.Click += (o, e) =>
            {
                _dialog = new fragPDFViewer("CAPS_SAL_Akrikaans_FP.pdf");

                var trans = FragmentManager.BeginTransaction();
                _dialog.Show(trans, "book1");
            };

            _mainActivity = (MainActivity)this.Activity;


            _mainActivity.SetToolBarTitle("Grade 4.1 Asanda Mavuso");
            return(view);
        }
示例#20
0
        /// <summary>
        ///   Required method for Designer support - do not modify the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            var resources =
                new System.ComponentModel.ComponentResourceManager(typeof(PrintAllDialog));

            this.label1       = new System.Windows.Forms.Label();
            this.buttonCancel = new System.Windows.Forms.Button();
            this.panelBrowser = new System.Windows.Forms.Panel();
            this.webBrowser   = new Lib.Win.Web.ExtendedBrowserControl();
            this.panelImg     = new System.Windows.Forms.Panel();
            this.pdfEdit      = new PDFView();
            this.imgEdit      = new ImageShowControl();
            this.panelReport  = new System.Windows.Forms.Panel();
            this.labelNum     = new System.Windows.Forms.Label();
            this.label2       = new System.Windows.Forms.Label();
            this.panelBrowser.SuspendLayout();
            this.panelImg.SuspendLayout();
            this.panelReport.SuspendLayout();
            this.SuspendLayout();
            //
            // label1
            //
            resources.ApplyResources(this.label1, "label1");
            this.label1.Name = "label1";
            //
            // buttonCancel
            //
            resources.ApplyResources(this.buttonCancel, "buttonCancel");
            this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.buttonCancel.Name         = "buttonCancel";
            this.buttonCancel.Click       += new System.EventHandler(this.buttonCancel_Click);
            //
            // panelBrowser
            //
            resources.ApplyResources(this.panelBrowser, "panelBrowser");
            this.panelBrowser.Controls.Add(this.webBrowser);
            this.panelBrowser.Name = "panelBrowser";
            //
            // webBrowser
            //
            this.webBrowser.AllowWebBrowserDrop = false;
            resources.ApplyResources(this.webBrowser, "webBrowser");
            this.webBrowser.EnableInternalReloader         = false;
            this.webBrowser.IsWebBrowserContextMenuEnabled = false;
            this.webBrowser.Name         = "webBrowser";
            this.webBrowser.SelfNavigate = false;
            this.webBrowser.NeedEvent    = true;
            this.webBrowser.WebBrowserShortcutsEnabled = false;
            this.webBrowser.DocumentCompleted         += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.webBrowser_DocumentCompleted);
            this.webBrowser.PrintCompleted            += Browser_PrintCompleted;
            //
            // panelImg
            //
            resources.ApplyResources(this.panelImg, "panelImg");
            this.panelImg.Controls.Add(this.pdfEdit);
            this.panelImg.Controls.Add(this.imgEdit);
            this.panelImg.Name = "panelImg";
            //
            // pdfEdit
            //
            this.pdfEdit.CurrentStamp   = null;
            this.pdfEdit.CurrentStampID = 0;
            resources.ApplyResources(this.pdfEdit, "pdfEdit");
            this.pdfEdit.FileName        = "";
            this.pdfEdit.ForceReplicate  = false;
            this.pdfEdit.ImageID         = 0;
            this.pdfEdit.IsEditNotes     = false;
            this.pdfEdit.IsMoveImage     = false;
            this.pdfEdit.IsSelectionMode = false;
            this.pdfEdit.Name            = "pdfEdit";
            this.pdfEdit.NeedPreview     = false;
            this.pdfEdit.Orientation     = System.Windows.Forms.Orientation.Vertical;
            this.pdfEdit.Page            = 0;
            this.pdfEdit.ScrollPositionX = 0;
            this.pdfEdit.ScrollPositionY = 0;
            this.pdfEdit.SelectionMode   = false;
            this.pdfEdit.ShowThumbPanel  = false;
            this.pdfEdit.SplinterPlace   = 25;
            this.pdfEdit.UseLock         = false;
            //
            // imgEdit
            //
            this.imgEdit.AnnotationDraw = false;
            this.imgEdit.CurrentStamp   = null;
            this.imgEdit.CurrentStampID = 0;
            this.imgEdit.Cursor         = System.Windows.Forms.Cursors.Default;
            resources.ApplyResources(this.imgEdit, "imgEdit");
            this.imgEdit.DPI              = 96F;
            this.imgEdit.ForceReplicate   = false;
            this.imgEdit.Image            = null;
            this.imgEdit.ImageID          = 0;
            this.imgEdit.ImageResolutionX = 1;
            this.imgEdit.ImageResolutionY = 1;
            this.imgEdit.IsCorrectScaleDrawThumbnailPanel = true;
            this.imgEdit.IsEditNotes               = false;
            this.imgEdit.IsMoveImage               = true;
            this.imgEdit.IsSelectionMode           = false;
            this.imgEdit.IsVerifyFile              = true;
            this.imgEdit.Name                      = "imgEdit";
            this.imgEdit.Page                      = 0;
            this.imgEdit.SaveStampsInternal        = true;
            this.imgEdit.ScrollPositionX           = 0;
            this.imgEdit.ScrollPositionY           = 0;
            this.imgEdit.IsSelectionMode           = false;
            this.imgEdit.ShowThumbPanel            = false;
            this.imgEdit.SplinterPlace             = 140;
            this.imgEdit.ThumbnailPanelOrientation =
                Lib.Win.ImageControl.ImageControl.TypeThumbnailPanelOrientation.Left;
            this.imgEdit.TypeWorkThumbnailImagesPanel = 3;
            this.imgEdit.UseLock = false;
            this.imgEdit.Zoom    = 100;
            //
            // panelReport
            //
            resources.ApplyResources(this.panelReport, "panelReport");
            this.panelReport.Controls.Add(this.labelNum);
            this.panelReport.Controls.Add(this.label2);
            this.panelReport.Name = "panelReport";
            //
            // labelNum
            //
            resources.ApplyResources(this.labelNum, "labelNum");
            this.labelNum.Name = "labelNum";
            //
            // label2
            //
            resources.ApplyResources(this.label2, "label2");
            this.label2.Name = "label2";
            //
            // PrintAllDialog
            //
            resources.ApplyResources(this, "$this");
            this.CancelButton = this.buttonCancel;
            this.ControlBox   = false;
            this.Controls.Add(this.panelBrowser);
            this.Controls.Add(this.panelReport);
            this.Controls.Add(this.panelImg);
            this.Controls.Add(this.buttonCancel);
            this.Controls.Add(this.label1);
            this.DoubleBuffered = true;
            this.Name           = "PrintAllDialog";
            this.Closed        += new System.EventHandler(this.PrintAllDialog_Closed);
            this.Load          += new System.EventHandler(this.PrintAllDialog_Load);
            this.panelBrowser.ResumeLayout(false);
            this.panelImg.ResumeLayout(false);
            this.panelReport.ResumeLayout(false);
            this.ResumeLayout(false);
        }