简体   繁体   English

如何将文件加载到 Kendo PDF Viewer?

[英]How can load file to Kendo PDF Viewer?

I have the following PDF Viewer in my view, How can I update pdf.File(Url.Content("~/pdf/test.pdf") based on the selected project.我有以下 PDF 查看器,如何根据所选项目更新pdf.File(Url.Content("~/pdf/test.pdf")

 <div id="preview">
            
            @(Html.Kendo().PDFViewer().Name("pdfPreview")
                .PdfjsProcessing(pdf => pdf.File(Url.Content("~/pdf/test.pdf")))
                .Toolbar(toolbar =>
                        toolbar.Items(items =>
                        {
                            items.Add().Name("pager");                               
                        })
                    )
                    .Height(701)
                )
        </div>

   

You can load the pdf like so - I can't test this right now, so there may be some typo's but this is based on the example located here: https://demos.telerik.com/aspnet-mvc/pdfviewer/api您可以像这样加载 pdf - 我现在无法测试,所以可能会有一些错字,但这是基于位于此处的示例: https : //demos.telerik.com/aspnet-mvc/pdfviewer/api

    $.ajax({
        url: `/product/product/pdfDocumentread?documentID=${documentID}&productID=${productID}`,
        type: 'GET'
    })
    .done(function(data) {
       //here I want to load data.DocumentFilePath to PDF preview
       var pdfViewer = $("#pdfPreview").data("kendoPDFViewer");
       pdfViewer.fromFile(data.DocumentFilePath)
    })

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将从 http 调用收到的 pdf 加载到查看器中? - How to load a pdf received from an http call into the viewer? 使用 pdf 文件反应文件查看器 - React file viewer with pdf file 如何使用Kendo将多个div导出到一个pdf文件? - how can I export multiple divs to one pdf file by using kendo? 在iframe中IE 11 PDF查看器隐藏的Kendo窗口? - Kendo window hidden by IE 11 PDF viewer in an iframe? 如何检测是否在Chrome pdf查看器中打开了PDF - How to detect if PDF is opened in chrome pdf viewer 使用 Javascript 将我自己的 PDF 文档加载到 Syncfusion PDF 查看器中 - Load my own PDF document into Syncfusion PDF viewer using Javascript 如何在页面加载时单击剑道网格第一行 - How can i click kendo grid first row on page load 如何将PDF加载到blob中以便上传? - How to load a PDF into a blob so it can be uploaded? 有什么方法可以在浏览器中显示pdf文件,以便查看器只能读取该文件,而不能以任何形式保存/下载/打印该文件 - Is there any way to display pdf files in browser such that the viewer can only read the file and can't save/download/print the file in any form pdf.js默认查看器不显示pdf文件 - pdf.js default viewer doesn't show pdf file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM