views.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:omb-eregs 作者: 18F 项目源码 文件源码
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,
    })
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号