package nrreal.projects.twain4j.test;

/**
 *
 * @author theboshy
 */
public class TestTwain {

    private static final String LIB_X32 = "nrreal/projects/twain4j/lib/x32";
    private static final String LIB_X64 = "nrreal/projects/twain4j/lib/x64";
    private static final String ARCHITECTURE_X32 = "32";

    public static void main(String[] args) {
        String arch = System.getenv("PROCESSOR_ARCHITECTURE");
        String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
        String realArch = arch.endsWith("32") || wow64Arch != null && wow64Arch.endsWith("32") ? "32" : "64";
        if (System.getProperty("os.name").startsWith("windows")) {
            if (realArch.equals(ARCHITECTURE_X32)) {
                System.load(LIB_X32);
            } else {
                System.load(LIB_X64);
            }
        }
    }
}

@@ -34,16 +34,86 @@
 est;%0D%0A%0D%0A
+import java.io.IOException;%0D%0Aimport org.omg.CORBA.SystemException;%0D%0A%0D%0A
 /**%0D%0A *%0D
@@ -737,24 +737,47 @@
 ndows%22)) %7B%0D%0A
+            try %7B%0D%0A    
             
@@ -826,32 +826,36 @@
                 
+    
 System.load(LIB_
@@ -857,24 +857,95 @@
 (LIB_X32);%0D%0A
+                    System.out.println(%22cargada lib twain x32 %22);%0D%0A    
             
@@ -950,24 +950,28 @@
   %7D else %7B%0D%0A
+    
             
@@ -993,24 +993,206 @@
 (LIB_X64);%0D%0A
+                    System.out.println(%22cargada lib twain x64 %22);%0D%0A                %7D%0D%0A            %7D catch (SystemException e) %7B%0D%0A                System.out.println(e.getMessage());%0D%0A
             

ugtf os = win