A macro for author to indicate a page is ready to print
Asked by Mira Vogel:

Hello Confluence people,

The situation is that there are tens of pages which need to be individually printed to PDF. Each page is a letter with multiple authors. The lead author needs to sign it off so the person overseeing the process can then export the letters to PDF (I've sorted out the CSS). The authors are not great at following instructions, so we are using templates. The person doing the printing needs things to be quick and easy too (no repetitive individual edits).

My question is, what is the best way for the lead author to indicate in-wiki (i.e. not emails) that a page is finalised?

I can tell you what I've done so far which hasn't worked well. In the template I included the Choose Label macro, with the choice of just one label ('Ready') with a request that the lead author click it when the letter is ready to send. Clicking that then labels the page 'Ready', then feeds all pages with that 'Ready' label into an area on the space front page containing a Content By Label macro. It worked well in that the macro disappeared for that author, and that display for the overseer worked well too. The problem is that when the overseer opens each letter, the now-unwanted Choose Label macro persistently displays, and is included in the exported PDF.

This seems odd, since I thought the Choose Label macro was only supposed to show if the labels had not already been attached to the page - mine only has one label, so should be disappearing after being used once. Am I using it wrong?

Or is there a way to exclude the macro from the PDF export (we're doing individual pages, rather than space export)?

Or does anybody have a better way?

I should probably say, I don't think this will work if anybody has to do any repetitive deletions or copy/paste, or read elaborate instructions, or otherwise go out of their way. I think they'd say they prefer email.

Many thanks in advance,

Mira


Answers:
author: Mira Vogel
body: Thank you very much - I will try and let you know.


author: Alex Yasurek
body: You can try the Scroll PDF plugin which lets you surround content which should or shouldn't appear in a PDF. It also has lots of options for customizing PDFs. You can try it for free and see if it helps you with your problem.

<https://marketplace.atlassian.com/plugins/com.k15t.scroll.scroll-pdf/server/overview>


author: Milo Test
body: Try putting the Choose Label macro within a span or div macro, set the class to noprint, then add the noprint instruction to the PDF Stylesheet:

```
.noprint  {  display: inline-block ;  }
```

comments: author: Mira Vogel
body: Unfortunately adding the noprint div to a template with variables seems to break the template (I click apply and find the variables display as a bulleted list and the template fields disappear - I tried with a fresh template and the same thing happened). Thank you for the suggestion though.


author: Alex Yasurek
body: Try following his advice of wrapping the content in span or div and giving it a class of "nonprint" and then add this to the stylesheet:

    @media print { .noprint{ display: none !important; } }

This should hide it from the PDF.


author: Mira Vogel
body: Hi Alex, I tried that, but as mentioned above, adding div or span to the template code breaks the template. I guess it would work in a normal page, but not in a template?


author: Alex Yasurek
body: Try wrapping it in something that you can give an ID or class name to so that you can access it from CSS and hide it.

The other solution is that Scroll PDF plugin which works great but that cost $.