Solved

Load a PDF file in an TImage without generating a file

Posted on 2009-07-01
6
630 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
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!

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month7 days, 9 hours left to enroll

632 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