Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 637
  • Last Modified:

Load a PDF file in an TImage without generating a file

Hi,

I'm receiving a file from a socket (using Indy) and I need to display that file on screen. I tried the Abobe ActiveX Control but I have to first save the file to disk and then load the PDF from that file.

I want to load the file on screen without generating the file. Any idea how I can do that?

(I'm using Delphi 7...)

Thanks
0
pmaltais
Asked:
pmaltais
  • 4
  • 2
1 Solution
 
BdLmCommented:
to display a pdf file a timage component is not the wright apporach,  which ado pdf active x did you try ?
0
 
BdLmCommented:
0
 
pmaltaisAuthor Commented:
I'm using Adobe Acrobat 7.0 Control Type Library 1.0 wich I think is bundled with Acrobat Reader. Not sure.

Just to make sure I was clear enough in my initial question, I want to use the stream directly with the ActiveX and never have to save the file first.

Thnaks
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
BdLmCommented:
Yes, I understood,


did you try the Active X for viewing ?  http://delphi.about.com/cs/howto/ht/htpdf.htm
in a second step , did you get a StringStream from your Indy socket ? lets have a look later on the loadfile function, override it or replace it ....


0
 
pmaltaisAuthor Commented:
yep,

I already tried the ActiveX as mentionned in the link you provided and it work very well.

Right now I'm using a ReadStream and I assign the received buffer to a TMemoryStream. What your saying is that I should assign it to a TStringStream instead right?

By the way, this is my first experience with Delphi and Indy so it may explain why I dont get it all right  away... some code example would be apreciated.

Ok thanks
0
 
BdLmCommented:
if it is working, no need to change from one stream class to another,
my idea is to add a further function to the pdf object like

PDF2 = class (Tpdf)
               function loadFromStream  :  TStream
               end;



function PDF2.loadfromStream : tStream
begin
          .....
          put your code here ...
       
end;



0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now