Home

Printing API for Desktop apps hosting Edge's WebView

%3CLINGO-SUB%20id%3D%22lingo-sub-837956%22%20slang%3D%22en-US%22%3EPrinting%20API%20for%20Desktop%20apps%20hosting%20Edge's%20WebView%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-837956%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20does%20Edge%20team%20have%20plans%20to%20provide%2Fexpose%20an%20API%20to%20control%20printing%20functionality%2C%20something%20similar%20to%20%3CA%20href%3D%22https%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Faa753279(v%3Dvs.90)%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EInternet%20Explorer%20Print%20Templates%3C%2FA%3Eand%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Faa769937(v%253Dvs.85)%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIDM_PRINT%3C%2FA%3Eetc%20commands%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-837956%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EApp%20Deployment%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842848%22%20slang%3D%22en-US%22%3ERe%3A%20Printing%20API%20for%20Desktop%20apps%20hosting%20Edge's%20WebView%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842848%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403731%22%20target%3D%22_blank%22%3E%40noseratio%3C%2FA%3E%2C%20I%20have%20sent%20an%20email%20asking%20the%20team%20that%20own%20this%20what%20their%20plans%20are.%26nbsp%3B%20I%20will%20respond%20back%20when%20I%20hear%20something.%26nbsp%3B%20Thanks%20-%20Elliot%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842962%22%20slang%3D%22en-US%22%3ERe%3A%20Printing%20API%20for%20Desktop%20apps%20hosting%20Edge's%20WebView%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842962%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239638%22%20target%3D%22_blank%22%3E%40Elliot%20Kirk%3C%2FA%3E%26nbsp%3BThanks!%20That'd%20be%20a%20very%20useful%20feature%20for%20corporate%20applications%20that%20IE%20always%20has%20had%2C%20unlike%20Chrome.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-861470%22%20slang%3D%22en-US%22%3ERe%3A%20Printing%20API%20for%20Desktop%20apps%20hosting%20Edge's%20WebView%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-861470%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403731%22%20target%3D%22_blank%22%3E%40noseratio%3C%2FA%3E%26nbsp%3Bthanks%20for%20bringing%20this%20up!%20Today%20we%20support%20printing%20in%20WebView2%20(I%20assume%20you're%20asking%20about%20this%20-%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fwebview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2Fwebview%3C%2FA%3E)%20through%20calling%20the%20web%20API%20%60window.print()%60.%20See%20similar%20issue%20and%20code%20sample%20on%20GitHub%20-%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoftEdge%2FWebViewFeedback%2Fissues%2F7%23issuecomment-505971520%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FMicrosoftEdge%2FWebViewFeedback%2Fissues%2F7%23issuecomment-505971520%3C%2FA%3E%2C%20and%20let%20me%20know%20if%20this%20works%20for%20you.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-862127%22%20slang%3D%22en-US%22%3ERe%3A%20Printing%20API%20for%20Desktop%20apps%20hosting%20Edge's%20WebView%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-862127%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F335108%22%20target%3D%22_blank%22%3E%40liminzhu%3C%2FA%3E%26nbsp%3Bthanks%20for%20replying.%20Unfortunately%2C%20window.print()%20is%20so%20much%20less%20than%20Internet%20Explorer's%20WebBrowser%26nbsp%3B%20hosting%20has%20to%20offer%20for%20printing.%20With%20IE%2C%20we%20had%20full%20control%20over%20pagination%20etc%20with%20%3CA%20href%3D%22https%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Faa753280(v%3Dvs.90)%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIE%20Print%20Templates%3C%2FA%3E.%20There's%20nothing%20like%20that%20in%20Edge.%20I%20suppose%20we'll%20have%20to%20pursue%20other%20options%20like%20PDF.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-862183%22%20slang%3D%22en-US%22%3ERe%3A%20Printing%20API%20for%20Desktop%20apps%20hosting%20Edge's%20WebView%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-862183%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403731%22%20target%3D%22_blank%22%3E%40noseratio%3C%2FA%3E%26nbsp%3Bif%20there%20is%20something%20you%20need%20that%20window.open()%20cannot%20provide%2C%20we're%20definitely%20open%20to%20take%20that%20feedback%20and%20look%20into%20supporting%20it.%20Specifically%20about%20templates%2C%26nbsp%3B%40media%20(%3CA%20href%3D%22https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FCSS%2F%40media%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FCSS%2F%40media%3C%2FA%3E)%20is%20a%20potential%20way%20to%20programmatically%20style%20your%20printing.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
noseratio
New Contributor

Hi, does Edge team have plans to provide/expose an API to control printing functionality, something similar to Internet Explorer Print Templates and IDM_PRINT etc commands?

5 Replies
Highlighted

@noseratio, I have sent an email asking the team that own this what their plans are.  I will respond back when I hear something.  Thanks - Elliot

@Elliot Kirk Thanks! That'd be a very useful feature for corporate applications that IE always has had, unlike Chrome.

@noseratio thanks for bringing this up! Today we support printing in WebView2 (I assume you're asking about this - https://aka.ms/webview) through calling the web API `window.print()`. See similar issue and code sample on GitHub - https://github.com/MicrosoftEdge/WebViewFeedback/issues/7#issuecomment-505971520, and let me know if this works for you. 

@liminzhu thanks for replying. Unfortunately, window.print() is so much less than Internet Explorer's WebBrowser  hosting has to offer for printing. With IE, we had full control over pagination etc with IE Print Templates. There's nothing like that in Edge. I suppose we'll have to pursue other options like PDF. 

@noseratio if there is something you need that window.open() cannot provide, we're definitely open to take that feedback and look into supporting it. Specifically about templates, @media (https://developer.mozilla.org/en-US/docs/Web/CSS/@media) is a potential way to programmatically style your printing. 

Related Conversations
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
PacketMon Components are not loading in WAC 1909
HotCakeX in Windows Admin Center on
2 Replies