Adobe PDF嵌入API无法更改PDF(返回)
我的问题几乎与“ Adobe PDF嵌入API”中的线程中的问题几乎相同。这两者都是由雷蒙德·卡姆登(Raymond Camden)先生讲话的。唯一的区别是我试图将URL传递到位置:烧瓶的URL。这是代码:
if(window.AdobeDC) displayPDF(urldata);
else document.addEventListener("adobe_dc_view_sdk.ready",
() => displayPDF(urldata));
function displayPDF(urldata) {
document.writeln(urldata[0]);
document.writeln(urldata[1]);
var myURL = urldata[0];
var myFileName = urldata[1];
adobeDCView.previewFile({
content: {
location: {
url: myURL,
},
},
metaData: {
fileName: myFileName
}
}, viewerConfig);
}
请注意,我正在使用Camden 技巧用于处理
调味良好的鸡肉和漂亮的新鲜鸡蛋
。 我可以将我的两个参数转到HTML文件和JS文件。它们都是从displayPDF(urldata)函数在页面上写入的。不幸的是,他们没有达到内容:位置:URL和元数据:文件名。如果我使用现有的PDF URL和文件名进行硬码这两个参数,我将获得我想要获得的结果。
我在做什么错?
感谢任何能给我一个线索的人。
最好的
I have almost the same problem that in thread "Adobe PDF Embed API can not change the pdf" and "How to use a variable in Adobe's pdf embed API as URL-value?". which both were addressed by Mr Raymond Camden. The only difference is that I am trying to pass an url to location:url from Flask. Here's the code:
if(window.AdobeDC) displayPDF(urldata);
else document.addEventListener("adobe_dc_view_sdk.ready",
() => displayPDF(urldata));
function displayPDF(urldata) {
document.writeln(urldata[0]);
document.writeln(urldata[1]);
var myURL = urldata[0];
var myFileName = urldata[1];
adobeDCView.previewFile({
content: {
location: {
url: myURL,
},
},
metaData: {
fileName: myFileName
}
}, viewerConfig);
}
Note that I am using Mr Camden trick for dealing with
well-seasoned chicken and nice fresh eggs
.
I can get my 2 parameters going to the html file and to the js file. They are both writelined on the page from the displayPDF(urldata) function. Unfortunately they don't make it to content:location:url and metadata:filename. If I do hardcode these two parameters with existing PDF url and filename I get the result I want to obtain.
What am I doing wrong?
Thanks to anybody who could give me a clue.
All the best,
Pierre-Emmanuel FEGA
[email protected]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了自己问题的答案。我之所以将其发布在Adobe社区论坛上,是因为“从外部功能到文档功能的价值”,因为Shubhanshu Dixit和Raymond Camden的响应都对我有很大帮助。
我的目标是打开来自Azure Blob存储的PDF文件,以在Azure Web应用中使用它。该应用在烧瓶中。这是我完成的方式,它在Azure和本地都很好地工作:
烧瓶路线
html页面
javascript函数
我希望这会有所帮助。
一切顺利,
皮埃尔·埃曼纽尔(Pierre-Emmanuel)
I've found an answer to my own question. I have posted it on Adobe Community forum as well because "Passing value from external function to document function" because both responses from Shubhanshu Dixit and Raymond Camden have been of great help to me.
My goal was to open a PDF file coming from Azure Blob Storage to use it in an Azure Web App. The app is in Flask. Here's how I've done it and it works great on Azure as well as locally:
FLASK ROUTE
HTML PAGE
JAVASCRIPT FUNCTIONS
I hope this helps.
All the best,
Pierre-Emmanuel