ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TImageEnView.PdfViewer to and from database blobs
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

kowal

Poland
38 Posts

Posted - Oct 15 2024 :  09:40:07  Show Profile  Reply
Hello,

I'd like to save and read the documents in PDF format in the database BLOB fields
using TImageEnView.PdfViewer but I'm not sure if it's possible and how to try to do it.
Can I get some information about it?

regards
S. Kowalski

JonMRobertson

USA
32 Posts

Posted - Oct 15 2024 :  16:28:35  Show Profile  Reply
One way would be to create a stream for the BLOB field and LoadFromStream. Something similar to this (adhoc code, untested):

  var bsPDF := TBlobStream.Create(fldBlob);
  try
    ImageEnView1.PdfViewer.Enabled := True;
    ImageEnView1.PdfViewer.LoadFromStream(bsPDF);
  finally
    bsPDF.Free;
  end;


Note that you DO need to create and destroy TBlobStream for each row/record.
Go to Top of Page

xequte

38610 Posts

Posted - Oct 16 2024 :  19:28:25  Show Profile  Reply


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

kowal

Poland
38 Posts

Posted - Oct 18 2024 :  08:29:12  Show Profile  Reply
Hello
thanks for advice - it works OK

Here is the snippet of my code

var bstream: TStream;
begin
       
  bstream := dset.CreateBlobStream(fld, bmRead);
  
  try
    imageEnView.PdfViewer.Enabled := True;
    imageEnView.PdfViewer.LoadFromStream(bstream);
  finally
    bstream.Free;
  end;
end;


S.Kowalski
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: