Welcome Guest Search | Active Topics | Sign In | Register

Print preview in browser Options
Craig Oliver
Posted: Tuesday, July 8, 2014 11:03:59 AM

Rank: Advanced Member
Groups: Member

Joined: 7/7/2014
Posts: 60
Hello,

We're currently evaluating the EO Web Browser. So far all looks and behaves well. However - is there a way to do a print preview from the web browser component? Currently the print opens the print dialog. I've checked the BeforePrint event and there does not appear to be a way there, nor in the PrinterOptions. The old (and unusable for us) native web browser does support a ShowPrintPreview, and we're doing this via yet another 3rd party DLL with the other web browser DLL we're using but would like to replace.

thanks,
Craig
eo_support
Posted: Tuesday, July 8, 2014 11:49:30 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Unfortunately no. I do not believe EO.WebBrowser has the print preview feature built-in. Chrome has this but it was left out in our library. The BeforePrint event is mainly for you to cancel print and/or control the print options. But there is no built-in print preview feature at this time. Sorry about it!
Craig Oliver
Posted: Tuesday, July 8, 2014 11:56:24 AM

Rank: Advanced Member
Groups: Member

Joined: 7/7/2014
Posts: 60
Thanks for the quick reply. Related to printing from the browser: tables appear to have a uniform column width when printing, rather than a proportional one. For instance, if we have a table with 3 columns and one is twice as wide as the others, the web displays them correctly, but printing makes all the columns the same width. Is there a way to keep proportional widths? On the bright side printing landscape alleviates some of this, but often several columns may contain short values (number) and others much wider (address). It would be nice if the printed column widths maintained some sort of semblance to the HTML column widths.
eo_support
Posted: Tuesday, July 8, 2014 12:04:11 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

You can try to print the same page in Google Chrome browser and see if the same problem occurs. If Google Chrome has the same problem, then it might have to do with your page (for example, you might have different CSS settings for printing), or it's simply a bug on Google Chrome browser. If the problem is on the CSS side, then obviously you will have to change your CSS. If the problem is on Google Chrome's side, then you might want to use Google Chrome to find out if there is any work around since we are not in a position to fix Google Chrome's bug. For such cases we will usually wait until the issue is fixed by Chrome team and then pull their changes.

If Google Chrome does not show the same problem, then the problem might be on our end. In that case please try to isolate the problem into a test page and post the test page. We will then try to reproduce the problem here in our environment and see what we can find out why our library and Chrome behaves differently. We will then go from there.

Thanks!
Craig Oliver
Posted: Tuesday, July 8, 2014 12:16:50 PM

Rank: Advanced Member
Groups: Member

Joined: 7/7/2014
Posts: 60
Apparently Chrome does NOT make proportional column widths either. So - never mind! For some reason I was thinking it did. Assumptions and all that.

thanks,
Craig
eo_support
Posted: Tuesday, July 8, 2014 6:05:58 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
You are very welcome and thanks for the update!
Craig Oliver
Posted: Wednesday, September 3, 2014 3:21:57 PM

Rank: Advanced Member
Groups: Member

Joined: 7/7/2014
Posts: 60
Do you plan on bringing in the print preview at some point? We've some printing that defaults to portrait and 1" margines, so things get a little wonky looking. While we can adjust the printer via the preferences, the user will have to print before they realize what the output looks like.

Related to this, I'm attempting to reset the margins but it seems to have no affect. Any suggestions would be welcome.

webView1.BeforePrint += (s, e) =>
{
e.PageSettings.Margins = new Margins(10, 10, 10, 10);
};
eo_support
Posted: Wednesday, September 3, 2014 5:34:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

Unfortunately we do not have any plan to add that in the near future yet. As to page margin, the settings are only used when you skip the printing dialog. For example:

Code: C#
//Set the print settings
e.PageSettings.Margins = new Margin(10, 10, 10, 10);

//Continue printing without displaying the default dialog
e.Continue(false);


The reason is because basically all settings in the event argument are the same settings on the printing dialog. The purpose of the settings on the event objects are to allow you to use your own printing dialog and thus skipping the default dialog. So they are only used when you do skip the dialog.

Thanks!

Craig Oliver
Posted: Wednesday, October 22, 2014 11:39:01 AM

Rank: Advanced Member
Groups: Member

Joined: 7/7/2014
Posts: 60
And in the continuing saga (took us a bit to circle back around)...

So I've added a print dialog and I've options to set the margins, landscape and printer. All works except the landscape option. I cannot seem to get this to print in landscape. This is the last (well, at the moment) thing before we can let our customers use this. Any ideas would be appreciated!

The code snippet:
webView1.BeforePrint += (s, e) =>
{
EOPrintSettings ps = new EOPrintSettings();
ps.ShowDialog();
if (ps.settings == null)
{
e.Cancel();
return;
}
e.PageSettings.Margins = ps.pageSettings.Margins;
e.PageSettings.Landscape = ps.pageSettings.Landscape;
e.PrinterSettings.PrinterName = ps.settings.PrinterName;
e.Continue(false);
};

(edit: realized the page referenced was MS...)
eo_support
Posted: Wednesday, October 22, 2014 10:42:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

We have confirmed this to be a bug and posted a new build that should fix it. You can download the new build from our download page.

Thanks!
Craig Oliver
Posted: Thursday, October 23, 2014 7:49:56 AM

Rank: Advanced Member
Groups: Member

Joined: 7/7/2014
Posts: 60
You guys rock! Works! Using the multi-DLL version. So now off to QA.

Thanks for the fast response.
eo_support
Posted: Thursday, October 23, 2014 1:29:33 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Great. Thanks for confirming that it works. Please feel free to let us know if there is anything else.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.