Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

997
Views
window.print in Blazor WASM

I'm new to Blazor and I've been trying to find if there's any window.print() equivalent in Blazor. I wonder if there is any pre-made component/helper for this or do I need to create one from scratch? I've already searched enough and can't find any.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

There is no equivalent in blazor but you should consider adding a javascript file with a method with window.print(), reference it in index.html and call it with injected IJSRuntime.

Reference in index.html

<script src="js/script.js"></script>

Javascript file

function printInvoke() {
    window.print();
}

Example in component


@page "/print"
@inject IJSRuntime Js

<h3>PrintTest</h3>

<button @onclick="Print"></button>

@code {
    private async Task Print()
    {
        await Js.InvokeVoidAsync("printInvoke");
    }
}

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!