在 Linux 环境中创建 dwg 的缩略图
创建一个 Ruby on Rails 站点,使用 RMagick 为多种类型的图像创建缩略图。然而 RMagick 无法读取 dwg 文件。
我尝试了一些方法,研究了 Java 库 JDWGLib,它可能允许我编写一个转换器,但这将是一个从头开始的解决方案,我只需要一个缩略图。
还考虑使用查看器程序在远程 X 会话中打开文件并进行屏幕捕获,但是我不确定如何保证在截取屏幕截图时查看器已完成打开。
除了创建缩略图之外,我不关心能否操作文件。它将用于商业目的,因此使用的任何库都需要兼容。
Creating a ruby on rails site that uses RMagick to create thumbnails for many types of images. RMagick cannot read dwg files however.
I've tried a few things, looked into the Java library JDWGLib, which would probably allow me to write a converter, but it would be a total from the ground up solution, where I just need a thumbnail.
Also considered using a viewer program to open the file in a remote X session and do a screen capture, however I'm not sure how I could ever guarantee that the viewer had completed opening when I took the screenshot.
I'm not concerned with being able to manipulate the file other than to create the thumbnail. It is going to be used for commercial purposes, so any libraries used need to be compatible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
cad2svg 是一个简单的 Linux 命令行实用程序,可自动将 AutoCAD 文件(dwg 和 dxf)转换为 SVG。
链接
cad2svg is a simple Linux command-line utility that automatically converts AutoCAD files (both dwg and dxf) to SVG.
the link
我找不到任何可以在 Windows 或 Linux 上制作缩略图的命令行工具。
我想您可以下载 DWGdirect lib (C++),它允许将 DWG 导出到位图...但这需要购买“开放”设计联盟的会员许可证 。
我建议在您的表单上添加一个额外的文件输入,显示“缩略图”。并让用户提供屏幕截图。
I could not find any command-line-able tool for making thumbnails, on either windows or linux.
I guess you could download the DWGdirect lib (C++) wich allows the exportation of a DWG to a bitmap... but this requires purchasing a membership license on the """Open""" Design Aliance.
I would recommend adding an additional file input on your form that says "thumbnail". And let the users provide the screenshots.