Thursday, December 4, 2008

JPdfBookmarks 1.2.2

Version 1.2.2 is ready for download. Remember to uninstall any previous version you might have installed before upgrading to 1.2.2.

This version resolves some bugs and adds some nice features, i would like to thank all the people that posted here to signal defects and to make suggestions, here follow the main changes:
1. Using the program from the command line, the titles of bookmarks could not contain a '/' character in the previous releases, this was a bug, in fact the program was not able to distinguish the slash used in the title from the one used to indicate the page number. Now you can use slashes in your titles and lines like "Paragraph 2.4 Add/Remove Pages/23" will be accepted as valid.
2. Now when you select multiple bookmarks the 'Apply' and 'Reset' buttons are enabled also if you don't make modifications, giving you the possibility to apply the attributes of the first selected bookmarks to all the others. If you press 'Apply' you can select which attributes of the first bookmark you want to propagate to the others, if you change your mind press 'Reset' to disable the buttons before making a new selection.
3. Again if you select multiple bookmarks and press 'Apply', in the dialog to select which attributes to modify, there is a new option to shift the pages of each bookmark by a certain amount, positive or negative. This can be useful if you are working on a pdf that is still growing or shrinking, now you are able to adjust the target pages with a single action by adding or subtracting the number of pages inserted or removed.
4. You can quickly expand or collapse all the bookmarks nodes using the keyboard shortcuts CTRL+E and CTRL+P or using the menu items 'View->Expand All' and 'View->Collapse All'.
5. On Windows using the program from the command line was very difficult. Now the Windows installation program adds the installation directory to the user "PATH" variable and installs a second executable file called jpdfbookmarks_cli that you can use from the command prompt inside any directory.

Special thanks to m.ardito for the smart hints in his posts.

Saturday, August 9, 2008

Ubuntu Hardy 8.04 Package available for download

A deb package of jpdfbookmarks for Ubuntu 8.04 is now ready for download at the download page. It offers a better integration then the general Linux installer in the Ubuntu environment. It also install the man page for the program that you can access as usual with:

man jpdfbookmarks

If you are an Ubuntu user you should choose this method of installation, if you already installed the program with the general Linux installer, uninstall it using the uninstall program in the installation directory, the command should be something like:

sudo /usr/local/lib/jpdfbookmarks/uninstall

then download the .deb file and double click it to install or use the command:

sudo dpkg -i jpdfbookmarks_1.2.1ubuntu0_all.deb

The package depends on a java runtime environment version 5 or later, so to install the package you first need to have installed one of sun-java6-bin, sun-java5-jre or openjdk-6-jre packages, anyway you can just try to install and the package manager will tell you if dependencies are satisfied.

Friday, August 1, 2008

JPdfBookmarks 1.2.1

Version 1.2.1 of JPdfBookmarks is ready for download.

This new release adds one major feature which is the possibility to modify several bookmarks with one action.

If you need to make the same modifications to multiple bookmarks, you can select more then one item in the tree holding down the "Control" key, then edit the attributes you want to apply to all of them, don't matter about the others. Press the apply button and a dialog will be shown, here you can check which attributes must be applied to all the selected bookmarks the unchecked ones will be ignored, when finished press the "Apply to All" button in the dialog.

This version also resolves a bug affecting users with the java runtime 5, so those who had problems with previous releases should try this one.

The Help menu has now an item to connect to internet and read the manual of jpdfbookmarks online.

Friday, July 25, 2008

JPdfBookmarks Manual

I have written a manual for the JPdfBookamarks program, it will be integrated as an online help in the next release, but is already available for download in PDF format from the download page, or to be read online.

Friday, July 11, 2008

JPdfBookmarks 1.2.0

Hi all, so this is the new version of jpdfbookmarks (numbered 1.2.0), and it has significant improvements over the preceding versions.

It can create different kind of bookmarks, not pointing only at top of page but also at different positions within the page, using fitting page width , page height or whole page. This is achieved through the offset controls on the right panel of the program window. They divide the width and height of the page in thousandths that you can select using the slider, so to point at half page move the slider at a 500 value, to point at 1/4 of a page set it to 250 and so on.

This of course is not very precise, so if you want more precision use the Ruler buttons. They will open a new window with a ruler in it, i will explain how to use the top ruler, the left one works the same in the horizontal direction:

  • open the PDF with your reader of choice, i will use Adobe Reader, and go to the page that is the target of your bookmark;
  • adjust the zoom to see the entire page height, on my screen 50% is ok;
  • align the first tick of of the slider (corresponding to 0) with the start of the page;
  • extend or reduce the ruler window so that the last tick (corresponding to 1000) will be aligned to the end of the page;
  • now move the slider indicator to the position where you want to point your bookmark in the page and press the send button;
now you have precisely set the position where to point in the page and if you have set the rest of options you can press apply button.

Of course the fit type option you choose from the drop down list influence the offset you can set below. If you choose "Fit Width" which is common for pdf books, you can only choose a top offset, if you choose "Fit Height" only left offset will be available and if you set "Fit Page" of course you don't need neither of them.

The "Set Top and Left" option means you want to point exactly at specific coordinates in the page, and zoom in accordance with that offsets. This is useful when you have very large pdf pages (like maps) and you want to make bookmarks pointing to specific locations in the map. There is a need for a zoom factor when you use this option but the program calculates it automatically, you only need to take the coordinates with the rulers.

In the images below i use this feature to bookmark Piccadilly Circus in the tube map of London using both the Left Ruler and the Top Ruler.

The "Destination unknown" option is to indicate all the outlines already present in the pdf that are not supported by jpdfbookmarks, meaning you cannot modify them but will be maintained when you save the file. You can use this option for example to insert a bookmark pointing to no page in the document but that is the father of other child bookmarks.

You can also choose different text styles and colors for your bookmarks, to distinguish for example chapter bookmarks from paragraph bookmarks.

Another thing i want to point your attention to, is the Tools menu which has a single item ("Change Look and Feel") to change from the standard Java look and feel to another one available on your PC.

Remember that the command line features are still available you can read about that in the post of version 1.0.0, and maybe you can also find useful information on the post of version 1.1.0.

Remember to post comments here for bug reports or suggestions.

Sunday, July 6, 2008

JPdfBookmarks Download Page

JPdfBookmarks is now open source and hosted on source-forge

By downloading and using this software, you signify that you agree to the GPLv3 license

Latest Version is 2.5.2

Zip Format:  Binaries    Sources

Tar.Gz Format:     Binaries     Sources

JPdfBookmarks antivirus scan report at

Thursday, July 3, 2008

PDF bookmarks editor

This is the GUI version of the jpdfbookmarks editor i published some days ago.

All the command line features are still available with the same syntax so i will not repeat here those instructions, but i strongly suggest to upgrade to the new version also if you don't plan to use the GUI.

If you used the linux installer to install the previous version, you must uninstall it before you install the new one, to do that launch the uninstall program which is located in the program installation folder as root. If instead you used the zip archive it's sufficent to delete the unzipped folder to uninstall the old version.
I created installers for linux and windows, while other operating systems users can download the zip archive version, i remind you that this is a java program so you need a Java Runtime Environment (version 5 or later) to run it.

To use the linux installer remember to give the downloaded file execution permissions, this can be done right clicking on it and choosing properties on most desktop environments or with the command:

chmod +x jpdfbookmarks-1.1.0-Linux-x86-Install

If you use the installers you can launch the application easily by using the shortcut created in your main menu, but if you have problems you can always enter the directory where you installed the program and launch the command:

java -jar jpdfbookmarks.jar

If you use the zip archive you can launch the prgram entering the folder where you unzipped it and on linux launch the command:


or on any other systems

java -jar jpdfbookmarks.jar

On Windows you should be able to launch it double clicking jpdfbookmarks.exe but you can always use the above command if needed.

First of all, i want to remind you the limits of this software, so that you don't waste your time downloading it if it's not what you are looking for.
  • bookmarks can point to a page but not to a specific point within a page, like other commercial software can do;
  • previous limitation apply also to existing bookmarks that you or someone else created with other software, so when you save the pdf file with jpdfbookmarks all the bookmarks will have page precision, no information of were to point within the page is preserved (so i suggest to backup the original file to avoid data loss);
  • bookmarks to URL or other resources out of the document are not supported;
  • this software is not a pdf reader, so you need to use other programs to check where to put bookmarks and to test the new files, for example Adobe Reader, kpdf, evince etc.;
  • this software is freeware and a one person project so no assistance is possible, anyway post comments, suggestions end bugs here or to my mail and i will try to help.
Usage is very easy, when you open a pdf file the bookmarks structure (if any) is represented on a tree control, where each node is a bookmark with a title and a page number indicated after a '-' character.

The title and page information for the selected node are also displayed and editable in a table below the tree.

You can open one pdf file at a time, if you close the program after you have made modifications or if you try to open a new file the program will ask you to save the the previous. You can save the pdf file with another name using the appropriate button or menu item.

Actions on bookmarks are accessible through the Edit menu (and the associated shortcut key), the tool bar buttons or the tree context menu, most of them are only active when there is a selected node, i will only refer to menu items in this description, but you can use what you prefer.

If no bookmark is selected or if there are no bookmarks in the current pdf, you can add a new one using the Edit->Add Sibling menu item, which will add a first level bookmark. If there is a bookmark selected, that command will add a bookmark of the same level after the selected one.
You can edit the title and page number directly in the tree or using the table below the tree.

To start editing in the tree select a node then use Edit->Edit menu item, or press F2, then write what you prefer as title and type the page number after a '-' character at the end of the line.

To add a child to a selected bookmark use the Edit->Add Child command and then edit as before.

To delete a selected bookmark use Edit->Delete, the program will ask for confirmation before deleting because also all the child bookmarks of the selected one will be canceled with it, and there is no undo functionality, so pay attention to this.

To move a bookmark from a position to another in the hierarchy you can drag and drop from one position to another, all its children will be moved with him so you can move only up in the hierarchy or within the same level. If you drag over the icon of a bookmark, a gray line will show you where it will be dropped, while if you drag over the text of a bookmark it will be dropped as the child of that bookmark. If dragging you stop for a while on a collapsed node, it will expand giving you the possibility to drop inside of it, if you stop on an already expanded node it will collapse again. You can also scroll the tree moving out of its bounds while dragging if needed.

For instructions on how to use the command line interface go to my previous post here.

Please post here any suggestion or bug you will eventually find, or just to tell me you are using this program, this will make the difference for me to choose between continuing to develop this software (adding features and correcting bugs) or moving to the next thing.

Tuesday, June 10, 2008

Command-line PDF bookmarks editor

Hi all, i wrote a command line utility program called jpdfbookmarks to add bookmarks to an existing pdf file.
I could not find anything easy and free on the net for this simple task, so i decided to write my own and now i'm going to publish it here, for those who need the same functionality.

This is a java program and i have packaged it to an installer for linux users, but should work with any operating system as long as you have installed a java runtime environment version 5 or later. If you don't have it or you are unsure you have it go to sun java site and check.

It' is very simple and not features rich but is really straightforward to understand its usage. First you have to create a simple text file which will represent the structure of your bookmarks using your favorite plain text editor, each line of text is a bookmark item written in the form:

Chapter 1. The Beginning/3
Para 1.1 Child of first level/5
Para 1.1.2 Child of second level/9
Para 1.2 Another Child of first level/14
Chapter 2. The Continue/27

where the part on the left of the / is the title of the bookmark and the part on the right is the target page of the bookmark. Text indentation represents the hierarchy of the outlines and must be obtained with "tab characters" (spaces will not work). Each bookmark will point to the top of the page indicated in its line, there is no way to point to another position in the page at present time. Once you have the file, save it to the same folder where you have the pdf file it refers to with a name like bookmarks.txt, then assuming that the original pdf name is input.pdf and that we want to save modified pdf as output.pdf, launch the command:
jpdfbookmarks --apply input.pdf bookmarks.txt output.pdf

If output.pdf already exists or if you indicate input.pdf as ouput file, the program will print a warning and ask for confirmation before overwriting, i suggest that you never overwrite existing files to avoid loss of data as this program is not tested enough, so please be carefull and write always to a new file, i will not fill responsible for any data corruption you eventually will experience.
If your original pdf file already have bookmarks they will be erased and substituted by the new ones, if you want to preserve or use them as the base of your bookmarks.txt file you can use the command:

jpdfbookmarks --dump input.pdf > bookmarks.txt

After this command you can open bookmarks.txt with your editor to modify it before applying it again to the pdf.

If you need a quick help during your work use the command:

jpdfbookmarks --help

The esiest way to install the program on Linux should be to download the Linux installer from the link below and afer giving it execution permissions double click it in your desktop environment, the installer will prompt you for the root password and guide you through the installation, it works fine on my ubuntu laptop but if you have problems on your machines post here and hope for some help.
An alternative if you have problems on linux with the installer or if you want to use the program on other operating systems, is to download the zip archive, again from the link below, and extract it where you prefer. In this case to use the program you have to open a terminal inside the directory where you have extracted, copy there the files you are working on and launch the commands like the following example:

On Linux:

./jpdfbookmarks --apply input.pdf bookmarks.txt output.pdf

./jpdfbookmarks --dump input.pdf > bookmarks.txt

On all systems:

java -jar jpdfbookmarks.jar --apply input.pdf bookmarks.txt output.pdf
java -jar jpdfbookmarks.jar --dump input.pdf > bookmarks.txt
or if your desktop recognizes jar files as executables you may try:

jpdfbookmarks.jar --apply input.pdf bookmarks.txt output.pdf
jpdfbookmarks.jar --dump input.pdf > bookmarks.txt

The program is freeware and the license for it and for the libraries it uses are distributed and installed with it. If you find this program useful, want to suggest something or signal a bug please post here, i will appreciate your contribution.