首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用apacheFOP将图像转换为pcl

使用apacheFOP将图像转换为pcl
EN

Stack Overflow用户
提问于 2016-03-02 01:07:38
回答 2查看 694关注 0票数 0

我有一个要求,我想要将GIF图像转换为PCL,并使用Apach FOP从打印机的特定托盘打印该pcl文件。我能举个例子吗?

EN

回答 2

Stack Overflow用户

发布于 2016-03-02 01:42:58

您可以查看以下文件:

https://github.com/apache/camel/blob/master/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopOutputType.java#L0

代码语言:javascript
复制
    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;
    }
票数 0
EN

Stack Overflow用户

发布于 2016-03-02 02:04:29

这可能会对你有所帮助:code example

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35729027

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档