Add table of contents to PDF with CoreGraphics?

For my app I have an html manual. I’ve made a pdf version from the html with CoreGraphics plugin from MBS. Can I do a table of contents with the plugin? Something like

Introduction - page 1
Chapter 1 - page 5
and so on.

DynaPDF would be overkill for a simple internal app.

The size of library should not matter, but the time you spend.

Of course you can add an page and put some text on it with CoreGraphics or PDFKit functions.
But DynaPDF can do more, including PageLink/WebLink for clickable links.

As I wrote DynaPDF is overkill for what I want to do. Then the pdf version of the manual won’t have a table of contents.

I’d buy DynaPDF in a second if it could convert html to pdf. Without this DynaPDF not really interesting to me.

As clickable links ? I do not know.

Else, with a MacOS, create one with your software of choice, generate the pdf, then use Preview to insert that pdf page at the start (page 2, 3 or…) of the huge pdf manual.

@Emile Schwarz: I use Rapidweaver for the html so that I have offline and online help. So no can do on Preview.

Yup, that’s what I would do too.

The problem is actual Preview versions are not so good (as good as it was), but with some one shots, it is an alternative.

For more work, Acrobat Pro (whatever its name is) is good at that.

Beatrix: I was a bit short on the explanation. I meant:
Create your Index page,
Print it to PDF (RapidWeaver can do that),
Open a copi of your large manual as PDF,
Load the Index pdf pages,
Either Copy/Paste the index pdf pages or drag and drop them from the left thumbnails…
Then, save the large PDF manual.

@Emil Schwarz: I need to create a new version of the manual every time I do a new release. I would need to find a way to script Rapidweaver which is more work than I wanted to allocate to this problem. For now I have a simple cobbled-together app that makes a pdf out of 30 or so pages of html.

You only need the small version of DynaPDF called Starter to write a PDF page with text and links.

Than you can import that page with the CoreGraphics PDF or PDFKit functions and process it.

DynaPDF it is a great tool in many cases, but for this, more than an overkill, it is waste of time doing the PDF by hand. The same for Rapidweaver.

Why dont you use a Help Authoring tool?, those can Create CHM Help, Web Help, Manuals, PDF, and Word Documents from a Single Source

I have a Markdown class that while it creates HTML, that can easily be converted to PDF. It can create an automatic table of contents complete with jump links

There are RapidWeaver stacks that do Table of Content. You do use the Stacks plugin, I hope?

If you’re using MBS CoreGraphics, what about using SetDestinationForRect and AddDestinationAtPoint?

The name parameter just needs to be unique for each destination (anchor)
I don’t know if it will give you a TOC in the sidebar, but should allow you to create a “contents” page.

@jim mckay : thanks, I’ll check those 2 functions out.

@Markus Winter: I found 2 stacks that do a toc for a single page. Which isn’t what I need. Good idea though.

@Pedro Ivan Tellez Corella : Help Authoring tools either cost the moon or they don’t offer enough customisation. With Rapidweaver/Foundation I have a very flexible solution - until now.

Another idea I had just now is to make the toc myself with html. The html is processed a bit anyways so I could add a toc entry for each page. I’ll try my idea if I can’t make the functions from CoreGraphics work.

[quote=405738:@Beatrix Willius]As I wrote DynaPDF is overkill for what I want to do. Then the pdf version of the manual won’t have a table of contents.
[/quote]

The Einhugar PDF plugin can do a TOC (I have created PDFs with TOCs with it. it also supports clickable links- but it has no where near the features of DynaPDF)… BTW It is based on a an open source library.

IMO the Einhugar plugin pack is well worth the money and not expensive!

But AFAIK, no HTML to PDF conversion either, however.

Karen

Thanks, Karen, I’ll check out the plugin.