Welcome Guest Search | Active Topics | Sign In | Register

CSP Blocking PDF Printing in EO.WebBrowser Options
Virgile Wicky
Posted: Tuesday, April 7, 2026 5:35:35 AM
Rank: Member
Groups: Member

Joined: 10/6/2016
Posts: 10
Hi Support Team,

we are using EO.WebBrowser (version 25.1.35.0) in our application.
Within our web application, PDFs are rendered using embedpdf for React and displayed correctly. However, when users attempt to print these PDFs, the operation fails due to a Content Security Policy (CSP) violation, which appears to be blocked by the embedded browser.

Could you please advise whether this is a known limitation or configuration issue in EO.WebBrowser?
Additionally, are there recommended settings or workarounds to allow PDF printing in this scenario?
Thank you in advance for your support.
Kind regards,
Virgile
eo_support
Posted: Wednesday, April 8, 2026 8:29:38 AM
Rank: Administration
Groups: Administration

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

How do you print the PDF file? We tested build 25.1.35 with the following steps and it appears to work:

1. Run TabbedBrowser sample application;
2. Load embedpdf demo page: https://app.embedpdf.com/
3. Click the "=" button for the PDF Viewer, then select "Print";

This successfully sends the PDF to the printer. So your steps must be different. Please let us know the details of your steps so we can test here again.

Thanks!
Virgile Wicky
Posted: Wednesday, April 8, 2026 3:38:00 PM
Rank: Member
Groups: Member

Joined: 10/6/2016
Posts: 10
Hello Team,

Our steps are the same. But we found out that when the setting Download PDFs is activated in Chrome
then we receive the following error :
Uncaught SecurityError: Failed to read a named property 'print' from 'Window': Blocked a frame with origin "https://app.embedpdf.com" from accessing a cross-origin frame.

It works properly in the Chrome Web Version if we activate the other setting - Open PDFs in Chrome.

In our EO Browser we receive always the error mentioned above. Is there a way to change the corresponding / equivalent setting for EO browser?
eo_support
Posted: Wednesday, April 8, 2026 3:55:37 PM
Rank: Administration
Groups: Administration

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

EO.WebBrowser does not have the settings equivalent to Chrome's Download PDF/Open PDF.

You keep saying "in our EO Browser we always receive the error". However we tested with TabbedBrowser and it worked fine. So maybe there is something different between how your code uses EO.WebBrowser and how TabbedBrowser sample uses it?

Thanks!
Virgile Wicky
Posted: Thursday, April 9, 2026 12:23:17 PM
Rank: Member
Groups: Member

Joined: 10/6/2016
Posts: 10
Thank you for your response.
I will try to describe what we are doing in more detail.

The DLL dependencies used in our project are:
EO.Base.dll
EO.WebBrowser.dll
EO.WebBrowser.Wpf.dll
EO.WebEngine.dll
EO.Wpf.dll
eowp.exe


Our WPF application contains your WebView in its view model, which loads the URL of our React web application.
After a user action, a PDF generated by the backend is displayed using embedPDF. The PDF is accessed via a blob URL.
When the user tries to print this PDF, the CSP violation described previously occurs.
Is this description clear and comprehensive enough, or do you need more details?
I noticed that I cannot attach screenshots in this forum. This would make it easier to explain the issue.
Is there a way to share screenshots?

Thank you in advance for your help.
eo_support
Posted: Friday, April 10, 2026 10:28:05 AM
Rank: Administration
Groups: Administration

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

Please try to find out who is calling window.print in your code and see if you can replace it with WebView.Print. We verified that both blob Url and printing blob Url works correctly with the latest build (build 26.1.34). We use the following test file:

test.html

Code: HTML/ASPX
<div id="div1">
	Please Wait...
</div>
<a id="link1" href="#" target="test" style="display:none;">Click To Open PDF in a new tab</a>
<script>
(async () =>
{
  //Create a blob url from an online PDF file
  var url = "https://s29.q4cdn.com/175625835/files/doc_downloads/test.pdf";
  const response = await fetch(url);
  const blob = await response.blob();

  //Update link1's href to the blob Url
  url = URL.createObjectURL(blob);
  var div = document.getElementById("div1");
  div.style.display = "none";
  var link = document.getElementById("link1");
  link.href = url;
  link.style.display = "";
})();
</script>


We then follow these steps:

1. Use TabbedBrowser sample application to load test.html;
2. Click "Click To Open PDF in a new tab" link when it appears;
3. This opens a new tab with the PDF file. Notice it has a blob Url in the address bar;
4. Print the PDF file by clicking the print button in the PDF viewer;
5. Print the PDF file by pressing Ctrl + P shortcut;

Both cases the PDF file prints out fine. This means printing blob Url for PDF file is working correctly.

The difference between your code and this test case appears to be how the printing is triggered. In this test case:

Step 4: The printing is triggered by direct user action;
Step 5: The printing is triggered by calling WebView.Print method (TabbedBrowser sample application handles Ctrl + P shortcut and calls WebView.Print);

In your code, it appears that JavaScript from another origin is calling window.print method that violates CORS rule. This violation is a security feature by design so you are not supposed to be able to get around it through JavaScript. However if you call WebView.Print directly through your code then such check will be bypassed because WebView.Print originates from the embedder (your code), not JavaScript from another origin. So if you replace your printing code with WebView.Print you should not run into this issue.

Hope this helps. Please feel free to let us know if you still have any questions.

Thanks!


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.