Skip to content

Various errors with the high level Java API #13

@mclem

Description

@mclem

Hello,

I am trying to the high level Java API but I cannot make it work consistently (my program is often stuck in the TwainSource.acquire()method). The target device is an Epson Perfection V600 but in my local development environment I am using the TWAIN2 sample DS.
The DTWDEMO.exe always works flawlessly so I suspect the problems are in the Java API or the JNI layer.

Here are some of the problems I encountered:

  1. Acquiring a PDF file

With DTWDEMO: twain_pdf_demo.log
Running PDFDemo.java: twain_pdf_jni.log

When I click on "Scan" the UI becomes stuck. I cannot close it by clicking on "Cancel".

There are a lot of errors and exceptions in the JNI log.
I also found these strange values in the log:

TW_MEMREF is TW_IMAGELAYOUT:
{
    Frame=0,0-0,0
    DocmentNumber=4294967295
    PageNumber=4294967295
    FrameNumber=4294967295
}

[2024-08-30 11:45:06] Thread [23412] Output: return code from DSM=1 (TWRC_FAILURE)

I noticed that the TW_FRAME.isFrameValid() method inacurrately returns true when all values are set to 0, because of the comparison with Double.MIN_VALUE:
image
If I define a frame size (ts.getAcquireCharacteristics().getPagesSupportOptions().getFrame().setRight(6).setBottom(10);) then it looks like the acquisition goes further but it does not complete too: twain_pdf_jni+frame.log

=> It seems impossible to acquire a file (even a simple BMP with TinyApplication.java)

  1. Acquiring to buffer

I am able to run the BufferAcquisitionDemo.java demo, however if I add a logger and enable it with twainSession.enableLogging(true) then the program stays stuck in the acquire method: twain_buf_jni+logging.log
Now if I disable logging just before calling acquire the demo works correctly: twain_buf_jni+notlogging.log

=> It is possible to acquire to buffer, but not if I collect logs

  1. With the EPSON V600

I have not been able to make a lot of tests yet, but I noticed that:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions