Solved

Load a PDF file in an TImage without generating a file

Posted on 2009-07-01
6
629 Views
Last Modified: 2013-11-23
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
Comment
Question by:pmaltais
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 8

Expert Comment

by:BdLm
ID: 24758386
to display a pdf file a timage component is not the wright apporach,  which ado pdf active x did you try ?
0
 
LVL 8

Expert Comment

by:BdLm
ID: 24758467
0
 

Author Comment

by:pmaltais
ID: 24759164
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
Independent Software Vendors: 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!

 
LVL 8

Expert Comment

by:BdLm
ID: 24762140
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
 

Author Comment

by:pmaltais
ID: 24763352
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
 
LVL 8

Accepted Solution

by:
BdLm earned 200 total points
ID: 24771777
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question