add close document
This commit is contained in:
parent
3a53c70960
commit
1dfbb2b630
@ -79,19 +79,26 @@ Public Class DocumentViewer
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
CloseDocument()
|
_logger.Info("Resetting Viewer.")
|
||||||
|
|
||||||
GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer
|
GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer
|
||||||
GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter
|
GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter
|
||||||
|
|
||||||
|
_logger.Info("Loading File.")
|
||||||
|
|
||||||
DoLoadFile(filepath)
|
DoLoadFile(filepath)
|
||||||
|
|
||||||
|
_logger.Info("Updating UI.")
|
||||||
|
|
||||||
statusLabel.Text = _docPath
|
statusLabel.Text = _docPath
|
||||||
|
|
||||||
UpdateMainUi()
|
UpdateMainUi()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Sub CloseDocument()
|
||||||
|
GdViewer.CloseDocument()
|
||||||
|
UpdateMainUi()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Public Sub DeleteTempFiles()
|
Public Sub DeleteTempFiles()
|
||||||
For Each oFile In _TempFiles
|
For Each oFile In _TempFiles
|
||||||
@ -129,6 +136,17 @@ Public Class DocumentViewer
|
|||||||
|
|
||||||
RichEditControl1.Visible = True
|
RichEditControl1.Visible = True
|
||||||
RichEditControl1.Dock = DockStyle.Fill
|
RichEditControl1.Dock = DockStyle.Fill
|
||||||
|
Case ".xls"
|
||||||
|
Using oConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter()
|
||||||
|
' Loading the source document.
|
||||||
|
oConverter.LoadFromFile(FilePath, GdPicture14.DocumentFormat.DocumentFormatXLSX)
|
||||||
|
' Saving as the PDF document.
|
||||||
|
oConverter.SaveAsPDF("output.pdf", PdfConformance.PDF1_5)
|
||||||
|
End Using
|
||||||
|
|
||||||
|
_docPath = "output.pdf"
|
||||||
|
|
||||||
|
GdViewer.DisplayFromFile(_docPath)
|
||||||
Case Else
|
Case Else
|
||||||
_docPath = FilePath
|
_docPath = FilePath
|
||||||
|
|
||||||
@ -142,12 +160,6 @@ Public Class DocumentViewer
|
|||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Sub CloseDocument()
|
|
||||||
GdViewer.CloseDocument()
|
|
||||||
UpdateMainUi()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub btnOpen_Click(sender As Object, e As EventArgs)
|
Private Sub btnOpen_Click(sender As Object, e As EventArgs)
|
||||||
CloseDocument()
|
CloseDocument()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user