0

我必须在新窗口中打开一个 pdf 文件。但是当它在新窗口中打开时,它会显示完整的路径,包括 ip 地址作为页面标题。我的需要是我必须手动给一个标题。

4

1 回答 1

2

The easiest way to change the title of the popup window would be to embed the PDF file (e.g. using an iframe) in a "wrapper" webpage with the desired title, and then open the wrapper page in your popup. Something like this:

<!DOCTYPE html>
<meta charset=utf-8>
<title>Form 1040</title>
<style type="text/css">
BODY { margin: 0; padding: 0 }
IFRAME { position: absolute; width: 100%; height: 100%; border: 0 }
</style>
<body>
<iframe src="http://www.irs.gov/file_source/pub/irs-pdf/f1040.pdf"></iframe>
</body>
于 2012-11-28T04:05:17.817 回答