Page 7 of 8

Re: Bindery

Posted: 13 Apr 2012, 06:59
by andres
I have a native installation of Ruby (with DevKit, ImageMagick, MingW etc.) with PDFBeads running all right, and any installers installing Ruby make me suspicious as they may mess up the existing installation (especially when the version being installed is older than what I have installed). Getting a working setup of Ruby with all the latest versions was quite an ordeal under Windows. :) There are no official installers that would actually work so it had to be done manually.

It seems that it is possible to make a standalone exe pack for Ruby (without any installers), as Misty did here: ... ads#p11379

Misty's exe worked (and works) fine on my computer as standalone, and the only problem with that exe is that it contains an outdated version of pdfbeads which had some problems with hocr. (That is why I installed Ruby + addons, all newest. I would have sticked to Misty's exe if it had been up to date.)

Re: Bindery

Posted: 13 Apr 2012, 12:22
by Anonymous2
I should ask Misty about her build procedure, as my pdfbeads EXE fails if ImageMagick isn't installed because RMagick doesn't load.

As for my installer for pdfbeads, it's more or less portable. It installs Ruby 1.87, DevKit, ImageMagick, hpricot, compiles rmagick, and finally installs pdfbeads all into the C:\Bindery\Tools\ folder.

Bindery scans for executables at startup, so if it can find pdfbeads, it will give you the option to bind your book into a PDF file. My installer isn't necessary at all.

The Bindery executable I'm working with right now works well for Windows XP, but right now I'm working on fixing PATH problems. I'll have to temporarily inject Bindery's bin/ folder into the system PATH if dependencies aren't installed.

Hopefully I can get a standalone version of Bindery up and running some time today.

Re: Bindery

Posted: 13 Apr 2012, 18:17
by Anonymous2
After a ton of testing, I think I've fixed Bindery for Windows.

I'm not sure what the problem really was but switching back to Python2 and using PyInstaller instead of cx_freeze solved the problems for me.

The executable works for me under Windows XP 32-bit SP3. If anyone else could test it, that would be great!

Download it here

Re: Bindery

Posted: 13 Apr 2012, 20:45
by andres
As for my installer for pdfbeads, it's more or less portable. It installs Ruby 1.87, DevKit, ImageMagick, hpricot, compiles rmagick, and finally installs pdfbeads all into the C:\Bindery\Tools\ folder.
This may cause some path conflicts (if any of those applications are already installed — whatever comes on the path first will be used) but resolving them for each case would be extremely difficult for Windows. Therefore, it seems to me that the only good solution for Windows (XP or 7) is packing pdfbeads into an exe and not installing anything. Some time ago I contacted Misty via PM and he (or really she? :) ) said he was going to make a new exe but I have not heard about it since. He also told me that I was the first person to give any feedback. If more people asked, maybe he would have more motivation for this ? :) If there is no hocr involved, Misty's exe actually works fine and maybe you can even use that version for the time being?

It seemed to me when I installed PDFBeads that there may occur several version conflicts which may (and did) prevent PDFBeads from working. My properly working combination is as follows (in the order that I installed them) but note that this is a 'native-type' installation, at least one component of which cannot be put to work easily with the usual Windows installers:

Ruby 1.9.3, bin on the system path
DevKit 4.5.2 (and then gem update --system), bin on the system path
ImageMagick 6.7.5-10-Q16 (first exe and then also dll, both should be installed), on the system path
ImageMagick 6.7.5-10 Source
MingW 20111118
RMagic 2.13.1 (gem install rmagick --platform=ruby -- "--with-opt-include=[path_to_imagemagick]/source" "--with-opt-lib=[path_to_imagemagick]")
JBIG2 copied into ImageMagick's folder (as it is on the system path)
HPricot 0.8.6 (gem install hpricot --platform=ruby)
PDFBeads 1.0.8 (gem install pdfbeads)

All this may also work for others who want to use PDFBeads on Windows with the latest versions of Rmagic and HPricot.
The executable works for me under Windows XP 32-bit SP3. If anyone else could test it, that would be great!
Indeed, now Bindery started well under XPSP3 and it looks nice with Windows Classic theme! For real testing I must take some time, hope to do it as soon as possible. The Tools menu and About Bindery are not working but in general all is looking good.

Re: Bindery

Posted: 14 Apr 2012, 09:11
by andres
The "Browse" function for selecting input directory does not work and therefore I cannot test any further at this moment.

The Add page dialog opens from the toolbar, though, it's just that when I click "Browse", nothing happens. From the lower part of the window or from the menu, Add page dialog does not open.

On the other hand, the Browse function works for selecting the output file.

Edit menu does not open. About Qt menu does not open. Help->Help does not open. About Bindery does not open.

Re: Bindery

Posted: 15 Apr 2012, 03:14
by Anonymous2
I noticed that the SVG icons weren't showing up in the binary at all, so I've converted them to PNG and they seem to work now. I've also fixed the buttons and menu entries.

Can you test this one for the same problems?

Download Bindery 2.7.3 here

Re: Bindery

Posted: 15 Apr 2012, 20:46
by andres
When starting Bindery, now a console window appears (Found embedded PKG... etc.) in addition to the GUI window. Basically, the console window can be accepted but it would probably be preferred not to have this window around in the final version. Later, that console window gives massive errors about "Cannot open file ... icons/image-loading.svg"

The menu items work now.

Input directory selection results in no files being added, although ScanTailor tiffs are in that directory. The directory itself is added with a semicolon at the end of the line.

Add page button works. When selecting all and adding the pages, the famous Windows bug appears: the order is otherwise correct but the last file becomes the first. (instead of 0001...0018, it goes 0018, 0001...0017). This can be regarded as a cosmetic bug (but still a bug though) and can be fixed with one click. This bug has been in the Windows OS since Windows95, I guess.

Typo in the OCR tab: Cuniform (should probably be "Cuneiform")

Adding pages and encoding in DjVu results in a DjVu file, from which the one coloured page I had (the cover) has been omitted. The monochrome part has been converted into DjVu, apparently correctly. Bindery closes itself unexpectedly after completing the DjVu conversion.

Creating a PDF with pdfbeads results in "Windows Error [Error 2] The system cannot find the file specified." (in the console window)

In Bindery's directory, two (apparently temporary files) appear: temp_graphics.tif and temp_textual.tif - these files are not removed when Bindery closes.

and... I am still a little worried in the question of whether Bindery adds anything to any environment variables but it seems (and I hope) it does not...

Otherwise, still looking good :)

Re: Bindery

Posted: 15 Apr 2012, 22:21
by Anonymous2
Thanks once again. I've never had problems with encoding either PDF or DjVu files, so it's probably a Windows-related problem.

I'll look into why this is happening and update Bindery accordingly.

Re: Bindery

Posted: 03 May 2012, 18:56
by Anonymous2
I'll have a bit more time to work on Bindery during the next few weeks so I'm trying to fix all existing problems before introducing any new features.

I've fixed as many UI bugs as I could find and converted most of the Djvubind code so that it creates temporary files in the appropriate system folders (possibly speeding up Bindery on *nix) and deletes them afterwards.

For Windows, I've added per-console PATH injection so that the system PATH is not modified at all. Instead, the process modifies its local PATH variable and that carries over to every subprocess spawned by the main Bindery thread. If the required executables are already present in the system, the local PATH is not touched and the existing executables are used instead of Bindery's bundled ones.

I'll try releasing a new test build of Bindery soon. My hard drive failed so I don't have room to run virtual machines for a few weeks, but that shouldn't be too much of a problem.

Re: Bindery

Posted: 19 May 2012, 00:45
by Anonymous2
I've ironed out tons of bugs from the code:
  • Fixed the Scan Tailor-like Add Files dialog
  • Added tempfile replacements to many hard-coded temporary files in the DjVu binding module
  • Added local PATH injection for Windows that actually works. It only affects the Bindery process and all subprocesses and does not even modify the global PATH.
Download Bindery 2.7.5 here