Friday, July 9, 2010

JPdfBookmars 2.3.0

Version 2.3.0 is out. The reason for the switch  from version  2.2.X to  2.3.X numbering is the presence of new features regarding  the bookmarks text  files management.
A lot of users had problems with bookmarks text files  using a different encoding from what jpdfbookmarks expected on a particular system, now you can select the character encoding to use, both in the graphical user interface and on the command line.

In GUI mode to change the character encoding select the menu Tools->Options, at the bottom of the General tab there is a field to select the encoding you wish to use for the Dump and Load actions available in the Tools menu.  This setting is preserved between different executions of the program, anyway in the list the system default encoding is indicated by the text (System Default) so that you can revert easily to the original setting when needed.

In command line mode to change the character encoding use the option --encoding (or the -e short form) followed by the encoding name, for example:

jpdfbookmarks_cli.exe --encoding UTF-8 --apply bookmarks.txt --out output.pdf input.pdf   

this will apply the bookmarks contained in the file bookmarks.txt to the input.pdf file and save the result to output.pdf and will instruct jpdfbookmarks to read the file with a UTF-8 encoding. The setting in the command line is not preserved between different executions so if you don't specify an encoding the program  always uses the system default one.

The program doesn't make any check to see if the encoding you use for reading a file is correct, it is your responsibility to match the correct encoding between a dump and an apply. If you use often a different encoding or you want to transfer bookmarks text files to different systems I suggest you to insert the encoding used in the file name to help your memory and the one of any other user of the file, for example I name bookmarks text files like bookmarks_utf8.txt or bookmarks_iso8859-1.txt.

The --out option can now be used also with the --dump option, in this case it is interpreted as the text file where to dump the bookmarks of the pdf file, while I remind you that using it with the --apply option indicates the output pdf file. If you don't specify an --out file.txt, --dump will print bookmarks to standard output so redirection is still an option to save dumps, but the --out option gives you the possibility to change the encoding when used with an --encoding option, for example:

jpdfbookmarks_cli.exe --dump --encoding UTF-32 --out bookmarks.txt input.pdf

will dump bookmarks of input.pdf to a UTF-32 encoded file named bookmarks.txt.

Another feature added is the --force option (-f short form), with this option set no warning is issued or confirmation is asked before overwriting an existing file, while without it any overwriting should require your confirmation. This is useful for batch executions of the program in a non-interactive environment, but use it with caution and backup your files because it can lead to data loss.

Some bugs also have been corrected, to name a few:
  • memory needed for reading large files have been reduced a lot using temporary files that the program writes during execution (this is totally transparent to you as a user of course, but I like that you know what happens on your computer);
  • trailing spaces could lead to a wrong interpretation of lines in previous versions, now they are removed at runtime;
  • saving large files in gui mode now runs in its own thread and there is an animated bar at the bottom indicating that the save action is taking place;
  • the bookmarks toolbar is not scrolled with bookmarks anymore.
I would like to thank all the users and programmers who have reported bugs and  have indicated a viable solution, thanks a lot.

No comments: