示例#1
0
 /// <summary>
 /// Auto ZoomIN
 /// </summary>
 public void ZoomIn()
 {
     CheckStatus();
     _pdfDoc.ZoomOut();
     _pdfDoc.RenderPage(Handle);
     Invalidate();
 }
示例#2
0
        /// <summary>
        /// Load PDF from file
        /// </summary>
        /// <param name="sFile">File path</param>
        public void LoadPDF(string sFile)
        {
            if (_pdfDoc != null)
            {
                _pdfDoc.Dispose();
                _pdfDoc = null;
            }

            _pdfDoc = new PDFWrapper();
            _pdfDoc.RenderNotifyFinished += new RenderNotifyFinishedHandler(_pdfDoc_RenderNotifyFinished);
            _pdfDoc.PDFLoadCompeted      += new PDFLoadCompletedHandler(_pdfDoc_PDFLoadCompeted);
            _pdfDoc.PDFLoadBegin         += new PDFLoadBeginHandler(_pdfDoc_PDFLoadBegin);

            if (LoadFile(sFile, _pdfDoc))
            {
                FileLoaded(this, new EventArgs());

                _pdfDoc.CurrentPage = 1;
                _pdfDoc.FitToWidth(Handle);
                _pdfDoc.RenderPage(Handle);

                PageSize = new Size(_pdfDoc.PageWidth, _pdfDoc.PageHeight);

                FileRendered(this, new EventArgs());
            }
        }
示例#3
0
        /// <summary>
        /// Load PDF from file
        /// </summary>
        /// <param name="sFile">File path</param>
        public void LoadPDF(string sFile)
        {
            if (_pdfDoc != null)
            {
                _pdfDoc.Dispose();
                _pdfDoc = null;
            }

            _pdfDoc = new PDFWrapper();
            _pdfDoc.RenderNotifyFinished += new RenderNotifyFinishedHandler(_pdfDoc_RenderNotifyFinished);
            _pdfDoc.PDFLoadCompeted += new PDFLoadCompletedHandler(_pdfDoc_PDFLoadCompeted);
            _pdfDoc.PDFLoadBegin += new PDFLoadBeginHandler(_pdfDoc_PDFLoadBegin);
            
            if (LoadFile(sFile, _pdfDoc))
            {
                
                FileLoaded(this,new EventArgs());
                
                _pdfDoc.CurrentPage = 1;
                _pdfDoc.FitToWidth(Handle);
                _pdfDoc.RenderPage(Handle);

                PageSize = new Size(_pdfDoc.PageWidth, _pdfDoc.PageHeight);

                FileRendered(this, new EventArgs());
            }

        }