Is there a way to add headers in table of contents of a PDF export using the External Process Pool?
Asked by Robert Beckman:

This is something that's available using element(header) in combination with the PDF Space export header section in the PDF Layout when not using the External Process Pool, but it doesn't seem available when using the External Process Pool in Confluence 7.0.1.  

Not using the process pool, we're able to target the Table of Contents specifically using the following CSS:

```
div.toc {
  page:toc ;
}

@page toc
{
  @top-left
  {
     content: element(header);
  }
  @bottom-left?
  {
    content: element(footer);
  }
}

```

Using the external process pool, we're still able to target the ToC specifically and inject other CSS, but the content: element(header) and content: element(footer) functions don't seem to work. It works for the remainder of the pages, though, so it seems like the PDF Layout configuration is inactive for the table of contents generation, which, considering that the External Process Pool generates the table of contents separately from the pages, somewhat makes sense could occur, but not that it should occur.


Answers:
author: Shannon S
body: Hello Robert,

Thank you for contacting us about this! I see you were able to get a hold of support, so I will summarize their response here. Just let me know if I miss anything or if there's anything you want to add that could help anyone in the future with the same requirement.

We supplied you with the following code, but it didn't work for your instance due to a limitation.

```
@page title{    @top-center    {        content: "Document Title Goes Here"; /* This is the content that will appear in the header */        font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif;        font-size: 8pt;    }    @bottom-center    {        content: "Page " counter(page); /* This is the content that will appear in the footer */        font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif;        font-size: 8pt;    }    /* Any other page-specific rules */}
```

The following feature request was created:

* [CONFSERVER-59067](https://jira.atlassian.com/browse/CONFSERVER-59067) *When using external process pool for space PDF export, header and footer customizations can't be added to table of contents*

Let me know if there was anything further you wanted to include, or you can accept the answer if this helped you.

Regards,

Shannon

comments: author: Robert Beckman
body: Hi Shannon,

The main issue using this route is that it doesn't allow for images, which can be common in headers or footers with company logos and the like. Even things like

```
content: url(...);
```

which would normally allow injection of an image don't work. Right now the only effective workaround is to disable the external process pool for pdf exports, but that unfortunately leaves the system vulnerable to exports that can eat up memory - one reason the process pool was created in the first place.


author: Shannon S
body: Hi Robert,

I understand that this was addressed in the support ticket, is that right?

Can you confirm that the feature request created would meet your requirements?

Regards,

Shannon


author: Robert Beckman
body: Hi Shannon,

Yes, the Feature Request will meet our requirements.  

I understand this is a bit of an edge case, but for legal reasons we need those headers and footers on some customer facing documentation we develop through Confluence.   

Our use of css is a bit hacky, so it'd be understandable if the implementation was through a different route, as long as the end result is similar. I don't pretend to know the internals of Confluence very well, but it does not seem overly complicated to add an additional option below the "Include Page Numbers" to include headers and footers on the table of contents.


author: Shannon S
body: Thank you for confirming, Robert.

I'm agree that the CSS solution isn't ideal, and I hope we can see this feature in the future!

Take care, and have a pleasant rest of your week.

Regards,

Shannon


Tags: atl-adm

confluence-server

server