There are two ways to customize the look and feel of individual article PDFs.
For general structure/layout of individual articles, go to Customize > PDF and adjust the settings there--you can add a watermark, password, header HTML, and footer HTML.
But if you want to show or hide content in all PDFs, custom CSS is your friend. All PDF content is prefixed with the hg-pdf
CSS class, so you can target this class in your selectors to show or hide content in PDFs.
One of the most common requests we get is to display a logo or other image in article PDFs that isn't displayed in the live knowledge base. Here's how we achieve that:
- Go to Customize > Style (Custom HTML & CSS).
- In the Customize HTML, CSS, and JS section, select Custom HTML.
- In the Select HTML section to edit dropdown, select Article.
- Near the top of your article, wherever you'd like the logo to appear, add some HTML for your logo. We recommend using a div with a
pdf-logo
class and putting the image inside that div, like this:<div class="pdf-logo" align="center"> <img src="https://dyzz9obi78pm5.cloudfront.net/app/image/id/1111/n/pdflogo.png" /> </div>
- If you use the above code as a sample, replace the img src URL in row 2 with a URL of a valid image file in your Files library.
- Go to Custom CSS.
- Copy the CSS below and paste it into your Custom CSS. The first CSS piece hides the PDF logo in the live knowledge base; the second displays it in PDFs.
/* Hide PDF logo in live knowledge base */ .pdf-logo { display:none; } /* Display PDF logo in PDFs only */ .hg-pdf .pdf-logo { display:block; }
- Be sure to Save your changes.
Changes won't show immediately
PDFs won't immediately update to show these changes. You'll only see the changes in:
- Articles created after you made the changes.
- Articles edited and saved after you made the changes (we usually use a specific article to test with and add/remove a line of text and re-save to test our formatting changes).