Dropdown heads and PDF styles

This forum is for Single-Sourcing your Flare content to multiple outputs.

Dropdown heads and PDF styles

Postby Oda on Wed Aug 20, 2014 8:51 am

Hi,

I have a project that needs to be generated in HTML5 and in PDF.
For the HTML5 ouput, there are some sections where I use dropdown texts.
For the PDF output, I want these sections to appear normally, with an H2 style applied to what corresponds to dropdown heads of the HTML5 output, but can't find the info to do that. It takes a default style coming from I-dont-know-where.
Any idea?

Thanks
Oda
Propeller Head
 
Posts: 48
Joined: Tue Apr 15, 2014 6:04 am

Re: Dropdown heads and PDF styles

Postby patrishmo on Wed Aug 20, 2014 10:55 am

I accomplished this by applying conditional text to the heading that I wanted to show in the PDF. If the h2 heading is the heading that you want to show, set that as conditional text for print only. When you build the PDF, check of to include the print only conditional text in your print target.
patrishmo
Jr. Propeller Head
 
Posts: 8
Joined: Wed Apr 23, 2014 11:20 am

Re: Dropdown heads and PDF styles

Postby wclass on Wed Aug 20, 2014 3:59 pm

I use an output medium and set the css values for the following styles. You can make it look like the H2 but I don't think you can specify that it is assigned the H2 style (a CSS expert might jump in here).

MadCap|dropDownHead
MadCap|dropDownHotspot
Margaret Hassall - Melbourne
wclass
Propellus Maximus
 
Posts: 1175
Joined: Mon Feb 27, 2006 5:56 am
Location: Melbourne, Australia

Re: Dropdown heads and PDF styles

Postby Msquared on Thu Aug 21, 2014 12:12 am

Yes you can assign an H2 style. I do all my styles by editing the CSS file directly, so I just defined
MadCap|dropDownHead.h2
MadCap|dropDownHead.h3 etc
and copied the h2, h3 style definitions for the PDF.

Big, big, big BUT . . . .

In theory this should work beautifully, and make single sourcing Web/PDF output a breeze, without the need for web/print conditionals or anything else. In practice this is *unbelievably* buggy and I must admit to being very disappointed with the PDF output from the drop-down heading styles. I've reported many bugs, some of which make my output look so awful that I have indeed not been able to do this as I had planned above.

Major bugs are:
  • The auto-numbering positioning for the heading levels just doesn't work. If you use auto-numbering, check you are happy with the PDF output before you go ahead and do lots of the same.
  • Pagination is poor. It seems that the drop-down body attempts to bind the content more tightly than your attempts to keep heading levels with the text that follows. I've tried all sorts of things to force this not to be the case. But typically, you can expect to get page breaks thrown where they are not needed (the heading and some of the body text could fit on one page before the page break, but it doesn't) or widow headings at the bottom of a page.
  • PDF bookmarks lose the auto-numbers for the drop-down head items
  • PDF bookmarks can appear in the wrong order for the drop-down items although they point to the correct locations (for example a level 3 bookmark may appear below the level 2 bookmark above where it really belongs).
In the end, this is what I did.

  • I used the drop-down head for the web as normal - works well.
  • I also added the appropriate level N heading immediately below it, with exactly the same text
  • I set a print style for the drop-down head to be invisible text and tiny (1px high), so it is effectively not there - due to another bug, this is far easier than messing around with print/web conditionals for drop-down heads.
  • I created a "template" snippet to add a blank one of these, which I convert to text when I place it. That way, I'm sure I've set it up correctly.
I still have widow headings at the bottom of some pages and have eventually got MadCap to agree this is a bug.

There is one good thing about having the print headings inside the drop-downs and that is the fact that if you want to xref to a drop-down in the web output, the drop-down will not expand unless you xref into the drop-down body, rather than to the drop-down head. So the print headings give me a target for xrefs, and for the PDF output, the xref will include the auto-number on the heading as usual. Since this text duplicates the drop-down header in the web output, you may want to make these heading style tiny and invisible in the web output, in the same way as I made the drop-down headings tiny and invisible in the print output. The bookmark will still work. But I decided to leave them visible, since it's a useful navigation aid for the reader when an xref jumps them into a drop-down as the drop-down heading will often be off the top of the screen.

More bugs.
  • If you do want to conditionalize the drop-down head (for example to be web-only) you need to set the condition on the drop-down hotspot but the only way the Flare editor lets you do it is on the containing drop-down header. Or perhaps it's the other way round? In any case, you need to apply conditions directly in the XML code to get them to work for print/web as however the Flare editor applies them doesn't give the required result.
  • When you edit your drop-down content, you can only access styles of the CSS tag your text is in. So if you have a <p> tag, you can change it to another <p> style, but not to an <h2> style without editing the XML directly. Similarly if you have a <h2> style, you can't make it <h3>. Fortunately I found a work-around for this, and that's to wrap the whole drop-down body in a <div>. So that's in my snippet template for drop-downs too.
Come on MadCap - It really shouldn't be this difficult. :-(
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
Msquared
Propellus Maximus
 
Posts: 847
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: Dropdown heads and PDF styles

Postby dorcutt on Thu Aug 21, 2014 6:54 am

Submitted a feature request to make this work using only mediums and not these incredibly well-developed workarounds.

Msquared, thanks for taking the time to share your knowledge on this topic! All of this knowledge was clearly learned at a great cost of time and annoyance.
-Dan, Propellerhead-in-training
dorcutt
Sr. Propeller Head
 
Posts: 234
Joined: Thu May 15, 2014 12:16 pm

Re: Dropdown heads and PDF styles

Postby Dave Lee on Thu Aug 21, 2014 7:38 am

dorcutt wrote:Submitted a feature request to make this work using only mediums and not these incredibly well-developed workarounds.


Unless I've missed something, it does work using only mediums; just style the dropDownHead the way you want it to appear in the appropriate medium. Note that you'll probably want to style the the dropDownHotspot too.

That'll work fine if you just want it to look like other headings.

If you actually need it to be a heading style (e.g. h1, h2), rather than just look like one - then use a toggler, not a dropdown. Just create a normal heading and set it up as a toggler for the content you want to display; in the PDF output, the toggler content is displayed as normal (like the dropdown body).

Msquared - I would guess that your scenario might be a lot easier using togglers, rather than using dropdowns with elaborate workarounds.
Dave Lee
Senior Propellus Maximus
 
Posts: 4968
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Dropdown heads and PDF styles

Postby Msquared on Thu Aug 21, 2014 11:03 am

Msquared - I would guess that your scenario might be a lot easier using togglers, rather than using dropdowns with elaborate workarounds


Thanks. Will try those when I get a minute. I've not really got into togglers - for some reason I decided they weren't what I needed.

I'm in a bit of a lull between releases right now, and so far I have managed to get Global Project Linking working (at last, and not without some pain), and set up some proper project templates. Oh, and report lots of bugs, so I guess I'm not MadCap Support's favourite person at present. :-)
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
Msquared
Propellus Maximus
 
Posts: 847
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: Dropdown heads and PDF styles

Postby Oda on Mon Aug 25, 2014 2:39 am

Thanks all for your answers. For my part, setting the dropdownhead for print medium seemed to work (I first thought dropdown styles could only be set fo web outputs). However, I had a formating parameter which wouldn't apply, but I sorted it out by setting also the dropdownhotspot style.
Oda
Propeller Head
 
Posts: 48
Joined: Tue Apr 15, 2014 6:04 am

Re: Dropdown heads and PDF styles

Postby Amanda_Wood on Tue Oct 10, 2017 1:25 am

I am struggling with this same issue in October 2017. The PDF page breaks are a pain in the biggest....and I have not figured out how to fix it so I gave up. I tried creating a Div with avoiding inside page breaks, but this does not work well. I see all the other work arounds below, and I am not prepared to do this since it is 3 years later and obviously this bug is not considered important. But it is. I want drop downs in the HTML...wonderful things, but when I generate all the PDFs they look terrible.

[*]Pagination is poor. It seems that the drop-down body attempts to bind the content more tightly than your attempts to keep heading levels with the text that follows. I've tried all sorts of things to force this not to be the case. But typically, you can expect to get page breaks thrown where they are not needed (the heading and some of the body text could fit on one page before the page break, but it doesn't) or widow headings at the bottom of a page.
Amanda_Wood
Jr. Propeller Head
 
Posts: 2
Joined: Fri Dec 16, 2016 5:08 am


Return to Single-Sourcing

Who is online

Users browsing this forum: No registered users and 2 guests