Autodesk Forge Viewer – PDF and DWF

huangapple go评论79阅读模式
英文:

Autodesk Forge Viewer - PDF e DWF

问题

我们正在使用Forge通过Viewer Autodesk来查看DWF和PDF文件。
根据您的指导:https://aps.autodesk.com/blog/dwf-and-pdf-support-forge-viewer。

  • 查看DWF和/或PDF中的多个页面的命令或扩展是什么?(我有一个DWF或PDF文件,想要查看其中包含的所有页面(工作表))。

  • 我们可以从DWF文件中的工作表中应用白色背景吗?

英文:

We are using Viewer Autodesk via Forge to view dwf and pdf.
As per your guidance: https://aps.autodesk.com/blog/dwf-and-pdf-support-forge-viewer.

  • What is the command or extension to view more than one sheet in dwf and/or pdf? (I have a dwf or pdf file and I want to see all the pages (sheets) contained in this file.)

  • Can we apply the white background in the sheet from dwf file?

答案1

得分: 2

你可以使用 Autodesk.DocumentBrowser 扩展,它列出文档中的所有 可视内容。你可以通过层次结构或缩略图来访问它们。

如果你想通过代码访问不同的可视内容,可以使用以下代码来获取它们:

var viewables = viewerDocument.getRoot().search({'type':'geometry'});

而不是使用以下代码:

var defaultModel = viewerDocument.getRoot().getDefaultGeometry();

这将为你提供所有可以在查看器中显示的视图或图纸的列表。

然后,如果你只想筛选出 3D 或 2D,你可以在搜索查询中添加角色筛选器:

var twoDviewables = viewerDocument.getRoot().search({'type':'geometry', role: '2D'})

英文:

You can use Autodesk.DocumentBrowser extension which list all viewables of your document. You can access them by the hierarchy or by thumbnails.
Autodesk Forge Viewer – PDF and DWF
Autodesk Forge Viewer – PDF and DWF

If you want to access different viewables by code you can get them with:

var viewables = viewerDocument.getRoot().search({'type':'geometry'});

instead of doing
var defaultModel = viewerDocument.getRoot().getDefaultGeometry();.

This will give you the list all of the views or sheets you can display in the viewer.

Then if you want to filter only 3D or 2D, you can add a role filter in the search query:
var twoDviewables = viewerDocument.getRoot().search({'type':'geometry', role: '2D'})

huangapple
  • 本文由 发表于 2023年4月6日 20:37:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/75949604.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定