async function openMyPDF(pdfURL,annotsURL,annotsFileFormat){
let annotsData,options;
if(annotsURL){
var response = await fetch(annotsURL)
if(annotsFileFormat == "json"){
annotsData = await response.json();
options = {
annotsJson:annotsData
}
}else if(annotsFileFormat == "fdf"){
annotsData = await response.arrayBuffer();
options = {
fdf:{file:annotsData}
}
}
}
var pdfdoc = await pdfui.openPDFByHttpRangeRequest({
range:{
url:pdfURL,
},
},options)
}
var annotsURL1 = "http://10.204.1.109:8081/%E6%B5%8B%E8%AF%95%E6%96%87%E4%BB%B6/comments.fdf";
var annotsURL2 = "http://10.204.1.109:8081/%E6%B5%8B%E8%AF%95%E6%96%87%E4%BB%B6/comments.json";
var pdfURL = "http://10.204.1.109:8081/%E6%B5%8B%E8%AF%95%E6%96%87%E4%BB%B6/FoxitPDFSDKforWeb_DemoGuide.pdf";
//openMyPDF(pdfURL,null,null)
//openMyPDF(pdfURL,annotsURL1,"fdf")
openMyPDF(pdfURL,annotsURL2,"json")