Encode window.file in PDFViewer as well