---
title: "Custom Page Settings"
canonical_url: "https://www.compdf.com/guides/generation-sdk/dotnet-core/generation/email-page-settings"
md_url: "https://www.compdf.com/guides/generation-sdk/dotnet-core/generation/email-page-settings.md"
description: "ComPDF SDK Guides. In this developer's guide, all the details and how to use ComPDF for SDK Guides will be covered in depth."
---

# Custom Page Settings

When `CConverterProperties` is supplied, its page size, page margins and header/footer settings are used as they are, including explicit zero margins, and the default email margins no longer apply. A new `CConverterProperties` has zero margins, so set the page margins explicitly. The base URI in `CConverterProperties` has no effect. Here is an example:

```csharp
using (CConverterProperties properties = new CConverterProperties())
{
    // US Letter paper, in points
    properties.SetPageSize(new CSize { Width = 612, Height = 792 });
    // Page margins, in CSS px
    properties.SetPageMargins(new CPageMargins { Top = 48, Right = 48, Bottom = 48, Left = 48 });
    // Show page numbers in the footer
    properties.SetHeaderFooterOptions(new CHeaderFooterOptions
    {
        DisplayHeaderFooter = true,
        HeaderTemplate = "<div></div>",
        FooterTemplate = "<div style='font-size:9px;text-align:center;padding-top:16px'>" +
                         "<span class='pageNumber'></span> / <span class='totalPages'></span></div>"
    });

    using (CEmailResult result = CEmailConverter.ConvertToPdf("/mail.msg", "/mail.pdf", CEmailFormat.EMAIL_FORMAT_MSG, null, properties))
    {
    }
}
```

For how to use headers and footers, see [Page Margins and Headers/Footers](https://www.compdf.com/guides/generation-sdk/dotnet-core/generation/html-header-footer).
