Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ricardogama opened this issue Sep 28, 2023 · 2 comments
Open

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

ricardogama opened this issue Sep 28, 2023 · 2 comments

Comments

@ricardogama
Copy link

ricardogama commented Sep 28, 2023

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
@gunnsth
Copy link
Contributor

gunnsth commented Aug 6, 2024

@3ace Does the custom TOC cover this use case? https://github.com/unidoc/unipdf-examples/blob/master/report/pdf_custom_toc.go

@3ace
Copy link

3ace commented Aug 7, 2024

@gunnsth no it doesn't. The current custom TOC still render it in it's own pages similar to the automatic one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants