---
schema_version: "1"
id: 9c4e1d11d7552ca82122ffc6cd88825d43cd60c034c1871254461d78079cc693
title: Converting a Page to a PDF File
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/quick-start/pages-quick-start-renderas-pdf.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-quick-start-renderas-pdf.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ee7974bee76ab19f1d2b0ed9e2ba36289987af8af5a4039f6bf1d2f99102c57e
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Converting a Page to a PDF File

You can render any page as a PDF by adding the `renderAs` attribute to the `<apex:page>` component, and specifying “pdf” as the rendering service. For example:

```visualforce
<apex:page renderAs="pdf">

```

Visualforce pages rendered as PDFs will either display in the browser or download as a PDF file, depending on your browser settings.

In the previous tutorial, you used a Visualforce page to change the name of a company. Suppose you wanted to generate an announcement of the new name as a PDF. The following example produces such a page, along with the current date and time.

<!-- otherprops: apex_page -->
```markup
<apex:page standardController="Account" renderAs="pdf" applyBodyTag="false">
    <head>
        <style> 
            body { font-family: 'Arial Unicode MS'; }
            .companyName { font: bold 30px; color: red; }  
        </style>
    </head>
    <body>
        <center>
        <h1>New Account Name!</h1>
     
        <apex:panelGrid columns="1" width="100%">
            <apex:outputText value="{!account.Name}" styleClass="companyName"/>
            <apex:outputText value="{!NOW()}"></apex:outputText>
        </apex:panelGrid>
        </center>
    </body>
</apex:page>
```

Things to note about the page:

-   `<style>` is CSS markup, not Visualforce markup. It defines the font family used for the entire page, as well as a particular style for the company name.
-   Some of the output text is contained in an `<apex:panelGrid>` component. A panel grid renders as an HTML table. Each component found in the body of the `<apex:panelGrid>` component is placed into a corresponding cell in the first row until the number of columns is reached. As there is only a single cell, each output text is displayed in a separate row.

![A Visualforce page rendered as a PDF](https://developer.salesforce.com/media/salesforce-pages-developers-guide/pages_quick_start_render_as_pdf.png "A Visualforce Page Rendered as PDF")

Always verify the format of your rendered page before deploying it.

**See Also**  


-   [Render a Visualforce Page as a PDF File](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/styling/pages-output-pdf-renderas.md)
-   [Visualforce PDF Rendering Considerations and Limitations](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/styling/pages-output-pdf-considerations.md)

