Solved

Print text to printer as HTML

Posted on 2001-08-04
6
260 Views
Last Modified: 2010-04-04
i got a lil problem, i want to Print memo1.lines to the printer but not as ?lain text but as HTML

the memo1.lines is written as a HTML webpage so i dont think it shouldnt be hard so hard...
0
Comment
Question by:TeChNiCh
[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
6 Comments
 
LVL 6

Expert Comment

by:edey
ID: 6352245
Then you'd have to render it. Prob the easiest way would be to load it into a TWebBrowser & let IE print it for you, something like this:

procedure TForm1.Button1Click(Sender: TObject);
var
   vaIn, vaOut: OleVariant;
   ms : TMemoryStream;
begin
     ms := TMemoryStream.create;
     memo1.Lines.saveToStream(ms);
     WebBrowser1.Document as IPersistStreamInit).Load(TStreamAdapter.Create(AStream);
     ms.free;
     while webBrowser1.busy do
           application.processMessages;
     WebBrowser.ControlInterface.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, vaIn, vaOut);
end;

GL
Mike
0
 
LVL 21

Expert Comment

by:gemarti
ID: 6352249
I don't think you can print from a Memo component.

have you tried putting the information into a RichEdit component and printing?

Richedit1.Print(string);
0
 

Author Comment

by:TeChNiCh
ID: 6357732
WebBrowser1.Document as IPersistStreamInit).Load(TStreamAdapter.Create(AStream);

get a lil error there
IPersistStreamInit undeclared identifier
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 6

Accepted Solution

by:
edey earned 140 total points
ID: 6357789
I belive that it's declared in activeX.pas so you'll need to add activeX to your uses clause.

GL
Mike
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7872455
0
 

Expert Comment

by:SpideyMod
ID: 8145019
Administrative Action - Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Delphi Form ownership 4 156
TEMBEDDEDWB how can i change its user agent ? 8 105
Convert MS Word document to a PDF file 9 133
Using MMsystem To change audio input 1 38
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

734 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