我正在使用Viewer V7和Autodesk.PDF扩展名以显示多页pdf。这是一个源片段:
var pdf = 'http://localhost/test.pdf';
Autodesk.Viewing.Initializer(optionsLocal, function onInitialized() {
viewer = new Autodesk.Viewing.Private.GuiViewer3D(viewerDiv);
viewer.setTheme("light-theme");
var errorCode = viewer.start();
viewer.loadExtension('Autodesk.PDF').then( () => {
viewer.loadModel( pdf, {page: 1}, onDocumentLoadSuccess, onDocumentLoadFailure);
viewer.loadExtension("Autodesk.Viewing.MarkupsCore")
viewer.loadExtension("Autodesk.Viewing.MarkupsGui")
viewer.loadExtension("Autodesk.DocumentBrowser")
});
});
我想显示两个按钮来同时滚动pdf一页。 如何确定pdf的页数(长度)?如何在所需页面上“跳转”?
我不能使用类似文章中描述的方法,例如:
Autodesk Forge viewer renders only single page for PDF files
我的文件未通过派生服务转换,因此我无法调用例如:
var viewableItems = Autodesk.Viewing.Document.getSubItemsWithProperties(modelDocument.getRootItem(), {'type':'folder','role':'viewable'}, true);
提到的onDocumentLoadSuccess回调对于获取可见列表不可用,因为方法loadModel不会传递文档实体。 我正在使用DocumentBrowser扩展来浏览整个pdf,但是,如何确定用户选择的页面?
感谢您的支持。 加布里埃。
答案 0 :(得分:0)
根据Forge Viewer的使用条款,Autodesk Forge查看器只能用于查看由Autodesk Forge服务生成的文件
/*!
* LMV
*
* Copyright 2019 Autodesk, Inc.
* All rights reserved.
*
* This computer source code and related instructions and comments are the
* unpublished confidential and proprietary information of Autodesk, Inc.
* and are protected under Federal copyright and state trade secret law.
* They may not be disclosed to, copied or used by any third party without
* the prior written consent of Autodesk, Inc.
*
* Autodesk Forge Viewer Usage Limitations:
*
* The Autodesk Forge viewer can only be used to view files generated by
* Autodesk Forge services. The Autodesk Forge Viewer JavaScript must be
* delivered from an Autodesk hosted URL.
*/