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

154
Visualizações
Track the Number of Print command given

I want to keep the track of how many times the print command is given in my AngularJS project.

here is my code for printing a div -

vm.printWholeJob = function () {
            vm.printCount++;  // It is my print count.
            setTimeout(function () {
                var popupWin = window.open('', '_blank', 'width=1000,height=600');
                popupWin.document.write('<html><head><link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"><style>.print-table th, .print-table td {border: 1px solid #34495E !important;}  .print-table td, .print-table th {padding-bottom:5px  !important;padding-top: 5px !important;}@page {margin-top: 5.0cm;margin-bottom: 3.0cm;margin-right:1.8cm;}.data{page-break-before: always;}</style></head><body>' + document.querySelector('#job-to-print').innerHTML + '</html>');
                setTimeout(() => {
                    popupWin.print();
                    popupWin.close();
                }, 500);
            }, 800);

Here is the catch, I dont want to increase the count on these two cases -

  1. When the windows pops up for print preview and the user cancels it.
  2. When somebody prints it as PDF.

So I just want to track the number of times the page is actually got printed through the printer only.

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
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