473,791 Members | 3,275 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 5289
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
14451
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
1597
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
9876
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
15336
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
9517
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10428
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...
1
10156
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
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
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
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2916
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.