lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bookmarks in PDF documents


From: Dave Baldwin
Subject: Re: Bookmarks in PDF documents
Date: Fri, 27 Apr 2007 17:26:26 +0100

Thanks that was useful and allowed me to develop:

def @Bookmark
        named @Tag {}
        named @Title {}
        named @Level {0}
{
   {    @BackEnd @Case
        {
                PostScript @Yield {
["/"Count @Level "/"Title "("@Title")" "/"Dest "/"LOUT""@Tag "/"OUT pdfmark
                }
            else @Yield ""
        }
   } @Graphic { }
}

which seems to work in my limited testing.

You use it just before a @Section and friends with @Level set to 1 for a SubSection and 2 for SubSubSection. I may be better having a SubBookmark and SubSubBookmark to remove the Level parameter and better mimic the Section paradigm.

It is a bit of a hack that this duplicates the Section stuff. I looked at the def for @Section in the docf file and will probably try jamming the address@hidden ...} code in at the start, but with no knowledge of lout internals this is little more than a stab in the dark.

Dave.

On 27 Apr 2007, at 08:46, Ludovic Courtès wrote:

Hi,

Dave Baldwin <address@hidden> writes:

I want to add bookmarks to a lout document and searching the archive
yielded some comments made in 2003, but these seemed to degenerate
into a discussion of what the name the lout entity should be.

I vaguely remember that the discussion concluded that it would be hard
to add support for bookmarks in Lout itself, but I don't remember why.

Personally, most of my Lout documents are generated by a front-end [0]. That front-end generates PostScript code that makes use of the `pdfmark'
operator to describe an outline (or set of bookmarks, depending on the
terminology).  The code in question looks like this:

  { @BackEnd @Case {
      PostScript @Yield {
  ["/"Title "("1. Introduction")"
   "/"Action "/"GoTo "/"Dest "/"LOUTintro "/"OUT pdfmark

  ["/"Count 1 "/"Title "("3. Methodology")"
   "/"Action "/"GoTo "/"Dest "/"LOUTmethodology "/"OUT pdfmark
  ["/"Count -1 "/"Title "("3.1. Characteristics")"
   "/"Action "/"GoTo "/"Dest "/"LOUTcharacteristics "/"OUT pdfmark
  ["/"Title "("3.1.1. Strategy")"
   "/"Action "/"GoTo "/"Dest "/"LOUTstrategy "/"OUT pdfmark

  ["/"Title "("References")"
   "/"Action "/"GoTo "/"Dest "/"LOUTchapter970 "/"OUT pdfmark
          }
      else @Yield ""
  } } @Graphic { }

This is a bit "hackish" since it relies on the fact that Lout uses
destination names of the form `LOUT<tag>', where <tag> is the address@hidden' of
the chapter/section.

PDF "docinfo" can be produced in a similar way:

  { @BackEnd @Case {
      PostScript @Yield {
  [ "/"Title "("The Document Title")"
  "/"Author "("The Authors")"
  "/"Keywords "("the keywords")"
  "/"DOCINFO pdfmark
          }
      else @Yield ""
  } } @Graphic { }

You can find more info about this in Adobe's _pdfmark Reference
Manual_ [1].

Thanks,
Ludovic.

[0] http://www.nongnu.org/skribilo/
[1] http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/ pdf_creation_apis_and_specs/pdfmarkReference.pdf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]