def rawlayout_pdf(request, pdf):
doc = to_doc(as_path(pdf))
script_params = {
'pdfPath': reverse('raw_pdf', kwargs={'pdf': pdf}),
'workerSrc': static('ombpdf/js/pdf.worker.bundle.js'),
}
html, ctx = rawlayout.to_html(doc)
return render(request, 'ombpdf/rawlayout.html', {
'doc': doc,
'html': SafeString(html),
'script_params': SafeString(json.dumps(script_params)),
**ctx,
})
评论列表
文章目录