/// <summary> /// Auto ZoomIN /// </summary> public void ZoomIn() { CheckStatus(); _pdfDoc.ZoomOut(); _pdfDoc.RenderPage(Handle); Invalidate(); }
/// <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()); } }
/// <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()); } }