Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
How can I implement image acquisition from hardware scanner in Windows? I found JTwain library, but it's commercial. Is there any free frameworks? Any information about this?
Here's an article discussing how to implement your own API using TWAIN (confusingly also called JTwain).
From the article:
Java's lack of a standard
image-acquisition API is an oversight
that hopefully will be rectified in a
future release. Until that time,
however, we can either purchase a
commercial API or create our own API.
We can base our API on either of the
TWAIN or SANE specifications. So far,
we've only looked at TWAIN, in terms
of the big picture and important
details. We have also explored the
very simple TWAIN-based JTwain API and
played with a simple JTwainDemo
application that demonstrates JTwain.
If it's for personal or educational use, maybe you can use Morena: http://www.gnome.sk/Twain/jtp.html
Unfortunetely, if it's for commercial use you will have to pay for it.
There is EZTwain, which I was coding from jni and getting objects ( actual java objects that showed up and were usable in Java on the Java side after being constructed with all that L stuff. Never got past the dib struct pointers ... ended up looking the fool in front of Spike ( he was a true professional about it ) and before I could get the dib stuff within comprehension I crashed Whino the Poo at the root and lost data-up-link to the wooly-web and as well had to go to work in a factory to meet needs.
I'm sure I salvaged much of the code as I was digging around in the data-recovery stuff I did where I saved the "D" work that I was beginning. I had intended to do an ocr character recognition as I have a statewide organization with hundreds of real people doing legitimate work and the central office is bogged by primitive data entry methods that would never scale to the volume that is just down the road.
The license for EZTwain is well implemented as it takes much of the commercial territory as reserved for their legitimate commercial turf. I really think it would be funny as an interview question to discuss Sarbanes-Oxley auditor independence as a function of Gaussian kernel radius in the Canny edge detection algorithm. ( in Java - Tom Gibara )
I'm sure they would ask me the "O" of the thing, I'd say "Oh!"
Which is about what you would say after a few hundred func names in JNI.
( not trying to be funny, it's just that this is why you don't see a lot of development in this area )
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am working at a desktop project (develop with swing) which works with wide range of old and new scanner devices.
We want an open source and free library that can work with scanner devices. Scanner standards like Twain , ... are not important for us, supporting wide range of scanner under Windows (XP and 7) is very important for us.
Please share your experience about this subject with me.
Thanks.
Well I think TWAIN should be very important to you, because it is the data acquisition standard. Virtually all scanners come with TWAIN drivers giving you a standard interface. So what you really need is a Java TWAIN library. Unfortunately, there is no good open source library.
Out of commercial offerings consider: JTwain and Morena. I think Morena has a "Personal Licence", which is free, but not suitable for a commercial project.
You can also try these JARs from here. They were developed by someone on the net whose site is now dead, but you can reverse engineer it with JAD quite easily to get the API list.
I don't know about open source, but you use to be able to get a "personal" license for Morena 6 which was free.
You really want TWAIN support. Coding to a device specific API is not very reusable. If you are looking for a free solution and are familiar with JNI then I wrote an article with the most basic solution and free source code for Java and C++. The article is here. If you are looking for a low cost solution then you may try JTwain
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Can anybody help me by suggesting the name of an converter which converts C# code to Java code. Actually, I have a tool which is written in C# code and I am trying to modify it. As I have no idea about C# and .NET framework, it seems difficult to me to convert the large code by my own. I found from some web information that there exist some tools which can convert C# to Java (may not be properly, however they can). Can anybody help me by suggesting some name of those tools.
Disclaimer: No tool is perfect.
However, if you still want to try then there are these converters available:
CS2J
JCLA : Convert Java-language code to C#
Grasshopper
CSharpJavaMerger
Tangible Software C# to Java Converter
Not a converter but a bridge between .NET and the JVM:
JNI4NetBridge
You are better off doing it by hand. I've used code conversion software before, and it just mucks everything up. Sure, it corrects a few syntax differences, but largely what you'll get is just a mess of code that doesn't compile right away anyway.
With a converter you'll have to do a lot of corrections anyway. Why not take the small amount of extra time it will take to convert it by hand and end up with better code?
Even if you don't know C#, it will be better to learn it and do the conversion by hand, as I said before you will have to do it anyway. C# and Java are not too different syntactically, but as #Marc pointed out above, there are certainly gaps in the language. Simple C# is easily translated to Java, of course having to use the Java BCL instead of the .NET, which certainly have their differences. As you get into more complicated C#, there are things that have no direct equivalent.
Keep in mind, that conversion projects can be extremely time-consuming and are extremely effective at swallowing money in a business environment.
A google search will yield you some commercial options, but I'm not going to post them here, simply because I'm against that sort of thing. There are some things you just can't automatically translate.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I'm a systems engineer, recent college grad, and I've just been given a project that is exceptionally daunting.
We have a legacy system, we legally own the entire code and all rights to it. The problem is that the code is poorly documented, what little documentation is incomplete, sometimes wrong and the original devs are unavailable.
It uses a custom Perl build script requires a thousand modules from CPAN to work and I do not know Perl. Reverse engineering into UML has failed except with Doxygen and that is limited to just inheritance diagrams and call graphs.
I've obtained a massive chalkboard and I'm slowly trawling through the code, modeling packages and then the nested packages within.
My question is whether or not I'm approaching this reverse engineering from the right direction. I'm working close from the bottom trying to figure out what calls what while developing UML and writing a Design Document. I did a package diagram but it's hard to figure out what's going on at that high a level.
An academic paper I pulled up suggests I also make a new Requirements Document which would slow me down even more and I don't know if it's a good idea as the other developers are always busy trying to keep the legacy system up.
Are there any books out there that can help me and am I approaching this from the right angle? Should I hire a contract worker that knows Perl and JMX to assist me?
The book "Working Effectively with Legacy Code" by Michael Feathers will probably help you more than anything we can tell you here.
However, the most important thing you need to clarify for yourself (and from your question it sounds like it's not completely clear) is this: what is your goal? What do you want to achieve with this codebase?
If the answer is (as it sounds) "being able to effectively maintain the existing project", then trying to directly build a complete high-level model of the system may not be the most effective path. It's probably just too much at once to keep in mind.
In this case, I would try to understand only the use cases of the system that you currently need to modify; follow method calls through the code (pssibly using a debugger on the running system) to see what parts are involved. Do this for a few different use cases and you'll start to see patterns, then document those and gradually fit them together into a high-level image of the system.
This tool might assist you.
Or if the legacy system is written poorly it could just make a huge unreadable mess, but I hope it helps.
If it is a java code then a deep reverse engineering would be very helpful.
See a documentation at: http://www.ejb3.org/jar_file_reverse/jar_file_reverse.html
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 months ago.
Improve this question
I'm looking for a well-maintained Java bytecode manipulation library with an intuitive API. There seem to be quite a lot of them out there. Any suggestions on which ones to try?
The best answer to your question will be governed by your specific needs and objectives; if you can expand upon what you're trying to accomplish, I can perhaps offer a more tailored response.
In lieu of that, however, in my experience, ASM offers probably the best combination of maturity, flexibility, and ease-of-use:
It's under relatively active development: even though the latest release is from June 2009, developers are regularly making commits to their VCS.
It's already in wide use in a number of prominent Java products, such as AspectJ, Groovy, Cobertura, and many others, which promises a wide user-base and thus a wide community for support.
It's fairly thoroughly documented, and there are a number of tutorials, user guides, and reference documents available both from the OW2 Consortium and the community at large.
N.B. The comment #Yuri left below describes a situation I personally haven't yet encountered but that may potentially pose a significant obstacle. Keep his observation/experience in mind while evaluating the various bytecode manipulation libraries.
That actually depends on how you define intuitive ;-) I started using ASM two weeks ago for a certain task on my current project and it worked like a charm. It only took me a couple hours to understand it and be able to use it, but I wouldn't exactly call the API intuitive. But if you know a little bit about Java bytecode and are familiar with the visitor pattern, the learning curve is not very high, IMO.
Another advantage of ASM is that it is apparently bundled with the standard API at least in the Sun JDK, although in a different package (com.sun.xml.internal.ws.org.objectweb.asm and subpackages).
Take a look at this article :
http://www.pabrantes.net/blog/space/start/2008-03-24/1
A little old but still relevant.
ASM And Javassist are the most used ones now.
Bcel is dying.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm working on building an app to scan directly from TWAIN scanner to a Java applet. I'm already aware of Morena and JTwain, but they cost money. I need free. I could re-invent the wheel with JNI, but it seems like someone has probably already done this as a FOSS tool.
Is anyone familiar with a free tool that can get a Java applet to read directly from a TWAIN scanner?
Calling the TWAIN API from anything except C/C++ is going to be a major pain, it relies entirely on complicated C structures that you have to replicate exactly in memory. If you need only fairly basic scanning, you could use something like GitHub site to call my old free 'EZTwain Classic' DLL (google for eztw32.dll)
hm. I might have some homebrew available for it somewhere I could check, but for now: At our company, we basically gave up on this issue and implemented an (unfortunately win only) ActiveX solution: Site Link
I've actually purchased the chestysoft activeX control. Been using it for about 3 years. Works great but as with all ActiveX you are restricted to IE. And this one is 32-bit only.
I'm looking into a flash approach now. Since flash can capture from a camera why not from a scanner. If I remember I'll report back what I find.