Bom dia,
alguem sabe uma api GRATUITA para digitalização de documentos em java?
eu vejo falar bastante em Jtwain mas é paga, preciso utilizar na empresa que trabalho.
URGENTEEE…
agradeço desde já…
Bom dia,
alguem sabe uma api GRATUITA para digitalização de documentos em java?
eu vejo falar bastante em Jtwain mas é paga, preciso utilizar na empresa que trabalho.
URGENTEEE…
agradeço desde já…
gratuita não conheço.
mas recentemente utilizei morena e jtwain para isso.
att,
Tenho um software de digitalização e nele utilizei o morena também.
Gratuita também não conheço nenhuma
abs,
Evandro
Evandro,
seu software roda na web?
att,
Bom dia Pedru,
Roda sim, porém a parte da digitalização chamo um jnlp para digitalizar, é tudo online até a chamada do jnlp, ou seja o usuário não precisa ficar “entrando” em outro sistema, a única diferença é que chamando o jnlp ele abre outra janela, como se fosse um popup.
Tentei fazer com applet, mas em alguns scanners o processo ficava extremamente lento por isso, se estiver pensando em fazer algo do genêro com o morena aconselho a repensar, no site deles tem informações sobre isso
http://www.gnome.sk/Twain/jtp_support.html
"Scanning or GUI loading is extremely slow.
According to our information, there are some scanners (CanoScan LiDE 20/30/50/60, Canon CR-180, DR-1210C, HP Scanjet 7800, Kodak i1220) which scan correctly from Java applications and WebStart applications, but scanning via applets takes too long. Morena is used with hundreds of scanners. We do not have the similar reports related to other scanners.
According to our tests, applet scanning speed does not depend on the operating system version, or USB type. It seems that there could be a correlation between the amount of the computer memory and scanning speed. We have also tested applets developed by other developers; the speed behavior was the same. The scanning speed is not dependent on the Morena Framework. We suspect that the problem may be caused by the following: Java JRE can manage how much stack and heap space it requires, but it cannot influence the stack and heap space requirements of the native JNI library. Because of this, the combined Morena JNI library , Internet browser, and Twain driver do not have enough heap or stack space. "
Qualquer dúvida entra em contato,
abraço,
Evandro
pois é rapaz
construiu um applet e fora a lentidão tem alguns detalhes q ficam limitados.
valeu a dica!
obrigado.
att,
Hehe, complicado mesmo, a minha foi uma evolução, eu tinha feito uma em desktop, mas que se comunicava toda via UrlConnection, daí evolui ela para applet, qdo fomos testar, foi aquele desastre, lento demais, a saida era voltar pra desktop, porém queria algo mais agil, e ficou sendo o jnlp mesmo,
qualquer coisa estamos por aqui, abraço,
Evandro
Valew pedruhenrik e Evandro_Contato…
preciso de uma solução gratuita…
será que NÃO EXISTE?
Cara, já vi algumas pessoas fazendo com outras alternativas, porém não me lembro o nome delas, dá uma procurada no google com twain + java que acho que aparecerá uma série de opções.
abraco e boa sorte aí,
Evandro
[quote=pedruhenrik]gratuita não conheço.
mas recentemente utilizei morena e jtwain para isso.
att,[/quote]
Ressucitando o TÓPICO…
PEDRUHERIK, Mais o MORENA não é gratuito?
e se puder me ajudar, estou implementando ele aqui.
e estou com os seguintes erros assim que inicializo:
Exception in thread "Thread-7" java.lang.NoClassDefFoundError: Could not initialize class SK.gnome.twain.TwainManager
java.lang.Error: Can't initialize Twain JNI library
[code]Aviso: não é possível ler o arquivo de propriedades do AppletViewer: C:\Users\Administrador.hotjava\properties usando padrões.
The license expired on 1/8/2011![/code]
se puder… vlwss.
ñ é.
vc pode utilizar ele com uma licença para fins ñ comerciais conforme os termos de uso.
se ñ me engano é valido por 3 meses e vc pode renovar a licença ñ comercial.
att,
ñ é.
vc pode utilizar ele com uma licença para fins ñ comerciais conforme os termos de uso.
se ñ me engano é valido por 3 meses e vc pode renovar a licença ñ comercial.
att,[/quote]
opa… blz. brigadão! agora já estou sabendo.
mais e os erros acima… vc tem alguma idéia?
Prezados bom dia!
Este foi o topico que encontrei que mais tem comentarios a respeito de digitalização por isto estou aproveitando o conhecimentos dos colegas envolvidos para ver se conseguem me ajudar.
Recentemente consegui uma biblioteca Mmscomputing para fazer scaneamento mais infelizmente não estou tendo sucesso e como não sou um expert em java não sei bem o que esta ocorrendo por isto vou postar aqui, estou utilizando um scanner o ScanExpress S40 da Mustek, então fiz um programa bem simples já para testa-lo.
o Log de erro no Netbeans é o seguinte ( qdo eu clico no botão para digitalizar )
run:
Device...
JarLib.load: Successfully loaded library [jar:file:/C:/Java/Lib/Mmscomputing/mmscomputing.jar!/uk/co/mmscomputing/device/twain/win32/jtwain.dll] from jar file location
Ouvinte..
Adquirir imagem...
uk.co.mmscomputing.device.twain.TwainSourceManager.<init>:
Twain 2.0 compatible : true
Estado: Source Manager Open
Estado: Source Manager Open
Estado: Source Manager Open
Dispositivo: [Ljava.lang.String;@c980c9
API Instalada, Nome dispositivo:
API Instalada! O nome do dispositivo:
Ok!
Existe algum erro?!
API Instalada! O nome do dispositivo: ScanExpress S40
uk.co.mmscomputing.device.twain.TwainIOException: uk.co.mmscomputing.device.twain.TwainScanner.setException:
uk.co.mmscomputing.device.twain.TwainSource.isOnline:
uk.co.mmscomputing.device.twain.TwainFailureException$CapUnsupported: Failed during call to twain source.
cc=Capability not supported by source
rc=1
at uk.co.mmscomputing.device.twain.TwainScanner.signalException(TwainScanner.java:131)
If - ScannerIOMetadata.NEGOTIATE
at uk.co.mmscomputing.device.twain.jtwain.signalException(jtwain.java:299)
at uk.co.mmscomputing.device.twain.TwainSource.isDeviceOnline(TwainSource.java:188)
at uk.co.mmscomputing.device.twain.TwainSourceManager.openSource(TwainSourceManager.java:103)
at uk.co.mmscomputing.device.twain.jtwain.cbexecute(jtwain.java:246)
at uk.co.mmscomputing.device.twain.jtwain.nstart(Native Method)
at uk.co.mmscomputing.device.twain.jtwain.access$200(jtwain.java:12)
at uk.co.mmscomputing.device.twain.jtwain$1.run(jtwain.java:349)
Estado: Source Open
Estado: Source Enabled
Neste momento aparece na tela a interface para eu fazer a digitalização ( o programa que vem com o scanner )
eu clico no botão para digitalizar e no log acrecenta-se o seguinte
Estado: Transfer Ready
Estado: Transferring Data
Estado: Source Enabled
Estado: Source Open
Estado: Source Manager Open
BUILD SUCCESSFUL (total time: 47 seconds)
O programa bem simples é este
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package br.com.scannercaptura;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import uk.co.mmscomputing.device.scanner.*;
import uk.co.mmscomputing.device.scanner.ScannerIOMetadata.Type;
/**
*
* @author Robson
*/
public class Main extends javax.swing.JFrame implements ScannerListener {
Scanner scanner;
/**
* Creates new form Main
*/
public Main() {
initComponents();
inicialize();
}
private void inicialize() {
setSize(709, 446);
setTitle("Teste Scanning");
}
private void doScannear() throws ScannerIOException {
System.out.println("Device...");
scanner = Scanner.getDevice();
System.out.println("Ouvinte..");
scanner.addListener(this);
System.out.println("Adquirir imagem...");
System.out.println("Dispositivo: "+ scanner.getDeviceNames() );
if (scanner.isAPIInstalled()) {
System.out.println("API Instalada, Nome dispositivo: "+ scanner.getSelectedDeviceName() );
} else {
System.out.println("API Não Instalada." );
}
scanner.acquire();
if (scanner.isAPIInstalled()) {
System.out.println("API Instalada! O nome do dispositivo: "+ scanner.getSelectedDeviceName() );
}
System.out.println("Ok!");
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jContentPanel = new javax.swing.JPanel();
jPanelTop = new javax.swing.JPanel();
jPanelCenter = new javax.swing.JPanel();
btnDigitalizar = new javax.swing.JButton();
jPanelBottom = new javax.swing.JPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jContentPanel.setLayout(new java.awt.BorderLayout());
jPanelTop.setPreferredSize(new java.awt.Dimension(400, 100));
javax.swing.GroupLayout jPanelTopLayout = new javax.swing.GroupLayout(jPanelTop);
jPanelTop.setLayout(jPanelTopLayout);
jPanelTopLayout.setHorizontalGroup(
jPanelTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
jPanelTopLayout.setVerticalGroup(
jPanelTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jContentPanel.add(jPanelTop, java.awt.BorderLayout.NORTH);
jPanelCenter.setLayout(new java.awt.GridBagLayout());
btnDigitalizar.setText("Digitalizar");
btnDigitalizar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDigitalizarActionPerformed(evt);
}
});
jPanelCenter.add(btnDigitalizar, new java.awt.GridBagConstraints());
jContentPanel.add(jPanelCenter, java.awt.BorderLayout.CENTER);
jPanelBottom.setPreferredSize(new java.awt.Dimension(400, 100));
javax.swing.GroupLayout jPanelBottomLayout = new javax.swing.GroupLayout(jPanelBottom);
jPanelBottom.setLayout(jPanelBottomLayout);
jPanelBottomLayout.setHorizontalGroup(
jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
jPanelBottomLayout.setVerticalGroup(
jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jContentPanel.add(jPanelBottom, java.awt.BorderLayout.PAGE_END);
getContentPane().add(jContentPanel, java.awt.BorderLayout.NORTH);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnDigitalizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDigitalizarActionPerformed
try {
doScannear();
} catch (ScannerIOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_btnDigitalizarActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
Main thisClass = new Main();
thisClass.setDefaultCloseOperation(3);
thisClass.setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnDigitalizar;
private javax.swing.JPanel jContentPanel;
private javax.swing.JPanel jPanelBottom;
private javax.swing.JPanel jPanelCenter;
private javax.swing.JPanel jPanelTop;
// End of variables declaration//GEN-END:variables
@Override
public void update(ScannerIOMetadata.Type type, ScannerIOMetadata metadata) {
if (type.equals(ScannerIOMetadata.ACQUIRED)) {
BufferedImage image = metadata.getImage();
System.out.println("Existe uma nova imagem!");
try {
ImageIO.write(image, "png", new File( "mmsc_image.png"));
} catch (Exception e) {
e.printStackTrace();
}
} else if (type.equals(ScannerIOMetadata.NEGOTIATE)) {
System.out.println(" If - ScannerIOMetadata.NEGOTIATE");
ScannerDevice device = metadata.getDevice();
try {
} catch (Exception e) {
System.out.println(" If - ScannerIOMetadata.NEGOTIATE Catch");
e.printStackTrace();
}
} else if (type.equals(ScannerIOMetadata.STATECHANGE)) {
System.err.println("Estado: " + metadata.getStateStr());
if (metadata.isFinished()) {
System.exit(0);
}
} else if (type.equals(ScannerIOMetadata.EXCEPTION)) {
System.out.println("Existe algum erro?!");
try {
System.out.println("API Instalada! O nome do dispositivo: "+ scanner.getSelectedDeviceName() );
} catch (ScannerIOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
metadata.getException().printStackTrace();
}
}
}
olá pessoal
estou utilizando a jtwain.dll para digitalizar documento
mas estou com um problema de memória do java, ao digitalizar documentos com mais de 3 páginas
alguém passou por isso, pode me ajudar ?
"Exception in thread “AWT-EventQueue-2” java.lang.OutOfMemoryError: Java heap space … "
já tentei aumentar a memória da jvm, sem sucesso
talvez utilizar buffer
verifica o processo pq vc deve estar usando mt memória p/ uma página e dps não libera esse espaço
Você conseguiu estou precisando da mesma aplicação será tem como me enviar ?
Bom dia!
Estou tentando fazer uma aplicacao de scannear de documento para meu trabalho da faculdade e não consegui. Teria como enviar a aplicação que você fez… código e JFrame para implementar no meu projeto?
Aguardo… Obrigado
Olá Adriano boa noite!
Cara este projeto não foi adiante, scanear e principalmente minha aplicação é em web e ai a coisa complicou, o que lembrava mais deste tópico aqui, o projeto eu não tenho contudo é um projeto pequeno e acredito que só tenha uma classe que a que eu postei aqui na integra então é só copiar o que vai faltar é a lib mmscomputing, esta eu devo ter aqui só procurar se te interessar.