add close document
This commit is contained in:
parent
3a53c70960
commit
1dfbb2b630
@ -79,19 +79,26 @@ Public Class DocumentViewer
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
CloseDocument()
|
||||
_logger.Info("Resetting Viewer.")
|
||||
|
||||
GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer
|
||||
GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter
|
||||
|
||||
_logger.Info("Loading File.")
|
||||
|
||||
DoLoadFile(filepath)
|
||||
|
||||
_logger.Info("Updating UI.")
|
||||
|
||||
statusLabel.Text = _docPath
|
||||
|
||||
UpdateMainUi()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub CloseDocument()
|
||||
GdViewer.CloseDocument()
|
||||
UpdateMainUi()
|
||||
End Sub
|
||||
|
||||
Public Sub DeleteTempFiles()
|
||||
For Each oFile In _TempFiles
|
||||
@ -129,6 +136,17 @@ Public Class DocumentViewer
|
||||
|
||||
RichEditControl1.Visible = True
|
||||
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
|
||||
_docPath = FilePath
|
||||
|
||||
@ -142,12 +160,6 @@ Public Class DocumentViewer
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CloseDocument()
|
||||
GdViewer.CloseDocument()
|
||||
UpdateMainUi()
|
||||
End Sub
|
||||
|
||||
Private Sub btnOpen_Click(sender As Object, e As EventArgs)
|
||||
CloseDocument()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user