Monday, March 23, 2009

Patch for Linux launcher

The Linux launcher for jpdfbookmarks has a bug preventing the use of paths with spaces in the command line, the Windows launcher instead has no problem. The next release will correct this, for the time being you can easily resolve the bug substituting the script launcher in the installation directory (named target_executable.sh) with this new one.

Below are the easy steps to accomplish this in a Debian system (also shown in the side picture), and should work on any Linux system.

I suppose you have downloaded the new target_executable.sh file in your home directory, anyway open a terminal and enter the folder where you have saved the file, if you don't remember where you installed jpdfbookmarks one way to find this information is to use the command:

ls -l `whereis jpdfbookmarks`

and examine the results.

Then copy the new file over the existing one, you probably need to become superuser to accomplish this using the su or sudo commands because the installation directory is usually in a system path, if the installation directory is /usr/local/lib/jpdfbookmarks the command to use is:

sudo cp -i target_executable.sh /usr/local/lib/jpdfbookmarks/

give the new file execution permissions (maybe not strictly necessary but doesn't hurt):

sudo chmod +x /usr/local/lib/jpdfbookmarks/target_executable.sh

Now you should be able to use spaces in your commands.

I would like to thank Scott Bronson for having reported this annoying bug and also for providing the smart solution, I really appreciate your help, thank you.

Tuesday, March 10, 2009

JPdfBookmarks 1.2.3

Version 1.2.3 is out, you can download it from the Download Page. Uninstall any previous version before installing this one.

This release fixes a bug present in previous versions that caused the bookmarks to stop working after the pdf was “linearized” with an external program like Acrobat Pro or similar, so I recommend everyone to upgrade to this release even if you don’t need the new features.

In this release the command line mode supports the same kind of bookmarks of the graphic user interface.
The file format to dump and load bookmarks is now:

Title of bookmark/target page[,FitType,TopOffset,LeftOffset]>

like the following example:


where the part on the left of the '/' character is the title of the bookmark and the part on the right is the target page of the bookmark. The page number is optionally followed by comma separated values, the first parameter is the fit type used for the bookmarks. If this type is TopLeft then other two parameters are necessary, the top and left offsets in thousandths of the page height and width (zoom factor will be inherited), if the type is FitWidth only the top offset is necessary while if the fit type is FitHeight only the left offset must be specified. The type FitPage doesn't need any other parameter. If no parameter follows the page number then FitWidth is assumed with no offset. Text indentation represents the hierarchy of the outlines and must be obtained with "tab characters" (spaces will not work) so check that your text editor doesn’t replace tab characters with spaces because many have this behavior as a default.

Now you can dump or load bookmarks to or from a text file also from the graphic user interface, in the Tools menu there are the two commands “Dump Bookmarks” and “Load Bookmarks” that will let you choose the text file to use. Remember that the text file doesn’t retain information on color or style of bookmarks.

In the toolbar a check box has been added that you can select if you wish that the bookmarks are shown automatically whenever the pdf file is opened in a compliant reader.

When starting the program from command line passing a pdf file as a parameter the –gui keyword is now optional so you can now use simply jpdfbookmarks file.pdf to start the graphic interface and open file.pdf, this makes easier to associate the pdf files to the program and use context menus in file managers.

I would like to thank Marco Ardito, Doug Ranz, Daniel Werner and Malcolm Bennet for helping and motivating me reporting bugs and giving really smart hints for new features.