我面临PDF呈现问题。
下面的代码在整个HTML页面上显示PDF,但是我希望仅在Div元素内查看PDF。
我该如何实现?
with open('C:\Users\Satheesh\Downloads\form.pdf', 'rb') as pdf:
response = HttpResponse(pdf.read(), content_type='application/pdf')
response['Content-Disposition'] = 'inline;filename=some_file.pdf'
return response
pdf.closed