Skip to main content
Known Participant
January 28, 2021
Question

Add page numbers to pdf?

  • January 28, 2021
  • 7 replies
  • 342 views

Using RH 2020 is there a way to add page numbers to the generated pdf?

Is that what the master page does? 

 

Is there a way to apply my styles to the pdf? Specifically, all images have a line around them on the help pages but not in the pdf.

 

 

    This topic has been closed for replies.

    7 replies

    Known Participant
    January 28, 2021

    Thanks that fixed my problem.

    But I did have to fiddle with the style sheet of the master page that I had applied to the pdf.

    First I updated the main css file and when I produced the PDF the images had a big red border.

    The style sheet of the master document I created for the PDF had that red border in it ( I guess by default)

    The main style sheet and the style sheet from the master document seem to work together. After some trial and error, it is now working.

     

    Thank you both for your help.

    Mary Ann

    Mary Ann

     

    Known Participant
    January 28, 2021

    This might not be a question for you....but here are my results.

    This is what I have in my css

    img {
    border: 1px solid #D2D7D9;
    height: auto;
    max-width: 100%;
    }

     

    If I change it to follow your format then I don't get a line around my image at all in RH. I am still playing with it, I imagine it may be a syntax error?

    Community Manager
    January 28, 2021

    That's because Peter's CSS will apply only to images that have a class "border" assigned.

    That is, his definition:

     

    img.border {
      /* definitons */
    }

     

    will only apply to these images:

     

    <img src="path/to/your/image.png" class="border"/>

     

    but not to these:

    <img src="path/to/your/image.png"/>

     

    Your CSS:

     

    img {
      /* definitons */
    }

     

    will apply to ALL (each and every) image - with our without a class:

     

    <img src="path/to/your/image.png" />
    <img src="path/to/your/image.png" class="border"/>
    <img src="path/to/your/image.png" class="noborder"/>

     

     

    I strongly recommend to follow Peter's approach and give all images of the specific type a dedicated class, and define the css only for this class. The shorthand form you used is absolutely fine. Combined it would be like this:

    HTML:
    <img src="path/to/your/image.png" class="border"/>
    
    CSS:
    img.border {
       border: 1px solid #D2D7D9;
       height: auto;
       max-width: 100%;
    }

     

     

    Known Participant
    January 28, 2021

    Thanks I'll give it a try!

    Peter Grainge
    Community Expert
    January 28, 2021

    I just created a new img style using the supplied CSS editor. I did it through the UI editor but this is the source code.

     

    img.border {
    border-width: 6px;
    border-style: solid;
    border-color: #FF0000;
    border-left-width: 6px;
    border-left-style: solid;
    border-left-color: #FF0000;
    border-top-width: 6px;
    border-top-style: solid;
    border-top-color: #FF0000;
    border-right-width: 6px;
    border-right-style: solid;
    border-right-color: #FF0000;
    border-bottom-width: 6px;
    border-bottom-style: solid;
    border-bottom-color: #FF0000;
    }

     

    Applied it to an image and the border appeared in a PDF.

    ________________________________________________________
    See www.grainge.org for free Authoring and RoboHelp Information

     

     

    Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.
    Known Participant
    January 28, 2021

    Yay I have page numbers now!

    Known Participant
    January 28, 2021

    The lines are applied through a css file.

    Peter Grainge
    Community Expert
    January 28, 2021
    1. Page Numbers. You've got it. Add page numbering to a master page and apply that in the preset.
    2. How are the lines applied to the images? 

    ________________________________________________________
    See www.grainge.org for free Authoring and RoboHelp Information

    Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.