Scan to PDF tool for Linux (only Linux)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Scan to PDF tool for Linux (only Linux)

Post by Kukulkan »

Hi harkon,

as you already found out, it has nothing to do with my tool. Looks like the sane driver for your specific scanner is not that good. The Windows drivers are mostly from the vendor and most of them are not delivering drivers for Linux. Before buying any devices, first check the Linux compatibility!

I'm just calling scanimage (the SANE comandline scan tool). I suggest to test using this tool directly. If you're on Ubuntu, you also may try to ask your question in the Ubuntu forums (they are quite good).

I've had similar issues with my fujitsu fi-4120C and solved it by installing more recent sane packages. The idea and help was also from the Ubuntu forum. So, maybe you give it a try?

Best,

Kukulkan
harkon
Enthusiast
Enthusiast
Posts: 217
Joined: Wed Nov 23, 2005 5:48 pm

Re: Scan to PDF tool for Linux (only Linux)

Post by harkon »

Thanks again. You are correct, the internet has many posts on the ScanJet3500C and sane. It's still a great too and points me in the right direction.

This scanner was free to me, so I can't complain. I do mostly run Windows in a VB VM along side my Mint host machine so it's not a problem, or at least not a new problem. Thanks again for posting this. I will be using it once I get a better scanner.
Missed it by that much!!
HK
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Scan to PDF tool for Linux (only Linux)

Post by Kukulkan »

Update:

If you get error "Error during save. Try again...", please edit /etc/ImageMagick-6/policy.xml and ensure this line (may already be there):

Code: Select all

<policy domain="coder" rights="read|write" pattern="PDF" />
You need root permission to edit this file (or use sudo).

Interestingly, it worked before and I've never had to edit this file before. It suddenly stopped working after some recent update of my Ubuntu 16.04 machine. Some update may have either added the line above with rights="none" or it was ignored before...
harkon
Enthusiast
Enthusiast
Posts: 217
Joined: Wed Nov 23, 2005 5:48 pm

Re: Scan to PDF tool for Linux (only Linux)

Post by harkon »

Thanks Kukulkin.

When I execute the debug window throws me some errors;
  • [08:26:24] Waiting for executable to start...
    [08:26:23] Executable type: Linux - x64 (64bit, Unicode)
    [08:26:24] Executable started.
    [08:26:39] [Debug] scanimage --device-name=hp3500:libusb:001:005 --batch --batch-start=1 --batch-count=1 --batch=out%03d.pnm --format=pnm --resolution 100
    [08:26:39] [WARNING] ScanToPDF.pb (Line: 84)
    [08:26:39] [WARNING] Gtk (CRITICAL): IA__gtk_window_set_default_size: assertion 'width >= -1' failed
    [08:26:39] [WARNING] ScanToPDF.pb (Line: 84)
    [08:26:39] [WARNING] Gtk (CRITICAL): IA__gtk_widget_set_size_request: assertion 'width >= -1' failed
    [08:28:02] The Program execution has finished.
When the scan completes I get no image in the window and the save fails. I did modify the imagemagik policy xml file per your recommendations, save still fails. Likely there is nothing to save? The scan does seem to complete without issue and is ready for the next, but ?
My still be an issue with this silly scanner, but the errors might be something you might want to know about.

*edit*
Just discovered that sometimes if I reopen the program and scan again, when the calculating scan time progress is finished, the last scan image is in the window, and that is the image that then gets saved to PDF. It's like it's one scan behind. Again, may be an issue with this stupid scanner, but I though I'd at least mention it.
Missed it by that much!!
HK
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Scan to PDF tool for Linux (only Linux)

Post by Kukulkan »

Hi harkon,

yes, sounds like an issue of either scanimage or the scanner itself. Please note that my program neither deals with the scanner directly nor controls it. It just calls scanimage and let it do the scanning job.

You may use the debugged line to test your scanner manually on the commandline/terminal. From your post, execute this:

Code: Select all

scanimage --device-name=hp3500:libusb:001:005 --batch --batch-start=1 --batch-count=1 --batch=out%03d.pnm --format=pnm --resolution 100
Does that work? You should be able to see any error messages here, because my tool does not really deal with errors (except it works or not).

[edit]I just remember that scanimage is having troubles with two sided scans and ADF. This also caused weird results for me. Maybe your scanner does that by default? Use scanimage -A to find possible options of your scanner. You can add them in the field of my tool. I have some Fujitsu scanner where I do --source "ADF Front" to let it use only the front page.

If the scanner is making trouble, I suggest to first try to make it work using commandline (you can take the debug output as a start and call scanimage --help for further options). By this you find the individual driver options and get direct feedback about possible issues.[/edit]
harkon
Enthusiast
Enthusiast
Posts: 217
Joined: Wed Nov 23, 2005 5:48 pm

Re: Scan to PDF tool for Linux (only Linux)

Post by harkon »

Thanks, probably the scanner driver. Either way, I just thought I'd relay the debug errors I was seeing.
Missed it by that much!!
HK
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Scan to PDF tool for Linux (only Linux)

Post by Kukulkan »

I just updated this tool to also allow saving password protected PDF files.

Hint:
You may need to install qpdf for this feature to work

Code: Select all

sudo apt-get install qpdf
harkon
Enthusiast
Enthusiast
Posts: 217
Joined: Wed Nov 23, 2005 5:48 pm

Re: Scan to PDF tool for Linux (only Linux)

Post by harkon »

Thanks for this @Kukulkan.

I will update my copy.
Missed it by that much!!
HK
Post Reply