Using the PDFViewer with the latest version of PDF.js (3.9.179) throws js exceptions. Version 3.4.120 is the last one, with which no js exception is thrown.
Dojo example: https://dojo.telerik.com/IHedIhur/3
The file is loaded, however, js exceptions are thrown:
The --scale-factor
CSS-variable must be set, to the same value as viewport.scale
, either on the container
-element itself or higher up in the DOM. text_layer.js:480:14
No js exceptions when using PDF.js versions newer than v3.4.120.
Reproducible in the demos: https://demos.telerik.com/kendo-ui/pdfviewer/index
The zoom tool is disabled.
The zoom tool is enabled.
A server side exception:
System.OverflowException: 'Value was either too large or too small for a Double.'
is thrown on attempting to serialize an existing .pdf file converted to FixedDocument.
public ActionResult GetInitialPdf(int? pageNumber)
{
//exception with Development plan.pdf file:
string filePath = Path.Combine(Server.MapPath("~/Content/web/pdfViewer"), "Development Plan.pdf");
//it works with the sample.pdf file:
//string filePath = Path.Combine(Server.MapPath("~/App_Data"), "sample.pdf");
FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
JsonResult jsonResult;
FixedDocument doc = FixedDocument.Load(stream);
if (pageNumber == null)
{
jsonResult = Json(doc.ToJson(), JsonRequestBehavior.AllowGet);
}
else
{
jsonResult = Json(doc.GetPage((int)pageNumber), JsonRequestBehavior.AllowGet);
}
jsonResult.MaxJsonLength = int.MaxValue;
return jsonResult;
}
The exception is thrown during the FixedDocument JSON serialization:
doc.ToJson()
at the following place: ConvertToList method in ArrayExtension class (Telerik.Web.PDF namespace)
No exceptions are thrown during serialization.
There is empty title attribute of PDFViewer zoom level combobox
Empty "title" attribute
The "title" attribute of the combobox explains the purpose of the combobox, e. g. Zoom level combobox
The toolbar.click is not serialized correctly when a custom button is added to the ToolBar of the widget. Thus, the click event is not being executed.
@(Html.Kendo().PDFViewer()
.Name("test")
.PdfjsProcessing(pdf => pdf.File(""))
.Toolbar(t => t.Items(i =>
{
i.Add().Name("Open").Id("Open").Command("OpenCommand").Type("button").Icon("folder-open");
i.Add().Name("Print").Id("Print").Type("button").Icon("print").Click("onPrintClick");
}))
.Height(500)
)
<script>
function onPrintClick(e) {
alert(e);
}
</script>
toolbar is not serialized correctly.
toolbar.click should be serialized correctly.