Am I missing something with this function?
I can execute other functions on the document but not getViewerCoordinates.
I am using version 2.2.1
var viewerElement = document.getElementById("viewer");
var myWebViewer = new PDFTron.WebViewer({
path: "lib",
type: "html5",
initialDoc: "
https://azure.blob/doc.xod",
azureWorkaround: true,
config: "config.js",
enableAnnotations: true
}, viewerElement);
$(document).on('documentLoaded', function () {
var docViewer = readerControl.docViewer;
var doc = docViewer.getDocument();
var num = doc.getPageCount(); // executes correctly
var coords = doc.getViewerCoordinates(1, x, y); // errors
}
I want to translate pdf coordinates into canvas coordinates I can use in annotation:draw