×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

TCppWebBrowser : printing but not viewing

TCppWebBrowser : printing but not viewing

TCppWebBrowser : printing but not viewing

(OP)
My goal is to print a html document in C++Builder 5.01 without the user previewing the document, ie.
the html file is not shown to the user. I can print the document successfully by first loading the html
file with TCppWebBrowser.Navigate and then calling ExecWB in the
OnDocumentComplete event. I see 2 solutions (below), neither of which I can get to work, I would prefer
the second option or maybe someone can suggest another way.

1. make the TCppWebBrowser invisible
2. create TCppWebBrowser dynamically, attaching an OnDownloadComplete event where the printing is done

1. I have tried setting TCppWebBrowser1->Visible = False in the object inspector, in OnPaint and under
a button without success. It still remains Visible?

2. I create TCppWebBrowser dynamically as follows

void __fastcall TMainForm::FormPaint(TObject *Sender)
{
 // why in OnPaint?
 // the form must be visible prior to the creation of
 // the WebBrowser
 if (!oHTML)
 {
   oHTML = new TCppWebBrowser(this);
   oHTML->OnDocumentComplete = DocumentComplete;
 }
}

I navigate to the document and after waiting a while to make sure it is loaded I call ExecWB to print
it (the same code which prints in 1). However that does not work. Also the OnDocumentComplete event,
DocumentComplete, never gets called.

Can anyone provide some insight?

Thanks very much,

Tom.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close