简体   繁体   English

怎么把doc和pdf文件转换为图像文件?

[英]how to convert doc file and pdf file to image file?

What is the best open source java api for converting of doc and pdf file into any image file? 什么是将doc和pdf文件转换为任何图像文件的最佳开源Java API? Any suggestion will be appreciated. 任何建议将不胜感激。

This question already has multiple answers here on SO. 这个问题在SO上已经有多个答案。 Just search for "doc file to image" or "PDF to image". 只需搜索“ doc file to image”或“ PDF to image”。

But in short, there are many different methods. 简而言之,有许多不同的方法。 The main ones seem to be: 主要的似乎是:

  1. To use a dedicated API, made specifically for this task (PDF Box seems to be popular). 若要使用专用于此任务的专用API(PDF Box似乎很受欢迎)。
  2. Parse the Doc or PDF file and rasterize it to turn it into an image (what the APIs do?). 解析Doc或PDF文件并将其栅格化以将其转换为图像(API会做什么?)。

OR 要么

  1. Install a printer-emulator driver, open word/PDF invisibly, and use the printer-emulator to "print" the document, but instead of sending the bytes to an actual, physical printer, the emulator prints to a new PDF or image file. 安装打印机仿真器驱动程序,以不可见的方式打开word / PDF,然后使用打印机仿真器“打印”文档,但是仿真器不会将字节发送到实际的物理打印机,而是打印到新的PDF或图像文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM