Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Storing a PDF in a Database

edited September 2008 in General
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

Comments

This discussion has been closed.