PDFlib pCOS サンプル集(クックブック)
   
  
  
                            
                            pCOS インターフェースで、PDF 文書に含まれる色分解の情報を出力するサンプルプログラムです。
                            必要な製品:pCOS インターフェース(PDI、PPS、TET、PLOP、PLOP DS、TET PDF IFilter に内蔵されています。)
                            
                            
                                
/*
 * Print information about the color separations in the document.
 *
 * Required software: pCOS interface 8 (PDFlib+PDI/PPS 9, TET 4.1, PLOP 5.0)
 * Required data: PDF document
 */
package com.pdflib.cookbook.pcos.pages;
import com.pdflib.IpCOS;
import com.pdflib.cookbook.pcos.pcos_cookbook_example;
public class page_separationinfo extends pcos_cookbook_example {
    /* This is where the data files are. Adjust as necessary. */
    private final static String SEARCH_PATH = "../input";
    public void example_code(IpCOS p, int doc) throws Exception {
        System.out.println("File name: " + p.pcos_get_string(doc, "filename"));
        int pagecount = (int) p.pcos_get_number(doc, "length:pages");
        for (int page = 0; page < pagecount; page++) {
            System.out.print("Page " + (page + 1) + ": ");
            String objtype = p.pcos_get_string(doc, "type:pages[" + page
                + "]/SeparationInfo/DeviceColorant");
            if (objtype.equals("name") || objtype.equals("string"))
                System.out.println("\""
                    + p.pcos_get_string(doc, "pages[" + page
                        + "]/SeparationInfo/DeviceColorant") + "\"");
            else
                System.out.println("no device colorant name available");
        }
    }
    public page_separationinfo(String[] argv, String readable_name,
        String search_path) {
        super(argv, readable_name, search_path);
    }
    public static void main(String argv[]) {
        page_separationinfo example = new page_separationinfo(argv,
            "SeparationInfo", SEARCH_PATH);
        example.execute();
    }
}
                             
                         
                     
                    
                    (Nov 10, 2010 - Oct 19, 2022)