473,804 Members | 3,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PrintPreviewDia log Control and HTML

Hello,

Is there a way that anyone knows of to preview an HTML string and have
it formatted as HTML in a PrintPreviewDia log? In other words, can the
PrintDocument that is required for this render/understand HTML?
Everything that I have seen looks like it will just print out the raw
string and not the rendered HTML.
I know I can do this with a WebBrowser Control and the
ShowPrintPrevie wDialog method, but I was hoping to avoid using the
WebBrowser control this time.

Thanks for any help.

Oct 5 '06 #1
3 5290
Dvdastor,

Why not the webbrowser? Probably every other solution will takes more from
your time.

Just my thought,

Cor

<dv******@yahoo .comschreef in bericht
news:11******** **************@ i3g2000cwc.goog legroups.com...
Hello,

Is there a way that anyone knows of to preview an HTML string and have
it formatted as HTML in a PrintPreviewDia log? In other words, can the
PrintDocument that is required for this render/understand HTML?
Everything that I have seen looks like it will just print out the raw
string and not the rendered HTML.
I know I can do this with a WebBrowser Control and the
ShowPrintPrevie wDialog method, but I was hoping to avoid using the
WebBrowser control this time.

Thanks for any help.

Oct 6 '06 #2
Cor,

Thanks for the reply. I would love to use the WebBrowser control.
However, i am running into a major snag. I am trying to show a
PrintPreviewDia log with rendered HTML, but I don't want to launch the
form that shows that Web Browser control.

The way I have my code right now, is as follows:

Public Sub PrintPreview(By Val strHTMLItems As String)
Try

WBControl = New WebBrowser
AddHandler WBControl.Docum entCompleted, AddressOf
WBControl_Previ ewDocumentCompl eted

WBControl.Docum entText = (strHTMLItems)

WBControl.Heigh t = 800
WBControl.Width = 800

Catch ex As Exception

End Try
End Sub

Private Sub WBControl_Previ ewDocumentCompl eted(ByVal sender As
Object, ByVal e As WebBrowserDocum entCompletedEve ntArgs)
'shows the actual preview.
WBControl.ShowP rintPreviewDial og()

End Sub

This runs fine, but it opens the dialog box for the print preview
really small. Even though I set the size to 800 x 800, it does not
resize it.

can you offer any assistance on this?

Cor Ligthert [MVP] wrote:
Dvdastor,

Why not the webbrowser? Probably every other solution will takes more from
your time.

Just my thought,

Cor

<dv******@yahoo .comschreef in bericht
news:11******** **************@ i3g2000cwc.goog legroups.com...
Hello,

Is there a way that anyone knows of to preview an HTML string and have
it formatted as HTML in a PrintPreviewDia log? In other words, can the
PrintDocument that is required for this render/understand HTML?
Everything that I have seen looks like it will just print out the raw
string and not the rendered HTML.
I know I can do this with a WebBrowser Control and the
ShowPrintPrevie wDialog method, but I was hoping to avoid using the
WebBrowser control this time.

Thanks for any help.
Oct 6 '06 #3
Dvdastor,

I am not sure anymore of this, but I thought that you could hide it behind a
panel.
Did you try that?

Cor

<dv******@yahoo .comschreef in bericht
news:11******** **************@ c28g2000cwb.goo glegroups.com.. .
Cor,

Thanks for the reply. I would love to use the WebBrowser control.
However, i am running into a major snag. I am trying to show a
PrintPreviewDia log with rendered HTML, but I don't want to launch the
form that shows that Web Browser control.

The way I have my code right now, is as follows:

Public Sub PrintPreview(By Val strHTMLItems As String)
Try

WBControl = New WebBrowser
AddHandler WBControl.Docum entCompleted, AddressOf
WBControl_Previ ewDocumentCompl eted

WBControl.Docum entText = (strHTMLItems)

WBControl.Heigh t = 800
WBControl.Width = 800

Catch ex As Exception

End Try
End Sub

Private Sub WBControl_Previ ewDocumentCompl eted(ByVal sender As
Object, ByVal e As WebBrowserDocum entCompletedEve ntArgs)
'shows the actual preview.
WBControl.ShowP rintPreviewDial og()

End Sub

This runs fine, but it opens the dialog box for the print preview
really small. Even though I set the size to 800 x 800, it does not
resize it.

can you offer any assistance on this?

Cor Ligthert [MVP] wrote:
>Dvdastor,

Why not the webbrowser? Probably every other solution will takes more
from
your time.

Just my thought,

Cor

<dv******@yaho o.comschreef in bericht
news:11******* *************** @i3g2000cwc.goo glegroups.com.. .
Hello,

Is there a way that anyone knows of to preview an HTML string and have
it formatted as HTML in a PrintPreviewDia log? In other words, can the
PrintDocument that is required for this render/understand HTML?
Everything that I have seen looks like it will just print out the raw
string and not the rendered HTML.
I know I can do this with a WebBrowser Control and the
ShowPrintPrevie wDialog method, but I was hoping to avoid using the
WebBrowser control this time.

Thanks for any help.

Oct 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2571
by: Ramsey Schaffnit | last post by:
Context: I have to print personal information on a preprinted form I've never seen using a printer I've never seen. I want to use a control to overlay the PrintPreview to indicate where I've printed. I want to use a separate control in order to allow the user to drag the field to a different position on the form so it doesn't have to come back for me to change the code. I want to use the PrintPreview because it fits so naturally with...
2
14470
by: Michael A. Covington | last post by:
By default, my PrintPreviewDialog is coming out too small. What is the best way to control its size and position? Ideally, I'd just like to maximize it. Thanks!
2
5870
by: Randy | last post by:
Hello all, I'm trying to print using PrintPreviewDialog. What's happening is that the PrintPreviewDialog shows the correct information to be printed, but when I click the print icon, it prints a blank page. If I comment out the printPreviewDialog1.ShowDialog(); and just do a printDocument1.Print(); instead, it prints all the pages like a champ. Anyone know what I'm doing wrong? Thanks
3
22980
by: sachin | last post by:
How to customize PrintPreviewDialog, such that, addition of a new button, change the functionality of existing button should be possible programatically. Sample code will help a lot. Moreover, what happens before the document gets displayed in PrintPreviewDialog, i.e. whether entire document gets copied in printer driver spool or only 1 or 2 pages? please guide regards
0
1599
by: Harry J. Smith | last post by:
I am using the PrintPreviewDialog Window Form from the Toolbox. It displays my RichTextBox contents correctly, but when I click on the Print icon on this form it prints one blank page and no text. How can I fix this to print the text that is being displayed? Here is the code I use to bring up the form: string stringText = helpTextOut.Text;
4
3838
by: gsb58 | last post by:
Hi! I have a Textbox control on a form and a PrintPreviewDialog. How on earth can I associate the Textbox control with the PrintPreviewDialog, so that the text from the Textbox control will show in the PrintPreviewControl when launching? Anybody got a clue?
2
9878
by: Richard MSL | last post by:
I am using PrintPreviewDialog to preview a file. There is a button that the user can press, which seems to print the file to the default printer. I would like to capture a click on that button so that I can present a PrintDialog, print some files in a special way, etc. But there does not seem to be an event among the PrintPreviewDialog members to do this? Or perhaps I missed it? I would appreciate any suggestions. Thanks.
10
15337
by: choupi | last post by:
Hello, Is there a way to call a printDialog from a printPreviewDialog (from print icon for example)? Indeed, the print icon in the printpreviewdialog prints directly the document without lunching the printdialog (i.e. the user can't choose the print parameters). Thanks a lot.
1
1662
by: inpuarg | last post by:
I have a windows form, there are button , textbox label etc. controls on it. and i can programmatically get each of their names. and i also have a printPreviewDialog on a form. I cannot get it through loop. i know that it does not have an appearance. so - how can i get it programmatically ? private void button1_Click(object sender, EventArgs e)
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10074
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2983
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.