Skip to main content
Inspiring
March 23, 2022
Question

Why doesn't RH use my CSS file when it creates a PDF?

  • March 23, 2022
  • 4 replies
  • 565 views

I am new to RH. I created a CSS file that works just fine in HTML output. The CSS file uses many variables. I came to the conclusion that RH does not use the CSS as written. When I generate an HTML output and inspect the CSS file embedded in its assets folder, I find that all the variables have been replaced with their values, which is fine. There were other simplifications.

 

SO, I replaced my original CSS file with the one embedded in the HTML output, and then generated the PDF. In this case, most of the styling was as expected. The notable exception was lists and a few issues inside tables.

 

SO, (1) why can't RH use my CSS file as is and generate a PDF that agrees with the CSS?

 

(2) I noted that the content shown in the RH editor looks fine with all the correct styling, including the lists. SO, if RH can display my content styled correctly in its own editor, why can't it do the same when it generates a PDF?

 

At the very least, I would think that RH would preprocess the CSS, as it appears to do for HTML outputs, and use the processed CSS in generating the PDF.

 

(3) SO, what are the known issues or limitations in CSS that makes RH generate incorrect PDF?

 

I am creating CSS3-compliant CSS.

 

Thanks for your help,

Van

 

    This topic has been closed for replies.

    4 replies

    Community Expert
    March 23, 2022

    I can't speak directly about what RH can or can't do, but my understanding is that the different pdf generators don't support all CSS properties and attributes. I haven't yet found anywhere that documents which pdf generators support which css code. So as Peter said, your best bet would be to contact Adobe support directly.

    Inspiring
    March 23, 2022

    Note that you can have different styling for the PDF than for the online help by sing @media print. See an example on tutorialspoint.com.

    Peter Grainge
    Community Expert
    Community Expert
    March 23, 2022

    Suggestion.

     

    Create a new single topic project using just the supplied default.css. Create a list using RoboHelp's UI editor that has the appearance you want and with just one topic generate a PDF.

     

    If that looks how you want then the difference between the RoboHelp's CSS and yours might reveal why there is a difference. 

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Van KurtzAuthor
    Inspiring
    March 23, 2022

    I have looked at how RH does it, and will likely yield to it, but using marker is so much cleaner than before and counters, etc.

     

    But this approach avoids my general question: if RH can read my CSS well enough to display it in its editor, why cannot it do the same thing when generating a PDF? I know we sometimes have to take the  just-do-what-is-necessary-to-make-it-work approach; but it would be so much better if I could write CSS3-compliant CSS and have it work in all parts of RH.

     

    Peter Grainge
    Community Expert
    Community Expert
    March 23, 2022

    I was trying to provide a solution rather than answering the question as that is something I suspect only Adobe can answer. The issue is obviously something to do with how the code is translated into PDF format but what I don't know.

     

    See https://helpx.adobe.com/contact/enterprise-support.other.html#robohelp for your Adobe Support options. The email link tcssup@adobe.com is recommended as it reaches a team dedicated to Technical Communication Suite products including RoboHelp. 

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Jeff_Coatsworth
    Community Expert
    Community Expert
    March 23, 2022

    What point version of RH are you running? Are you all patched up? Check Help > Updates to check.

    Van KurtzAuthor
    Inspiring
    March 23, 2022

    2020.7.0

     

    Regarding lists... I create the CSS directly in the code view. I use standard structures, such as

    <ol>

       <li>aaaa</li>

       <li>bbbb</li>

    </ol>

     

    To format the numbers used in the list, I use the CSS selector ol>li:marker, which most if not all browsers can handle. The RH content editor displays the numbers just fine. Why can't the PDF also?