r/programmingrequests • u/networkhappi • Feb 16 '17
[REQUEST] Simple JavaScript (or something front-end friendly) code that prints page of a website at 7:00pm every day?
I have a webpage that acts as a report that parses a .csv sheet and then colorizes it based on numeric thresholds (0-50 is green, 50-100 is yellow, +100 is red).
The problem is, you won't get the colors if you open the .csv directly, the colorization is done through a JavaScript framework for data visualization.
I would like a simple code that I can add to the .html that just prints the webpage 7:00pm every day and exports it either in an image format (.png, .jpg) or more preferably a .pdf format.
The webpage is in an IIS web server environment.
1
1
Feb 24 '17
I did some quick research.
I haven't tested it out since it's night time and I don't have a printer, but here are a few links to do it in pyfhon hopefully.
This one should let you download a website to a PDF.
This one should let you send a PDF to a printer.
This one should allow you to check the time.
This one lets you check every x minutes.
You'd just need to have a computer that is attached to the printer running constantly. But hopefully it helps anyway.
1
u/ErezYehuda Feb 17 '17
In all browsers that I know of, JS can bring up the print dialog, but can not authorize an actual print, for numerous good reasons. JS would save you maybe 3 seconds at most from bring up the dialog yourself; you may as well just do it manually.