我要求我想将GIF图像转换为PCL,并使用Apach FOP从打印机的特定托盘打印该pcl文件。我可以举个例子吗?
答案 0 :(得分:0)
您可以查看以下文件:
pdf("application/pdf"),
ps("application/postscript"),
pcl("application/x-pcl"),
png("image/png"),
jpeg("image/jpeg"),
svg("image/svg+xml"),
xml("application/X-fop-areatree"),
mif("application/mif"),
rtf("application/rtf"),
txt("text/plain");
private final String outputFormatExtended;
FopOutputType(String outputFormatExtended) {
this.outputFormatExtended = outputFormatExtended;
}
public String getFormatExtended() {
return outputFormatExtended;
}
public static FopOutputType asFooOutputType(String outputFormatExtended) {
if ("application/pdf".equalsIgnoreCase(outputFormatExtended)) {
return pdf;
} else if ("application/postscript".equalsIgnoreCase(outputFormatExtended)) {
return ps;
} else if ("application/x-pcl".equalsIgnoreCase(outputFormatExtended)) {
return pcl;
} else if ("image/png".equalsIgnoreCase(outputFormatExtended)) {
return png;
} else if ("image/jpeg".equalsIgnoreCase(outputFormatExtended)) {
return jpeg;
} else if ("image/svg+xml".equalsIgnoreCase(outputFormatExtended)) {
return svg;
} else if ("application/X-fop-areatree".equalsIgnoreCase(outputFormatExtended)) {
return xml;
} else if ("application/mif".equalsIgnoreCase(outputFormatExtended)) {
return mif;
} else if ("application/rtf".equalsIgnoreCase(outputFormatExtended)) {
return rtf;
} else if ("text/plain".equalsIgnoreCase(outputFormatExtended)) {
return txt;
}
return null;
}
答案 1 :(得分:0)
这可能会对您有所帮助:code example