11 Replies Latest reply on Mar 16, 2011 7:26 AM by Peter Grainge

    Print Conditional tag from an Online Manual

    BrianCCD

      Hello-

       

      I am wondering if it is possible to build a conditional tag that can applied to an online manual, that only shows up if someone should print something from that manual.

       

      Example: I have a certain set of instructions that are updated regularly and if someone should print those instructions they run the risk of using outdated material by referring to the printed instructions. I would like to have a disclaimer print on ever topic they print out that reads something like: "Do not use this printed material. Please refer to online version for updated instructions." But I only want this to show up should the user print the material.

       

      Is that a possibility?

       

      Thanks in advance!

       

      BrianCCD

      RoboHelp HTML 9

        • 1. Re: Print Conditional tag from an Online Manual
          RoboColum(n) Level 5

          Hi Brian.

           

          You can't do this inside RoboHelp. Maybe you'd be able to do this programmatically with a script that interacts with the user's print driver but I wouldn't have a clue where to start.

           


            The RoboColum(n)   @robocolumn   Colum McAndrew
          • 2. Re: Print Conditional tag from an Online Manual
            MergeThis Level 4

            CSS Media rules would normally be used for this type of issue, but RH used to ignore them (at least in RH X5). I don't know if they've fixed it in RH8 or RH9. I would say try and see.

             

            See the W3C web site for more help.

             

             

            Good luck,

            Leon

            • 3. Re: Print Conditional tag from an Online Manual
              Willam van Weelden Adobe Community Professional & MVP

              Hi Leon,

               

              RoboHelp leaves @media blocks (and @import rules with media) in you css. As far as I could find, the WYSIWYG editor ignores the media and uses the styles. It doesn't seem to adhere the !important rule, but it works like a charm in output.

               

              For example:

              @media print {

                   div.droptext {
                      display: block !important;    /*Always show dropdowns on print.*/
                  }

              }

               

              Greet,

               

              Willam

              • 4. Re: Print Conditional tag from an Online Manual
                MergeThis Level 4

                Yes, Willam, the external css file is the way to go, because even in RH 8 (tested this morning) placing the @media inside the HEAD section of a source topic:

                 

                @media screen
                  {
                  p {font-family:verdana,sans-serif;font-size:24px;}
                }
                @media print
                  {
                  p {font-family:times,serif;font-size:10px;font-weight:bold;}
                  }

                results in this stripped-down version in the output topic:

                 

                <style type="text/css">
                <!--
                -->
                </style>

                I remember now that when I looked at this, years ago, I was not interested enough in the end result to spend any time playing with the css file (I was a novice in css at the time, so zero knowledge = zero interest), and adding it to the output files post-production was no less odious.

                 

                So:

                @media in RH source files: NO

                @media in RH output files: YES

                @media in css file: YES

                 

                 

                Good luck,

                Leon

                • 5. Re: Print Conditional tag from an Online Manual
                  Willam van Weelden Adobe Community Professional & MVP

                  Thanks for the overview Leon.

                   

                  Greet,

                   

                  Willam

                  • 6. Re: Print Conditional tag from an Online Manual
                    BrianCCD Level 1

                    Thanks everyone for your responses.

                     

                    MergeThis - I happen to be where you were years ago...a novice in regards to CSS style sheets (also RoboHelp and coding for that matter).

                     

                    So, just to clarify, I will need to alter the CSS style sheet after the project has been generated.

                     

                    At the risk of looking like a fool - What do I need to add to the CSS style sheet? Is it the code previously mentioned?

                     

                    @media screen
                      {
                      p {font-family:verdana,sans-serif;font-size:24px;}
                    }
                    @media print
                      {
                      p {font-family:times,serif;font-size:10px;font-weight:bold;}
                      }

                     

                    Or am I way off base? Thank you guys so much for your help!

                    • 7. Re: Print Conditional tag from an Online Manual
                      MergeThis Level 4

                      No, Brian, that code I provided was goofy stuff just to show you an example of something. And if you configure the .css file in your project source folder, the settings will carry over to the output.

                       

                      You might not even need to have the "screen" media element, just the "print" one. You'd want something like:

                       

                      @media print

                           {

                           p.notprint {font-size: 1.5em}

                           }

                       

                      (The 1.5em means that the text will be 150% of the default <p> tag size.)

                       

                      Then, the HTML code for your disclaimer inside the topic would be:

                       

                      <p class="notprint">MyDisclaimerText</p>

                       

                      See the web site I suggested for help on customizing the text (font type, color, background color, etc.).

                       

                       

                      Good luck,

                      Leon

                      1 person found this helpful
                      • 8. Re: Print Conditional tag from an Online Manual
                        BrianCCD Level 1

                        Thanks Leon-

                         

                        I wasn't able to get this to work. This is most likely because of my lack of programming ability. I do not know how to code. I will have to do some extra research to learn how and where to put this code.

                         

                        I might have done this completely wrong, but I tried to put:

                         

                        @media print

                             {

                             p.notprint {font-size: 1.5em}

                             }

                         

                        inside the header of the topic, but RoboHelp automatically moves that to the <body> portion of the code, and then that shows up in my output. I also tried putting that code in the CSS style sheet, but then the:

                         

                        <p class="notprint">MyDisclaimerText</p>

                         

                        still showed up in my output, instead of remaining hidden on screen and showing up on print.

                         

                        Thanks for the help! I will let you know what I find out. If you have any more suggestions, or corrections, please let me know.

                         

                        BrianCCD

                        • 9. Re: Print Conditional tag from an Online Manual
                          Peter Grainge Adobe Community Professional (Moderator)

                          Brian

                           

                          If you are still looking for a solution, I came across a solution posted by Pete Lees who used to be a frequent contributor to these forums.

                           

                          I have posted it in Snippets on my site. http://www.grainge.org/pages/snippets/snippets.htm

                           


                          See www.grainge.org for RoboHelp and Authoring tips

                           

                          @petergrainge

                          • 10. Re: Print Conditional tag from an Online Manual
                            BrianCCD Level 1

                            Thank you Mr. Grainge-

                             

                            This solution did not work for me. I must be doing something incorrect.

                             

                            First, I appended the very end of my CSS style sheet using notepad with:

                             

                            @media screen

                            {

                            p.copyright {display:none:}

                            }

                            @media print

                            {

                            p.copyright {display:block;}

                            }

                             

                            Then I create a topic and pasted in the code:

                             

                            <p class="copyright">Copyright <?rh-symbol_start name="Copyright" ?>©<?rh-symbol_end ?> 2011 My Company Name</p>

                             

                            And it still displays on my monitor when publishing WebHelp files. What am I doing incorrectly?

                             

                            RoboHelp HTML 9

                             

                            Thanks,

                             

                            BrianCCD

                            • 11. Re: Print Conditional tag from an Online Manual
                              Peter Grainge Adobe Community Professional (Moderator)

                              You did create a style called Copyright? If you did, send me the CSS file. It will be a couple of days before I reply as I will be travelling. See the contact page on my site.

                               


                              See www.grainge.org for RoboHelp and Authoring tips

                               

                              @petergrainge