package epson.scan.lib;

import java.util.ArrayList;

public class libHaru {
    public native int EndDoc(String str);

    public native int addPage(String str);

    public native int initDoc();

    static {
        System.loadLibrary("haru");
    }

    public int createPDF(ArrayList<String> arrayList, String str) {
        int initDoc = initDoc();
        if (initDoc != 0) {
            return initDoc;
        }
        for (int i = 0; i < arrayList.size(); i++) {
            int addPage = addPage(arrayList.get(i));
            if (addPage != 0) {
                return addPage;
            }
        }
        return EndDoc(str);
    }
}
