Skip to content

[FEATURE] Drawing TOC in a specific page/area #529

@ricardogama

Description

@ricardogama

Is your feature request related to a problem? Please describe.

We're trying to generate a document where the first page includes some content, let's say a title, an image, and a small table, and also the Table of Contents (TOC).

Currently the TOC functionality always renders a dedicated page as first page of the document (or second if DrawFirstPage is not set).

Since in our example the TOC is fairly small (just a couple of lines), it makes a huge waste os space and overall harder to navigate the document by having it as a separate page, while it makes more sense to include it in the first page with the other elements.

Describe the solution you'd like

Either:

  • Render the TOC in a specific place, let's say same as c.Draw, where we could easily include the TOC like any other element, like an image or a table.
  • (less flexible) Allow customization functions to the TOC struct, like AddImage or DrawBefore, so we could include other elements to the TOC page.

Context

The idea is to achieve something like this (poor image editing skills):

Screenshot 2023-09-28 at 4 14 49 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions