so i want to print pdf using button and javascript but it will always produce blank pdf/empty pdf. i want something like https://i.stack.imgur.com/2Bm7o.jpg, but i got this instead https://i.stack.imgur.com/nYVuq.jpg
i try using window.open and then window.print but it still produce blank pdf, i also tried to put url inside window.open instead of declaring it first but that didn't work
HTML
<button type="button" onclick="printme()">click me...</button>
JavaScript
function printme(){
var URL = "https://www.detik.com/";
var W = window.open(URL);
W.window.print();
}