Link to home
Start Free TrialLog in
Avatar of PSERK
PSERK

asked on

Print PDF

How to print PDF file with Delphi.
Please give me any ideas how to do that.
All examples are welcome.

Looking forward to your answer
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Hello
 
  You can use the ActiveX control of Adobe Acrobat

from Component menu > Import ActiveX control then choose
Acrobat Control for ActiveX, then press Install

the Pdf Activex control for Adobe acrobat will added to ActiveX Tab of Delphi then drop pdf control to the form and try this code

procedure TForm1.Button1Click(Sender: TObject);
begin
  Pdf1.Visible := False;
  Pdf1.LoadFile('c:\test.pdf');
  pdf1.printPages(1,1);
end;

if you want to print the entire file Call pdf1.Print

if would like to use pure VCL components, look at torry site for pdf components

Best regards
Mohammed Nasman
Avatar of PSERK
PSERK

ASKER

Thank you, but i would like to get somekind of independent source, that would be able to import pdf file content and then print it or something like that.
ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you try to use the activex with version 5 of adobe it doesn't function, but the shellexecute method can be right
or you can use the html viewer of delhpi a let it manage the question with the activex...
Avatar of PSERK

ASKER

Thanks for your answer, it turned out to be the best way how to print pdf file and that solution was perfect for my boss and so thanks again
>> If you try to use the activex with version 5 of adobe it doesn't function

I have acrobat 5 on my machine, and I made my example using the ActiveX that come with it

>> it turned out to be the best way how to print pdf file and that solution was perfect for my boss

Always expect the best from Madshi :-)