Load blob pdf into PDFViewer

Hi,
I have a database where the PDF files are stored as blob. How can I load a blob file into the PDFViewer?

I've found the following function, but I still can't figure out how to load the blob.

Public Function DocumentRetrieve(ByVal jsonResult As Dictionary(Of String, String)) As Object

        myCmd.Connection = myConnection.open
        myCmd.Parameters.Clear()
        myCmd.CommandText = "SELECT certificaat FROM certificaten WHERE certificaatId = 14"
        myCmd.ExecuteNonQuery()
        Dim myReader As MySqlDataReader
        myReader = myCmd.ExecuteReader()

        Dim byteArray As Byte() = CType(myReader("certificaat"), Byte())
        Return "data:application/pdf;base64," & Convert.ToBase64String(byteArray)

    End Function

Kind regards,

Bjorn.

1 Reply 1 reply marked as answer

VS Vikas Sekar Syncfusion Team October 13, 2020 11:28 AM UTC

Hi Bjorn, 

Thank you for contacting Syncfusion Support. 

Javascript PdfViewer do not have support to load the PDF document from the blob directly. However, we can load the PDF document by converting the blob to base64 string using the client-side documentPath API in the sample level. Please refer the below KB link which demonstrate how to load Pdf url in pdfviewer,  


Please let us know whether the given link helps, as we have provided the solution using Javascript PdfViewer control. If our observation is different from your requirement, kindly let us the platform you are working on and more details about your requirement. 

Regards, 
Vikas   


Marked as answer
Loader.
Up arrow icon