Storing a PDF in a Database
I need to store letters generated via RBuilder in a database...currently,
within my program I'm writing a pdf file to disk and then reading that file
and loading it into the database... see below. My question... is there a
better way to do this? I would like to be able to write it to a
memorystream and then read that memorystream directly into the database. Is
there a way to do this? Any suggestions are welcome.
- - - - - - - - - - - - - - - - - - - - - - - -
ppLtrReport.DeviceType := 'PDF';
ppLtrReport.TextFileName := 'C:\Ltrtemp.pdf';
ppLtrReport.ModalPreview := false;
ppLtrReport.ShowPrintDialog := false;
ppLtrReport.ShowCancelDialog := false;
ppLtrReport.Print;
TestTable.Insert;
TBlobField(TestTable.FieldByName('Test_Blob')).LoadFromFile('C:\Ltrtemp.pdf');
TestTable.Post;
- - - - - - - - - - - - - - - - - - - - - - - -
Thank you for any help.
Joe Hutchins
within my program I'm writing a pdf file to disk and then reading that file
and loading it into the database... see below. My question... is there a
better way to do this? I would like to be able to write it to a
memorystream and then read that memorystream directly into the database. Is
there a way to do this? Any suggestions are welcome.
- - - - - - - - - - - - - - - - - - - - - - - -
ppLtrReport.DeviceType := 'PDF';
ppLtrReport.TextFileName := 'C:\Ltrtemp.pdf';
ppLtrReport.ModalPreview := false;
ppLtrReport.ShowPrintDialog := false;
ppLtrReport.ShowCancelDialog := false;
ppLtrReport.Print;
TestTable.Insert;
TBlobField(TestTable.FieldByName('Test_Blob')).LoadFromFile('C:\Ltrtemp.pdf');
TestTable.Post;
- - - - - - - - - - - - - - - - - - - - - - - -
Thank you for any help.
Joe Hutchins
This discussion has been closed.
Comments
Take a look at the following rbWiki article, as well as demo 109 located in
the main demos directory.
http://www.digital-metaphors.com:8080/Output/PDF/PDF_Fundamentals
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com