LATEST - If you had difficulty registering recently please try again now we have found and fixed the problem.

PDFBeads — Convert Scanned Images to a Single PDF File

General discussion about software packages and releases, new software you've found, and threads by programmers and script writers.
loyukfai
Posts: 43
Joined: 24 Jan 2011, 02:37

Re: PDFBeads — Convert Scanned Images to a Single PDF File

Post by loyukfai »

Thanks!

BTW, I've posted a thread over at RubyForge (http://rubyforge.org/forum/forum.php?th ... m_id=31710) but no response thus far.

Cheers.
loyukfai
Posts: 43
Joined: 24 Jan 2011, 02:37

Re: PDFBeads — Convert Scanned Images to a Single PDF File

Post by loyukfai »

Tried adding "require 'rubygems'" to pdfbeads.rb as suggested here (http://rubyonwindows.blogspot.com/2009/ ... tchas.html). Now it doesn't complain during compilation, but the resulting .exe still doesn't work.

Code: Select all

C:/Users/LOYUKF~1/AppData/Local/Temp/ocrE651.tmp/lib/ruby/site_ruby/1.8/rubygems
/custom_require.rb:29:in `gem_original_require': no such file to load -- imagein
spector (LoadError)
        from C:/Users/LOYUKF~1/AppData/Local/Temp/ocrE651.tmp/lib/ruby/site_ruby
/1.8/rubygems/custom_require.rb:29:in `require'
        from C:/Users/LOYUKF~1/AppData/Local/Temp/ocrE651.tmp/lib/ruby/gems/1.8/
gems/PDFBEA~1.3-C/lib/pdfbeads.rb:88
Note: On another machine, had to copy these DLLs first...

Code: Select all

CORE_RL_bzlib_.dll
CORE_RL_lcms_.dll
CORE_RL_magick_.dll
CORE_RL_ttf_.dll
CORE_RL_zlib_.dll
X11.dll
Any help would be appreciated.

Cheers.
Last edited by loyukfai on 05 Jul 2011, 05:57, edited 1 time in total.
loyukfai
Posts: 43
Joined: 24 Jan 2011, 02:37

Re: PDFBeads — Convert Scanned Images to a Single PDF File

Post by loyukfai »

Tried another executable maker - exerb (http://exerb.sourceforge.jp/index.en.html)

Unfortunately, the .exe wouldn't run at all and complains...

Code: Select all

rbconfig.rb:7: ruby lib version (1.8.7) doesn't match executable version (1.8.6)
 (RuntimeError)
Google searches on the above give some results, but mostly in Japanese.

Also tried this, exerb-mingw (http://vert.igino.us/2011/01/05/exerb-1 ... with-ruby/), which managed to build an executable that runs and doesn't complain. However, the resulting pdf is 0-byte. (BTW, libiconv2.dll is required)

Cheers.
User avatar
Misty
Posts: 481
Joined: 06 Nov 2009, 12:20
Number of books owned: 0
Location: Frozen Wasteland

Re: PDFBeads — Convert Scanned Images to a Single PDF File

Post by Misty »

The "no such file to load" error is making me wonder - do you have ImageMagick set up on the system on which you're trying to run this on? The Windows version of RMagick distributed on their website includes an ImageMagick installer, and they suggest using that specific version of it.

exerb 4.2.0 uses Ruby 1.8.6. The compiled version of RMagick is also built for 1.8.6. What is the version of Ruby you have installed? 1.8.7? If so, you should remove it and install 1.8.6 from the installer at the RubyInstaller site.

While I understand you prefer portable apps, all this trouble you're going to is making me wonder whether it would just be easier to install the appropriate software on the computer you want to use it on. The Ruby installation is very lightweight on Windows; it all goes in one folder.
The opinions expressed in this post are my own and do not necessarily represent those of the Canadian Museum for Human Rights.
loyukfai
Posts: 43
Joined: 24 Jan 2011, 02:37

Re: PDFBeads — Convert Scanned Images to a Single PDF File

Post by loyukfai »

Misty wrote:The "no such file to load" error is making me wonder - do you have ImageMagick set up on the system on which you're trying to run this on? The Windows version of RMagick distributed on their website includes an ImageMagick installer, and they suggest using that specific version of it.
Sure, or else how did PDFBeads successfully run on it. ;)
Misty wrote:exerb 4.2.0 uses Ruby 1.8.6. The compiled version of RMagick is also built for 1.8.6. What is the version of Ruby you have installed? 1.8.7? If so, you should remove it and install 1.8.6 from the installer at the RubyInstaller site.
I did manage to build an executable with exerb without that error, but that executable doesn't work at all.
Misty wrote:While I understand you prefer portable apps, all this trouble you're going to is making me wonder whether it would just be easier to install the appropriate software on the computer you want to use it on. The Ruby installation is very lightweight on Windows; it all goes in one folder.
Tinkering with another's PC is a tricky issue, you know...
La_Tristesse
Posts: 11
Joined: 18 Jun 2011, 21:47

Re: PDFBeads — Convert Scanned Images to a Single PDF File

Post by La_Tristesse »

Misty wrote: Edit: Just found a trick I was not familiar with. To install jbig2enc without waiting for Homebrew to officially add it, use the following command:

Code: Select all

brew install https://raw.github.com/mistydemeo/homebrew/0c3427ee1e9be6aaaed5a15f8d0d6e63d610d2f1/Library/Formula/jbig2enc.rb
Did you deleted the formula because I'm getting an error:

Code: Select all

curl: (22) The requested URL returned error: 404
Error: Failure while executing: /usr/bin/curl -f#LA Homebrew\ 0.8\ (Ruby\ 1.8.7-249;\ Mac\ OS\ X\ 10.7) https://raw.github.com/mistydemeo/homebrew/0c3427ee1e9be6aaaed5a15f8d0d6e63d610d2f1/Library/Formula/jbig2enc.rb -o /Users/tristank/Library/Caches/Homebrew/Formula/jbig2enc.rb
Found the new one at:

https://raw.github.com/mistydemeo/homeb ... big2enc.rb
User avatar
Misty
Posts: 481
Joined: 06 Nov 2009, 12:20
Number of books owned: 0
Location: Frozen Wasteland

Re: PDFBeads — Convert Scanned Images to a Single PDF File

Post by Misty »

Sorry about that. I didn't realize that commit went away. I'll update the URL.

jbig2enc is still pending in Homebrew, but hopefully will make it in sometime.
The opinions expressed in this post are my own and do not necessarily represent those of the Canadian Museum for Human Rights.
lorenzodow
Posts: 6
Joined: 28 Apr 2011, 04:39

Re: PDFBeads — Convert Scanned Images to a Single PDF File

Post by lorenzodow »

I'm looking for an open source, free or cheapware way to do this, so I can appreciate the importance of this program, but I have to say, I don't really get how this is done. I downloaded and installed most of the programs (I think), but not being familiar with Ruby and being on a windows machine, I don't really understand what one is meant to do. Maybe I missed something?

Anyway, I wish success for the person trying to make an .exe! Or maybe I'll have to just break down and buy adobe acrobat pro...
La_Tristesse
Posts: 11
Joined: 18 Jun 2011, 21:47

Re: PDFBeads — Convert Scanned Images to a Single PDF File

Post by La_Tristesse »

I think I've discovered some kind of bug in pdfbeads. I tested it under Mac OS X Lion (10.7.0) and Ubuntu 10.4 LTS with the same errors. Basically I tried to convert the 156 tif-files of a ScanTailor output into a single hocr pdf. I think it must have something to do with the quantity of the tif-files, because when I run pdfbeads on a single file it works.

The Script:

Code: Select all

#! /bin/bash
for i in *tif; do tesseract $i $i -l deu hocr; done
echo Tesseract done
for i in *.tif.html; do mv "$i" "`basename $i .tif.html`.html"; done
echo file-renaming done
pdfbeads -b JP2 *.tif > out_pdfbeads.pdf  
Mac OS X:

Code: Select all

/Library/Ruby/Gems/1.8/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:399:in `initialize': wrong number of arguments (1 for 2) (ArgumentError)
	from /Library/Ruby/Gems/1.8/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:430:in `[]'
	from /Library/Ruby/Gems/1.8/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:430:in `getEncoding'
	from /Library/Ruby/Gems/1.8/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:429:in `each'
	from /Library/Ruby/Gems/1.8/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:429:in `getEncoding'
	from /Library/Ruby/Gems/1.8/gems/pdfbeads-1.0.3/lib/pdfbeads/pdfbuilder.rb:515:in `addFont'
	from /Library/Ruby/Gems/1.8/gems/pdfbeads-1.0.3/lib/pdfbeads/pdfbuilder.rb:302:in `process'
	from /Library/Ruby/Gems/1.8/gems/pdfbeads-1.0.3/lib/pdfbeads/pdfbuilder.rb:301:in `each'
	from /Library/Ruby/Gems/1.8/gems/pdfbeads-1.0.3/lib/pdfbeads/pdfbuilder.rb:301:in `process'
	from /Library/Ruby/Gems/1.8/gems/pdfbeads-1.0.3/bin/pdfbeads:198
	from /usr/bin/pdfbeads:19:in `load'
	from /usr/bin/pdfbeads:19
Ubuntu:

Code: Select all

/var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:400:in `sprintf': can't convert nil into Integer (TypeError)
	from /var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:400:in `block in initialize'
	from /var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:430:in `[]'
	from /var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:430:in `block in getEncoding'
	from /var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:429:in `each'
	from /var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/lib/pdfbeads/pdffont.rb:429:in `getEncoding'
	from /var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/lib/pdfbeads/pdfbuilder.rb:515:in `addFont'
	from /var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/lib/pdfbeads/pdfbuilder.rb:302:in `block in process'
	from /var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/lib/pdfbeads/pdfbuilder.rb:301:in `each'
	from /var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/lib/pdfbeads/pdfbuilder.rb:301:in `process'
	from /var/lib/gems/1.9.1/gems/pdfbeads-1.0.3/bin/pdfbeads:198:in `<top (required)>'
	from /var/lib/gems/1.9.1/bin/pdfbeads:19:in `load'
	from /var/lib/gems/1.9.1/bin/pdfbeads:19:in `<main>'
User avatar
Misty
Posts: 481
Joined: 06 Nov 2009, 12:20
Number of books owned: 0
Location: Frozen Wasteland

Re: PDFBeads — Convert Scanned Images to a Single PDF File

Post by Misty »

lorenzodow wrote:I'm looking for an open source, free or cheapware way to do this, so I can appreciate the importance of this program, but I have to say, I don't really get how this is done. I downloaded and installed most of the programs (I think), but not being familiar with Ruby and being on a windows machine, I don't really understand what one is meant to do. Maybe I missed something?

Anyway, I wish success for the person trying to make an .exe! Or maybe I'll have to just break down and buy adobe acrobat pro...
Can you tell me what steps you've done so far?

Yeah, it seems to be a lot harder to get running on Windows. I'm working on a solution to make it a lot easier on everyone, but no ETA at this time.

La_Tristesse: Hmmm, that def. looks like a bug in PDFBeads. Lazy_Kent, any ideas?
The opinions expressed in this post are my own and do not necessarily represent those of the Canadian Museum for Human Rights.
Post Reply