Two Pilots™    Home  |  Navigation  |  Site Map  |  Products  |  Download  |  Prices  |  For Partners  |  Support


All forums · Statistics · Search ·

Two Pilots forum / For software developers / HTML2PDF demo problem in Delphi 6
Author Message
wen
# Posted: 2 Aug 2006 11:19


I have installed the demo of HTML2PDF in Delphi 6,
and I want to test Convert HTML file to PDF. The code as below:

procedure TForm1.Button2Click(Sender: TObject);
var PDF :TpiPDFDocument;
HTML :THTML2PDF;
begin
PDF := TpiPDFDocument.Create(nil);
PDF.StartEngine('demo', 'demo');
PDF.AutoLaunch := True;
PDF.FileName := 'c:TempTEST.pdf';
PDF.BeginDoc;
HTML := THTML2PDF.Create(nil);
HTML.StartHTMLEngine('','');
HTML.ConnectToPDFLibrary(IUnknown(PDF));
HTML.LoadFromFile('c:TempTEST.htm');
HTML.ConvertAll;
HTML.DisconnectFromPDFLibrary;
PDF.EndDoc;
end;

When the code runs to the line "HTML.ConnectToPDFLibrary(IUnknown(PDF));",
it shows a messages "Interface not support".
How can i solve this problem?

Stanislav
Member
# Posted: 6 Aug 2006 11:03


Hello,

Please use
HTML.ConnectToPDFLibrary(PDF);
instead of
HTML.ConnectToPDFLibrary(IUnknown(PDF));

Thank you very much !

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

trollwen
# Posted: 9 Aug 2006 05:55


Thank you for your answer.
But I have ever tried this way.
HTML.ConnectToPDFLibrary(PDF);
It still shows a error message " Interface not support ".
Is the HTML2PDF supported in delphi 6?
Thank you!

Stanislav
Member
# Posted: 12 Aug 2006 12:10


Hello,

Please try to remove lines
PDF := TpiPDFDocument.Create(nil);
and
HTML := THTML2PDF.Create(nil);

Thank you very much !

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

 

 

Powered by miniBB 2.0 RC7 © 2001-2004 Page creation time (sec.): 0.013

 

Page top