Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1K
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda