想将PDF存在数据表里归档,然后提供预览和打印功能
adobe Reader的ocx插件只能loadfromfile,不提供loadfromStream
请问有没有可以读取stream预览的插件?
望各位高手指教!
---------------------------------------------- 直接把PDF文件保存为BLOB格式字段内,显示的时候保存为文件,用TCppWebBrowser控件显示。

TBlobField *bf = (TBlobField*)SimpleDataSet1->FieldByName("MPDF");
bf->SaveToFile(fName);

WideString FileName11 = "FILE:///" + fName;

CppWebBrowser1->Stop();
CppWebBrowser1->Quit();
CppWebBrowser1->Navigate(FileName11.c_bstr());
---------------------------------------------- 常用的pdf控件
----------
TAcroPDF,PowerPDF,PDFCreator,llPdfLib,PDFViewer
PDFtoolkit VCL ProPlus
Debenu Quick PDF Library v9.12

llPDFLib是一个100%的Object Pascal library,用于创建PDF文档。用它创建PDF文档不使用任何DLL和其他第三方软件。llPDFLib包括TPDFDocument组件并带有属性和方法,使用方式类似Delphi的TPrinter
---------------------------------------------- 谢谢各位,问题已经解决了!
尝试过两个方法,分别用Foxit PDF和QuickPDF10.12
foxit提供了openstream,但需要用Iinterface类,转换成Tstream花了点功夫
我是参考了下面的例程做好的,要有点修改,需要的朋友可以发邮件给我。
foxit的好处是提供了可视化的Preview,包含打开,打印,缩放旋转等功能,但与我自己的界面风格不符,而且英文的Hints总有点不爽。所以最后还是放弃了。
QuickPDF很强大,带XE5源码,提供Loadfromstream(Tstream)就是没有可视化组件,好在官网有例程下载,跟着做很快就做好了。

在此再次感谢各位高手热心相助!


附:网上的Istream转Tstream例程及说明:
IStream is defined in the ActiveX unit, TStreamAdapter is in Classes, and TOLEStream is in Axctrls.  You can use TStreamAdapter to convert a TStream decendant ( such as TMemoryStream ) to an IStream interface and TOLEStream converts a IStream to a TStream.  The following class wrapps this all together for you.  (WARNING : do not try to convert these functions to a property of type IStream.  There may be a way to do it, but if you do, you may be tempted to use that property to call the IStream methods, which won't really work - or at least, I get access violations)

Uses Classes, ActiveX, Axctrls;

Type TInterfaceStream = Class ( TMemoryStream )
Public
Procedure LoadFromIStream(Source : IStream);
Function GetIStream : IStream;
end;

Procedure TInterfaceStream.LoadFromIStream(Source : IStream);
var
Adapt : TOLEStream;
Buff : Byte;
I : Integer;
begin
ADapt := TOLEStream.Create(Source);
Adapt.Position := 0;
Self.Clear;
Self.Position := 0;
For I := 0 to Adapt.Size do
begin
Adapt.Read(Buff, 1);
Self.Write(Buff, 1);
end;
Self.Position := 0;
end;

Function TInterfaceStream.GetIStream : IStream;
var
Adapt : TStreamAdapter;
tPos : Int64;
begin
Adapt := TStreamAdapter.Create(Self);
Adapt.Seek(0, 0, tPos);
Result := Adapt as IStream;
end;
----------------------------------------------