|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
Hi I built a software using EO webcontrol and used this source code for the print button but i need it to not show and printing dialog after: Dim settings = WebView.GetDefaultPrinterSettings()
settings.PrinterName = name1
settings.PrintToFile = True
settings.PrintFileName = "C:\1.pdf"
WebView1.Print(settings)
it selects the printer and doesn't show the select printer window but it still shows the select filename window.
to not show any window i also tried this:
Private Sub webView1_BeforePrint(sender As Object, e As BeforePrintEventArgs)
e.Continue(True)
End Sub
while putting this before the webview1.print command:
AddHandler WebView1.BeforePrint, New BeforePrintHandler(AddressOf webView1_BeforePrint)
what must i do to just print to pdf without any window showing up?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
EO.WebBrowser does not support printing to file. If you wish to convert a web page to PDF, you can use the HTML to PDF feature in our EO.Pdf product.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
yes but i want to get the user inputted text too. and from what i saw.. html to pdf only gets the webpage.. right?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
No. That is not correct. HTML to PDF can get user input as well. For example, if you use ASPXToPDF (which uses HTML to PDF internally), your form contents will be rendered as well. You can also use HtmlToPdfSession object to load a page, then fill in the form elements and then render the page.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
how do i use that with a webcontrol that i already have in my software? or do i need to make another object in my software to replace the webcontrol and load pages in that new object.. then print to pdf?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, You can try these steps: 1. Call this method to get the current page HTML: http://www.essentialobjects.com/doc/eo.webbrowser.webview.gethtml.aspx2. Set HtmlToPdf.Options.BaseUrl to the base Url of your web page; 3. Call HtmlToPdf.ConvertHtml to convert the HTML you have in step 1 to PDF: http://www.essentialobjects.com/doc/eo.pdf.htmltopdf.converthtml_overloads.aspxNote that: 1. Step 2 is important. If you do not set base Url correctly, dependency resources in your page such as images and style sheets won't load correctly. 2. Step 1 uses EO.WebBrowser. Step 2 and 3 uses EO.Pdf. So you will need license for both products in order to use this method; Thanks!
|
|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
i will test the components a lot first. how long does the trial last maximum?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
You can test the trial version as long as you want.
|
|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
1.does it get the images from the webpage too or just the text? i saved the data on an html file and opened in firefox but it didn't show the image http://screencast.com/t/qdRsgaAfm32.where do i find the htmltopdf component in .net? i clicked "choose items" and checked the "COM components" tab + the ".net framework components". before this i downloaded and installed the eo.pdf product.
|
|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
3.also let me know..in case i want to just get the complete html with pictures how could i do that without eo.pdf? i tried the webview.capture function but it exports only the part of the webpage visible to the user.. and i need the complete webpage.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Andrei300 wrote:1.does it get the images from the webpage too or just the text? i saved the data on an html file and opened in firefox but it didn't show the image http://screencast.com/t/qdRsgaAfm3 This is exactly why you need to set HtmlToPdf.Options.BaseUrl. Andrei300 wrote:2.where do i find the htmltopdf component in .net? i clicked "choose items" and checked the "COM components" tab + the ".net framework components". before this i downloaded and installed the eo.pdf product. Please see here for more details: http://www.essentialobjects.com/doc/pdf/install/project_setup.aspxhttp://www.essentialobjects.com/doc/pdf/htmltopdf/quick_start.aspx
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Andrei300 wrote:3.also let me know..in case i want to just get the complete html with pictures how could i do that without eo.pdf? i tried the webview.capture function but it exports only the part of the webpage visible to the user.. and i need the complete webpage. You don't get the HTML from EO.Pdf. You get the HTML through other means and feed that to EO.Pdf. You can get your HTML whatever way you want. For example, you can get it through remote server, you can get it from a file, or you can get it from EO.WebBrowser, etc. How you get your HTML has nothing to do with EO.Pdf. The HTML itself usually does not contain images. This is why you need to set HtmlToPdf.Options.BaseUrl. Thanks!
|
|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
thanks 3..i always need the user input too from the html . so is there a way to do webview1.gethtml etc. so that it gets the input too? just to export as a jpg or html.
|
|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
4.i installed yesterday eo.total again and it might have changed a signature. when i copy the exe only to the old folder .. it doesn't open.. and sometimes it says an error about webengine signature changed. what must i do to fix this by copying only a new exe? i should delete and import again in the .net project the webengine etc. dlls?
|
|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
"ERROR SUMMARY Below is a summary of the errors, details of these errors are listed later in the log. * Activation of C:\CloudMitoBrowser2\CloudMitoBrowser.application resulted in exception. Following failure messages were detected: + Application manifest has either a different computed hash than the one specified or no hash specified at all. + File, CloudMitoBrowser.exe.manifest, has a different computed hash than specified in manifest.
COMPONENT STORE TRANSACTION FAILURE SUMMARY No transaction error was detected.
WARNINGS * The manifest for this application does not have a signature. Signature validation will be ignored."
|
|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
1.I imported the dlls now and used this code: WebControl1.WebView.Url = "http://www.yahoo.com" waited for the page to load.. then inputted some text
Dim html As String = WebView1.GetHtml HtmlToPdf.Options.BaseUrl = "http://www.yahoo.com" EO.Pdf.HtmlToPdf.ConvertUrl(HtmlToPdf.Options.BaseUrl, "c:\result.pdf")
but result.pdf didn't have the inputted text i placed in the search box of yahoo. why is that?
i also tried EO.Pdf.HtmlToPdf.ConvertUrl(html, "c:\result.pdf") and it gave an error.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, You would use ConvertHtml(html, pdf_fileName). You do not appear to understand what BaseUrl is for. You can read here for more information about this property: http://www.essentialobjects.com/doc/eo.pdf.htmltopdfoptions.baseurl.aspxThanks!
|
|
Rank: Member Groups: Member
Joined: 11/1/2015 Posts: 11
|
please answer the other questions from above too. because right now i can't even open the software because of EO on another computer i installed on a few days ago.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
That is something you need to work out yourself. You have a .NET application that uses our DLLs and you will run into a million different errors that can happen to all .NET applications that aren't particuarly related to our product. For example, you will get one error when a DLL you use is missing, you will get another error when a DLL you use is of the wrong version, you will get some other errors when your application doesn't have sufficient permission to run, etc. We consider all these problems generic .NET programming questions and generally we won't answer those. You will need to work those issues out yourself.
If you have done basic troubleshooting and is able to trace back to the problem to a specific location inside our DLL --- for example, our DLL throws an error message when you try to create a WebView, then we will be happy to help you further, even though sometimes such errors is related to your environment. The idea here is we only provide support on our product, we do not provide support for generic .NET programming.
Thanks
|
|