MS Integrating ByteData to DB for SIG Documents
This commit is contained in:
@@ -164,7 +164,8 @@ Public Class EnvelopeEditorController
|
||||
.Filepath = oFileInfoTemp.FullName,
|
||||
.FileNameOriginal = oFileInfo.Name,
|
||||
.Thumbnail = Thumbnail.GetThumbnailFromPDFFile(oTempFilePath),
|
||||
.PageCount = Thumbnail.GetPageCount(oTempFilePath)
|
||||
.PageCount = Thumbnail.GetPageCount(oTempFilePath),
|
||||
.Byte_Data = ReadFile(pDocumentFilePath)
|
||||
}
|
||||
|
||||
Return oDocument
|
||||
@@ -174,7 +175,22 @@ Public Class EnvelopeEditorController
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
'Open file in to a filestream and read data in a byte array.
|
||||
Private Function ReadFile(ByVal sPath As String) As Byte()
|
||||
'Initialize byte array with a null value initially.
|
||||
Dim data As Byte() = Nothing
|
||||
'Use FileInfo object to get file size.
|
||||
Dim fInfo As New FileInfo(sPath)
|
||||
Dim numBytes As Long = fInfo.Length
|
||||
'Open FileStream to read file
|
||||
Dim fStream As New FileStream(sPath, FileMode.Open, FileAccess.Read)
|
||||
'Use BinaryReader to read file stream into byte array.
|
||||
Dim br As New BinaryReader(fStream)
|
||||
'When you use BinaryReader, you need to supply number of bytes to read from file.
|
||||
'In this case we want to read entire file. So supplying total number of bytes.
|
||||
data = br.ReadBytes(CInt(numBytes))
|
||||
Return data
|
||||
End Function
|
||||
Public Function CreateThumbnail(pDocumentPath As String) As Bitmap
|
||||
Try
|
||||
Dim oThumbNail As Bitmap = Thumbnail.GetThumbnailFromPDFFile(pDocumentPath)
|
||||
|
||||
Reference in New Issue
Block a user