Want a heading in PDF bookmarks but not in TOC proxy

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
HelenF
Propeller Head
Posts: 56
Joined: Tue May 18, 2010 2:24 am

Want a heading in PDF bookmarks but not in TOC proxy

Post by HelenF »

I'm using Flare 8 to produce PDF output. I have a TOC proxy and above it the title "Table of Contents".

I would like "Table of Contents" to appear as the first bookmark in the PDF's bookmark pane, followed by "Chapter 1", "Chapter 2" and so on.

But I don't want it to be included in the list that replaces the TOC proxy.

The mc-heading-level attribute in the css adds the heading to both the TOC proxy and the PDF's bookmarks - but I only want it in the bookmarks.

Does anyone know if this is possible?

Thanks
Helen
jasonsmith
Sr. Propeller Head
Posts: 205
Joined: Wed Apr 28, 2010 2:51 am

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by jasonsmith »

You can add bookmarks using Acrobat Pro. There is probably some freeware that does this too. I don't think there is a way to display a bookmark in a PDF but not in a TOC proxy list using MadCap Flare settings.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by LTinker68 »

Only thing I can think of is to have mc-heading-level set to 0 for the heading itself, but manually add a bookmark to it so it shows up in the PDF bookmarks pane. However, I don't use the bookmarks pane in PDF output, so I'm not sure if that will do what you want or if it normally separates headings from manual bookmarks.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
HelenF
Propeller Head
Posts: 56
Joined: Tue May 18, 2010 2:24 am

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by HelenF »

I tried the manual bookmark method but it didn't give me what I expected - it included the other bookmarks in my document, but not the "Table of Contents" heading which I had definitely bookmarked.

Strange behaviour.
Daniel Lemke
Propeller Head
Posts: 42
Joined: Tue Jan 21, 2014 11:55 am

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by Daniel Lemke »

I realize this is an old topic, but maybe this will help somebody...

We do this using a workaround that came from Flare support:

The entry in question for us is the Table of Contents heading. We use an H1 with a class:

Code: Select all

<h1 class="TOCHeading">Table of Contents</h1>
In the stylesheet, we set the TOCHeading class to a heading level of 9, and then we set p.TOC9 to be effectively invisible. It is semantically gross and inelegant, but it gets the job done with no post-processing. Good luck!

Code: Select all

	h1.TOCHeading
	{
		mc-heading-level: 9;
		/* Dan Lemke: We set this to 9 so that we can have the Table of Contents page show up in the bookmarks panel for PDF but then use the p.TOC9 style to hide it from view in the generated TOC proxy. Rob Siebens submitted a feature request (46861) with Flare support to accommodate having something show up in the Bookmarks but not in the TOC proxy. */
		color: #ff9100;
		font-weight: bold;
		font-size: 20pt;
	}

	p.TOC9	/* Dan Lemke: Styled to hide the text from view. This level should only be assigned to the h1.TOCHeading class. See the note for that class for more information. */
	{
		color: #ffffff;
		font-size: 1pt;
		line-height: 0;
		margin: 0;
	}
Dan Lemke of Thomson Reuters
Image
kmorrison
Sr. Propeller Head
Posts: 104
Joined: Mon Nov 11, 2013 3:04 pm
Location: Ottawa, Canada
Contact:

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by kmorrison »

Thanks, Dan! This was driving me nuts.

Note for people who might be referring to this thread in the future:
I also had to add "mc-pagenum-display: none" to my p.TOC style to get the page number to go away too.
Last edited by kmorrison on Mon Dec 05, 2016 8:03 am, edited 1 time in total.
Daniel Lemke
Propeller Head
Posts: 42
Joined: Tue Jan 21, 2014 11:55 am

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by Daniel Lemke »

kmorrison wrote:Thanks, Dan! This was driving me nuts.
I'm glad it helped!
Dan Lemke of Thomson Reuters
Image
jbkalla
Propeller Head
Posts: 57
Joined: Tue Nov 06, 2012 11:53 am
Location: Denver, CO, USA
Contact:

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by jbkalla »

Does this still work? It doesn't seem to for me.
doloremipsum
Sr. Propeller Head
Posts: 290
Joined: Mon Aug 26, 2019 2:11 pm

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by doloremipsum »

@jbkalla, I don't see why it wouldn't work. Essentially you're just hiding the heading wherever it appears in the print table of contents. Could you post a description of what you're trying to achieve and your CSS code so the brains trust can have a look?
in hoc foro dolorem ipsum amamus, consectimur, adipisci volumus.
jbkalla
Propeller Head
Posts: 57
Joined: Tue Nov 06, 2012 11:53 am
Location: Denver, CO, USA
Contact:

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by jbkalla »

doloremipsum wrote:@jbkalla, I don't see why it wouldn't work. Essentially you're just hiding the heading wherever it appears in the print table of contents. Could you post a description of what you're trying to achieve and your CSS code so the brains trust can have a look?
Shoot. I was afraid of that. What's happening is the ToC is not showing up in the bookmarks.
I normally create HTML content with Flare, and am attempting to modify somebody else's PDF content. I believe I've followed the instructions above, creating the following in the pertinent CSS:

Code: Select all

p.TOC9
{
	color: transparent;
	font-size: 1pt;
	mc-pagenum-display: none;
	line-height: 0;
	margin: 0;
}

h1.TOCHeading
{
	mc-heading-level: 9;
	font-size: 20pt;
	font-weight: bold;
}
Maybe it has to do with where I put the <h1> tag? I had to add it because it wasn't there in the first place. I put it right after the <page> tag:

Code: Select all

<Page Width="7in" Height="9in" Padding="1in" PageSize="Letter" PaddingLeft="1in" PaddingRight="1in" PaddingTop="1in" PaddingBottom="1in" PageType="normal" Name="Table of Contents" Orientation="portrait" BleedBottom="0.25in" BleedTop="0.25in" BleedRight="0.25in" BleedLeft="0.25in"><h1 class="TOCHeading">Table of Contents</h1>
robdocsmith
Sr. Propeller Head
Posts: 248
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by robdocsmith »

The <H1 class="TOCHeading"> needs to go on the actual page, not in the page layout. My Contents page looks like this for example:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd">
    <head>
    </head>
    <body>
        <h1 class="TOCHeading">
            <MadCap:namedDestination name="Contents" />Contents</h1>
        <MadCap:tocProxy />
    </body>
</html>
The page layout that this TOC file uses just contains the text Frame that the contents will go into:

Code: Select all

<Page Name="Left" PageType="left" PaddingLeft="10mm" PaddingRight="10mm" PaddingTop="20mm" PaddingBottom="20mm" Orientation="landscape" Width="225mm" Height="297mm" PageSize="custom">
        <Frame Flow="body" Height="138mm" Right="0mm" ColumnCount="2" ColumnGap="5mm" top="0mm" X="0mm" Y="32mm" TextAlign="left" VerticalAlign="top" Width="277mm" FlowIndex="2">
        </Frame>
</Page>
My page is a little larger than landscape A4 (I trim it down later with a script). There is other stuff on my page such as a header and footer and decoration frames, but you get the picture.

Hope that helps,

Rob
doloremipsum
Sr. Propeller Head
Posts: 290
Joined: Mon Aug 26, 2019 2:11 pm

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by doloremipsum »

@robdocsmith, you got in ahead of me. To expand on that, your TOC probably has a topic in it for the print table of contents proxy. The heading should go in that topic instead of on the page layout. (If you don't have that topic with the proxy, you will have to add one to pull off this trick.)

By the way, I believe you can get away with a style like this:

Code: Select all

p.TOC9
{
    display: none;
}
No need to mess around with transparent colours and all that.
in hoc foro dolorem ipsum amamus, consectimur, adipisci volumus.
jbkalla
Propeller Head
Posts: 57
Joined: Tue Nov 06, 2012 11:53 am
Location: Denver, CO, USA
Contact:

Re: Want a heading in PDF bookmarks but not in TOC proxy

Post by jbkalla »

Oh! So y'all manually create a contents page, not use the TOC Proxy to create one automatically? I've never done that before, but found out how to do it. That was very helpful! I can now control my Glossary and TOC! I'll see if that allows me to control my bookmarks.
PS... @doloremipsum, thank you for that tip as well!
Post Reply