Questions tagged [printjs]

A tiny javascript library to help printing from the web.

Print.js is a tiny javascript library to help printing from the web. Print friendly support for HTML elements, image files and JSON data.

74 questions
51
votes
4 answers

Force print dialog in mobile Safari for multi page PDF

How to force a working print dialog for a multi page (printing the first page is working) PDF in mobile Safari? Side info: If I "long tap" the PDF in mobile Safari I get a "Save image as" dialogue. Maybe the mobile Safari implementation renders the…
Paul Vincent Beigang
  • 2,972
  • 2
  • 16
  • 31
7
votes
3 answers

How to print multiple PDF's using print.js in angular 9

I have tried to print PDF by using print.js library and it's working fine for single PDF print. now when I am trying to print multiple PDFs, it's throwing an error: ERROR Multiple Choices.. also, I have tried with plain JS but it prompts multiple…
Priyank
  • 3,778
  • 3
  • 29
  • 48
7
votes
2 answers

How to stub contentwindow.print with cypress/test printJS with cypress

My program uses printJS which a library that helps format the content of the page for printing. I wanted to write tests with cypress to test that the print preview has been called. Currently I have a button that calls printJS when clicked and since…
4
votes
0 answers

Printing Bootstrap Form Selections Using Printjs

I'm using http://printjs.crabbly.com/ to print a defined area on an HTML page (a form) using the HTML output functionality of the library. I'm having trouble getting printjs to print out selections from dropdowns in a form. When you print HTML with…
3
votes
2 answers

Angular printjs: ERROR TypeError: Object(...) is not a function

I'm trying to use printJS in Angular and print an image (PNG). I did the import: import { printJS } from "print-js/dist/print.min.js"; Then I execute this printing code in function, according to the documentation: printJS('no-image.png',…
XardasLord
  • 1,764
  • 2
  • 20
  • 45
2
votes
0 answers

Trying to print on thermal printer using print.js

Trying to print a pdf receipt, but it adds empty spaces on top and bottom. const responseBlob = new Blob([pdfBlob], { type: 'application/pdf' }); const fileURL = URL.createObjectURL(responseBlob); setPreview(false); // printJS(fileURL); …
2
votes
0 answers

How do I activate all chartjs content in bootstrap tabs without clicking on each tab?

I am using printjs to print a chosen html element from my page. That element contains a series of bootstrap tabs. In each tab are some chartjs charts. The print button will only work after I have clicked on each of the three tabs, and therefore I…
petworthnick
  • 205
  • 2
  • 11
2
votes
2 answers

OnPrintDialogClose method was not fired after print preview closed

Hi I am using PrintJs javascript library. I assigned a call back function in OnPrintDialogClose option. It didn't fired immediately after the print preview window was closed but it only fired after I switched to new browser tab or I press Alt+Tab on…
Sithu Kyaw
  • 393
  • 1
  • 4
  • 16
2
votes
1 answer

PrintJs - Cors issue on android chrome browser

Trying to load an external pdf url for print using PrintJS, getting SecurityError: Blocked a frame with origin "URL" from accessing a cross-origin frame. Same application is working fine in Chrome browser on windows.
Krishnakumar C
  • 179
  • 1
  • 9
2
votes
1 answer

Parameter type not assignable in printjs

I'm trying to use printJS in Angular, and it was Ok until I had to use the multiple images feature. I was getting a error of printJS is not defined, and after searching for solution for the import I got here:…
1
vote
0 answers

Generate pdf from HTML string with styles net core blazor

Currently, I have an HTML string to generate the PDF. The number of pages will vary according to the data which will be added to this HTML string. Note: this HTML is a complete HTML string not div or p tags I need to print the number of pages in the…
smith
  • 73
  • 1
  • 8
1
vote
0 answers

printjs with vuejs : don't use my css for renderer

I use printjs with vuejs for print a specific page. But he don't accept my css. My code : print() { Printjs({ printable: "print-form", type: "html", css: '../src/assets/css/print.css', …
Arnaud
  • 121
  • 2
  • 6
1
vote
0 answers

crabbly / Print.js Print not working, Print Preview not showing

We are using 1.6 of crabbly/Print.js https://github.com/crabbly?tab=repositories https://printjs.crabbly.com/ It works just fine until this setting in edge is turned on. This is our code. const bytes =…
user575219
  • 2,346
  • 15
  • 54
  • 105
1
vote
1 answer

Printing a Base64 file using Print.js

So I am trying to print a Base64 file but im not sure why it doesn't print the file. function convertToBase64() { var selectedFile = document.getElementById("inputFile").files; if (selectedFile.length > 0) { var fileToLoad =…
Shatsuki
  • 50
  • 3
  • 19
1
vote
0 answers

Print a set width and height using PrintJS

I'm trying to print a receipt using PrintJS, however, I can't seem to be able to print a receipt that ends after the data end, instead, it acts as A4 paper. printJS({ printable: "printable", type: "html", targetStyles:…
Alitron
  • 108
  • 2
  • 8
1
2 3 4 5