gpt4 book ai didi

javascript - 嵌入文档时不需要的页面边框

转载 作者:行者123 更新时间:2023-11-27 22:55:35 24 4
gpt4 key购买 nike

我可以在 Chrome 的新标签页中显示 pdf。但是我在页面周围看到了不需要的框架。

我使用对象标签来嵌入文档,但我也使用 iframe 始终显示边框(frameborder 设置为 0),同时使用样式我没有得到更好的结果。我认为问题是当我创建一个新文档时,这会创建一个我不需要的 html 结构。

这是我的 javascript 代码:

var windowTab= window.open();
var blob = new window.Blob([response], { type: 'application/pdf' });
var file = URL.createObjectURL(blob);
windowTab.document.write('<object data="' + file + '" style="border:0px; margin:0px; padding:0px;
width:100%; height:100%;" allowfullscreen></object>')

这是生成的 html:

<html>
<head>
</head>
<body>
<!-- This is my document !-->
<object data="blob:http://localhost:8080/f3a8347d-1052-4460-acc8-ecb8d6be0861" allowfullscreen="">
<!-- this html is unnecessary -->
<html>
<head></head>
<body>
<embed width="100%" height="100%" src="about:blank" type="application/pdf"
internalid="CAE747DCA94CCEFA3C50345F9D12986A">```</body>
</html>
</object>
</body>
</html>

最佳答案

尝试将所有 border 设置为 0pxnone

body,
html,
object,
embed{
border: 0px !important;
}

Reference Link

关于javascript - 嵌入文档时不需要的页面边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59265200/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com