makis_best Well-Known Member Licensed User Longtime User Mar 2, 2021 #1 Hi. I have some pdf files inside my sqlite database in blob format. How I can open them so I can read them inside my application? I need to use any specific library? Thank you.
Hi. I have some pdf files inside my sqlite database in blob format. How I can open them so I can read them inside my application? I need to use any specific library? Thank you.
A amykonio Active Member Licensed User Longtime User Mar 2, 2021 #2 Hi. You can read blobs using the result from an execquery or execquery2 command. That will return a cursor. From that cursor you can access your blob using one of the following methods: B4X: Copy Dim Buffer() As Byte Buffer = Cursor.GetBlob("col1") or B4X: Copy Dim Buffer() As Byte Buffer = Cursor.GetBlob2(0) It can be achieved using sql library. You can save the contents of the buffer to a file... And use it later as you want. Andreas. Last edited: Mar 3, 2021 Upvote 0
Hi. You can read blobs using the result from an execquery or execquery2 command. That will return a cursor. From that cursor you can access your blob using one of the following methods: B4X: Copy Dim Buffer() As Byte Buffer = Cursor.GetBlob("col1") or B4X: Copy Dim Buffer() As Byte Buffer = Cursor.GetBlob2(0) It can be achieved using sql library. You can save the contents of the buffer to a file... And use it later as you want. Andreas.
makis_best Well-Known Member Licensed User Longtime User Mar 3, 2021 #3 Thank you @amykonio I get it. But what view should I use to open and read pdf? Upvote 0
A amykonio Active Member Licensed User Longtime User Mar 3, 2021 #4 I'm not sure if you want to open and read its content to use them inside your application (some kind of data extraction) or if you simply want to show the pdf to the corresponding application. Upvote 0
I'm not sure if you want to open and read its content to use them inside your application (some kind of data extraction) or if you simply want to show the pdf to the corresponding application.
makis_best Well-Known Member Licensed User Longtime User Mar 3, 2021 #5 Why not to open it inside my application? Upvote 0