Printing with JavaScript made easy | Print.js

preview_player
Показать описание
PrintJS is a tiny (yet powerful) JavaScript library to help printing from the web.

You can print HTML pages, PDFs, JSON objects, images and much more using this JavaScript library.

My JS Fiddles:
--
Timestamps
0:00 Intro to PrintJS
2:33 Printing a Pdf
3:51 Use-cases for PrintJS
5:22 Printing HTML
8:23 Printing Images
10:08 Printing JSON
11:26 Printing Styled JSON
13:01 PrintJS Error Handling
14:18 Wrap Up
--
If you’re just as crazy for tech as us, we’d love to keep you around. You can also find us at:

We’ll be waiting to catch up with a fellow techie:)
Рекомендации по теме
Комментарии
Автор

Can we hide the preview of print directly make print if yes how pls help

Kaushik-fh
Автор

i planned to make direct print, so i added --kiosk-printing to my chrome so it did not show pop up dialog print, but when i tried to print pdf from url it show error "Something went wrong when trying to print. Please check your printer and try again." what should i do? can you help, please?

fachrirezasetiadiputra
Автор

How can I choose one of the operating system printers?

vinibarr
Автор

But this library is not working for mac safari browser it is showing blank pages when we do print.

azharuddin
Автор

is there a way to print html with 2 div?

michaelangeloserban
Автор

Any planned update to handle a memory stream?

milesgibson
Автор

Hi, Is it possible print multiple pdf files with one printing dialog without merge. Actually if I merge 1000 pdf files and each pdf size in 5 mb it will create 5 gb file which will hang my brouser. So can I use forloop kind of thing with single dialog?

chandandey
Автор

I got a Reference Error it says that printJS is not defined but I downloaded the github zip and paste the js files into my project, I don't know what to do because this library is really new. Btw I am not a JS developer and I am relatively new so be patient pls

alfonsopineda
Автор

is it possible to print docx/xlsx file using the same way as pdf?

sanaullahaq
Автор

THX for the video is there a way To print without box from Windows i mean how to print automatically only when we press the button print it is print directly

nassimamrane
Автор

Is Possible to print ZPL or EPL commands using Printjs?

mukeshmanoharan
Автор

Can you print directly without a system dialog ?

pratikjain
Автор

how to repeat column heading in next page while printing

ajithkumarkumar
Автор

Do you know if it is possible to use the print js function with one file instead of a whole html project? I just want to be able to pass one line of code to automatically print a pdf file with one click.

GoostavaRS
Автор

Will this also be able to include a css watermark in the print?

firmbutton
Автор

still its showing preview window, how about define a printer, how it is different than built print....

webscaffolder
Автор

EVEN BOTH FILES ARE IN SAME DIRECTORY
WORK FINE WITH JPG FILE<SAME DIRECTORY AS PDF AND HTML>

dipakpatil
Автор

Welcome to Canada. Could someone please show me how to print a variable object of a html element?

yehudaclinton
Автор

Hi! How to force the PDF file size (A4 or A5). Sometimes I need to print landscape A5 size and sometimes I want to print A5 portrait. I always set the correct page size when the Print Dialog appears even I set it in PrintJS parameter data.

jozsefvereb
Автор

Hi, this looks just the thig for me. I have tried adding it to a Wordpress site but with limited success. The iframe is hidden and no styling at all is used even though the cdn style sheet is enqueued. Is it possible to use it in Wordpress? Could you point me to any documentation that would help me please? Thank you for any help you can give.

ianbrown