简体   繁体   English

检测 PDF 是否在 Java 中是黑白的

[英]Detect if a PDF is black and white or not in Java

I have to print hundreds of single page PDF files and I wonder if I can detect if a PDF is black and white or color, I want to send black and white pdfs to a print queue and color ones to another.我必须打印数百个单页 PDF 文件,我想知道是否可以检测 PDF 是黑白还是彩色,我想将黑白 pdf 发送到打印队列并将彩色发送到另一个。

I'm processing these pdfs in Java, can someone suggest me some technique?我在 Java 中处理这些 pdf,有人可以建议我一些技术吗?

I think you could give a try to PDFBox我想你可以试试 PDFBox

In this example they extract an.icc (color profile) so may be what you are looking for.在此示例中,他们提取 an.icc(颜色配置文件),因此可能是您要查找的内容。

How do you extract color profiles from a PDF file using pdfbox (or other open source Java lib) 如何使用 pdfbox(或其他开源 Java 库)从 PDF 文件中提取颜色配置文件

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

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