[NTG-context] Strange error with bookmarks

Michał Goliński golinski at amu.edu.pl
Tue Oct 14 13:41:57 CEST 2014


It does indeed be somehow connected with the specific reader that
I use (okular). Nevertheless, evince gives the same error, and I have found out,
that even jpdfbookmarks_cli has problems as it raises an exception when I try
to dump the bookmarks:

  Exception in thread "main" java.lang.ClassCastException: com.lowagie.text.pdf.PdfNumber cannot be cast to com.lowagie.text.pdf.PdfString

Still, in Acrobat Readers it works perfectly.

In the meantime I have came up with a ConTeXt solution, so one can compare
the resulting PDF files. Unfortunately I have only a limited understanding
of the details of PDF files.

The file giving the error is:

\pdfcompresslevel=0 \pdfobjcompresslevel=0
\setupinteraction[state=start,focus=standard]
\placebookmarks[part,chapter][part,chapter][number=no]
\starttext
\chapter{0}
\startpart[title={A}]
  \chapter{1}
  \chapter{2}
\stoppart
\startpart[title={B}]
  \chapter{3}
  \chapter{4}
  \chapter{5}
  \chapter{6}
  \chapter{7}
  \chapter{8}
  \chapter{9}
  \chapter{10}
\stoppart
\completecontent[criterium=all]
\stoptext

While the following files gives no problems in the applications that I have
tested (note the last command):

\pdfcompresslevel=0 \pdfobjcompresslevel=0
\setupinteraction[state=start,focus=standard]
\placebookmarks[part,chapter][part,chapter][number=no]
\starttext
\chapter{0}
\startpart[title={A}]
  \chapter{1}
  \chapter{2}
\stoppart
\startpart[title={B}]
  \chapter{3}
  \chapter{4}
  \chapter{5}
  \chapter{6}
  \chapter{7}
  \chapter{8}
  \chapter{9}
  \chapter{10}
\stoppart
\placecontent[criterium=all]
\stoptext


On 8/29/2014 22:07 PM, Hans Hagen wrote:
> On 8/26/2014 1:45 PM, Michał Goliński wrote:
> > While trying to make a longer document with ConTeXt I stumbled into a
> > strange error with the latest beta (I spotted it for the first time some
> > time ago). For the following file:
> >
> > \setupinteraction[state=start,focus=standard]
> > \placebookmarks[part,chapter][part,chapter][number=no]
> > \starttext
> > \chapter{0}
> > \startpart[title={A}]
> >    \chapter{1}
> >    \chapter{2}
> > \stoppart
> > \startpart[title={B}]
> >    \chapter{3}
> >    \chapter{4}
> >    \chapter{5}
> >    \chapter{6}
> >    \chapter{7}
> >    \chapter{8}
> >    \chapter{9}
> >    \chapter{10}
> > \stoppart
> > \completecontent[criterium=all]
> > \stoptext
> >
> >
> > ConTeXt would generate a file in which the link for chapter "6" is not
> > working. Neither the link in the table of contents works nor the link in
> > the generated PDF bookmarks. When removing the second line, the link in
> > the table of contents doesn't work, but everyting is ok if one removes
> > the table of contents. What seems even more weird for me, the problem
> > goes away if one removes *any* chapter. It persists for chapter "6" even
> > if chapters are distributed differently between parts without changing
> > their order.
> >
> > Am I doing something wrong? I hope someone might be able to help.
> 
> It works here (with summatrapdf) ... can it be a viewer issue? Do you 
> run the latest context?
> 
> Hans
> 
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                               | www.pragma-pod.nl
> -----------------------------------------------------------------


More information about the ntg-context mailing list