#80 [run-console.s] Dollar sign in bookmark breaks the split

pdfsam enanched
open
nobody
Console (18)
5
2011-04-12
2011-04-12
Anonymous
No

Hi,

We have some pdf documents with a dollar sign being part of the bookmark. In those cases pdfsam breaks with the below error:

<code>
$ ./run-console.sh -f /Users/nestor/Downloads/pdf/mypdf.pdf -o /Users/nestor/Downloads/pdf/pdfsam_out -s BLEVEL -bl 1 -p [BOOKMARK_NAME] split
...
10:31:41,678 DEBUG File /Users/nestor/Downloads/pdf/pdfsam_out/aFirstBookmark.pdf created.
10:31:41,678 DEBUG Creating a new document.
10:31:41,678 DEBUG Creating temporary file..
10:31:41,680 FATAL Error executing ConsoleClient
org.pdfsam.console.exceptions.console.SplitException
at org.pdfsam.console.business.pdf.handlers.SplitCmdExecutor.execute(SplitCmdExecutor.java:112)
at org.pdfsam.console.business.pdf.CmdExecuteManager.execute(CmdExecuteManager.java:97)
at org.pdfsam.console.business.ConsoleServicesFacade.execute(ConsoleServicesFacade.java:75)
at org.pdfsam.console.ConsoleClient.main(ConsoleClient.java:81)
Caused by: java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:713)
at java.util.regex.Matcher.replaceAll(Matcher.java:813)
at java.lang.String.replaceAll(String.java:2189)
at org.pdfsam.console.utils.perfix.PrefixParser.applyBookmarkname(PrefixParser.java:303)
at org.pdfsam.console.utils.perfix.PrefixParser.generateFileName(PrefixParser.java:134)
at org.pdfsam.console.business.pdf.handlers.SplitCmdExecutor.executeSplit(SplitCmdExecutor.java:289)
at org.pdfsam.console.business.pdf.handlers.SplitCmdExecutor.executeBookmarksSplit(SplitCmdExecutor.java:440)
at org.pdfsam.console.business.pdf.handlers.SplitCmdExecutor.execute(SplitCmdExecutor.java:106)
... 3 more
</code>

Thanks for the great work on this package,
-Nestor

Discussion

  • Nestor Urquiza
    Nestor Urquiza
    2011-04-12

    Just for the record I open this ticket. Apparently the system allows anybody to post as I was not logged in when I submitted the bug. Anyway I look forward to get this fix.

    Thanks!
    -Nestor