---
title: Creating printable versions of documents
related:
  - https://docs.kentico.com/k8/developing-websites/designing-websites-using-css/using-printer-friendly-css-styles.md
  - https://docs.kentico.com/k8/developing-websites/loading-and-displaying-data-on-websites.md
  - https://docs.kentico.com/k8/developing-websites/loading-and-displaying-data-on-websites/writing-transformations.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Kentico allows you to add a link button to your pages that creates a print version of the given page.

## Creating a Print button

The following example shows how to create a print button for the news section on the sample Corporate Site.

1. Open the **Pages** application.
2. Select the **News** document in the content tree.
3. Switch to the **Design** tab.
4. [Add](https://docs.kentico.com/k8/developing-websites/developing-websites-using-the-portal-engine/using-and-configuring-web-parts.md) the **Static text** web part into the **Main zone**.
5. Configure the web part properties:
   - **Web part control ID**: PrintLink
   - **Show for document types**: CMS.News
   - **Text**:

     ```html

     <div class="PrintLink">
                 <br />
                 <a href="~/SpecialPages/E-Shop/Print.aspx?printpath={%NodeAliasPath%}&classname={%ClassName%}" target="_blank" >
                             <img class="PrintImage" src="~/App_Themes/CorporateSite/Images/Print.gif" alt="Print" />
                             Print
                 </a>
     </div>

     ```

     ![Configuring the static text web part to display a print link](https://docs.kentico.com/docsassets/k8/creating-printable-versions-of-documents/Print_Link_Configuration.png "Configuring the static text web part to display a print link")
6. Click **OK**.
7. Create a print [transformation](https://docs.kentico.com/k8/developing-websites/loading-and-displaying-data-on-websites/writing-transformations.md) for the News document type:
   1. Open the **Document types** application.
   2. **Edit** () the **News** document type.
   3. Switch to the **Transformation** tab.
   4. Click **New Transformation**.
   5. Type _Print_ as the **Transformation name** and copy the following content into the code editor.

      ```html

      <h1><%# Eval("NewsTitle") %></h1>
      <%# IfEmpty(Eval("NewsTeaser"), "", GetImage("NewsTeaser")) %>
      <div class="gray"><%# GetDateTime("NewsReleaseDate", "d") %></div>
      <p><%# Eval("NewsSummary") %></p>
      <p><%# Eval("NewsText") %></p>

      ```
   6. Click **Save**.

      ![Creating the Print transformation for News documents](https://docs.kentico.com/docsassets/k8/creating-printable-versions-of-documents/Print_Transformation.png "Creating the Print transformation for News documents")

You can now open the live version of the Corporate site and select a news article in the **News** section. The page contains the **Print** button, which opens and displays the print version of the given article (using the Corporate site's default Print page and the created transformation).

## Creating the Print page on your site

The **Print** page used in the previous example is already included as part of the sample Corporate Site. On your own website, you need to create the Print page yourself:

1. Open your site in the **Pages** application.
2. [Add](https://docs.kentico.com/k8/managing-website-content/working-with-documents-and-pages/creating-new-documents-and-pages.md) a new **Page (menu item)** document (outside of the site's standard navigation).
3. Name the page **Print** and use the **Create a blank page** option when selecting the page template.
4. Disable [page nesting](https://docs.kentico.com/k8/developing-websites/developing-websites-using-the-portal-engine/inheriting-portal-engine-page-content.md) in **Properties** -> **Template**.
5. Return to the **Design** tab.
6. Add the **Repeater** web part to render the Print transformation.
7. Set the following properties for the Repeater web part:

   - **Path**: {? printpath|(default)/% ?}
   - **Document types**: {? classname|(default)cms.root ?}
   - **Transformation**: {? classname|(default)cms.root ?}.print

     > **Info:** The values are [macro expressions](https://docs.kentico.com/k8/macro-expressions.md) that dynamically load data from the URL query string parameters in the print link (_printpath_ and _classname_). The macros also provide default values that the web part uses if no values are supplied in the URL (for example if you navigate directly to the **Print** page without a print button link).
8. Click **OK**.
9. Add the path to your print page into the print links that you use on your website.
