JSFiddle - React, Tailwind, and code Playground

PDF Uptowork exporter

by Nalin Sajwan

JavaScript

function printDiv(printId) {

	var divToPrint = document.getElementById(printId);

	var newWin = window.open('','Print-Window');

	newWin.document.open();

	newWin.document.write(`<html>
		<style type="text/css">.page .dRow .dCol .section .entry+.entry { margin-top: 0px !important; } .page .dCol .section.sectionType7 .entry .rating { padding: .2rem 0px !important; }</style>
		<link rel="stylesheet" href="//cdn-assets.zety.com/assets/css/creator/fonts/arimo.css" />
		<link rel="stylesheet" href="//cdn-assets.zety.com/assets/css/1552566671/creator.css" />
		<link rel="stylesheet" href="//cdn-assets.zety.com/assets/css/1552566671/print.css" />
		<link rel="stylesheet" href="//cdn-assets.zety.com/assets/css/1552566671/style.css" />

		<body onload="window.print()">${divToPrint.innerHTML}</body>
	</html>`);

	newWin.document.close();
}

printDiv("creatorContainer");