Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
PDF from SQLite |
Post Reply ![]() |
Author | |
vetal.kw ![]() Beginner ![]() Joined: 08 Apr 21 Location: KZ Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() Posted: 08 Apr 21 at 7:13AM |
Hello! the file is located in the SQLite database (blob). how do I save this file to a folder on my computer in Delphi? procedure TForm3.TabItem4Click(Sender: TObject); var QP: TDebenuPDFLibrary1811; begin QP:= TDebenuPDFLibrary1811.Create; try QP.UnlockKey('***************'); QP.DAOpenFromStream(UniTable1.Fields[2].asString,''); QP.SaveToFile('C:\test002.pdf'); finally QP.Free; end; how can I specify a file from SQLite in "QP. DAOpenFromStream"? |
|
![]() |
|
tfrost ![]() Senior Member ![]() Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
![]() ![]() ![]() ![]() ![]() |
I would be surprised if your sample code even compiled, because DAOpenFromStream does not take a string as the first parameter. And QPDF has a 'golden rule' not to mix DA and non-DA functions, so if you actually need to use and modify the loaded file in QPDF you would need eventually to save it with DASaveAsFile to match a DA open function. Your first question, how to save the file to a folder, is not really a QPDF issue. Unfortunately I am not familiar with the UniTable component (perhaps another user here is). But one suggestion would be to try to treat the data as TBytes (an array of bytes), and write that into a MemoryStream which you can SaveToFile, remembering to set the stream position back to 0 before you do. There may well be way get a stream more directly from the blob but you would find examples in your database documentation. Your second question, how to load it into QPDF, is then simple: once you have the content in a stream, you can then use DAOpenFromStream. I would try to avoid using strings in this process, because this then starts to involve Unicode. |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Vetal, Here you'll find an older post having to do with SQLite. The posted code will give you few hints how to do: http://www.quickpdf.org/forum/mac-loadfromstring-bug_topic3099_post12428.html?KW=SQLite+Blob#12428 Here's a larger sample with blobs from oracle: http://www.quickpdf.org/forum/delphi-7-how-to-open-pdf-from-oracle-database_topic2653.html If you don't need the DA-functions you shouldn't use them cause these functions are only a subset of the large bunch of functions and mixing DA- and normal functions should be avoided. This is a good starting point to search in the QuickPDF-ressources: https://www.debenu.com/docs/pdf_library_reference/Search.php This is a good starting point to learn more about the library: http://www.quickpdf.org/ Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store