menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfPageTemplate - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfPageTemplate

    Represents which page goes to be visible in the current document

    Inheritance
    System.Object
    PdfPageTemplate
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfPageTemplate

    Constructors

    PdfPageTemplate(PdfPageBase)

    Create a PdfPageTemplate

    Declaration
    public PdfPageTemplate(PdfPageBase page)
    Parameters
    Type Name Description
    PdfPageBase page
    Examples
    // Loads an existing PDF Document
    PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
    //Get the first page of the document
    PdfPageBase page = loadedDocument.Pages[0];
    //Create a page template
    PdfPageTemplate pageTemplate = new PdfPageTemplate(page);
    //Sets the PdfPageTemplate name
    pageTemplate.Name = "pageTemplate";
    //Sets the PdfPageTemplate is visible
    pageTemplate.IsVisible = true;
    //Adds the page template
    loadedDocument.PdfPageTemplates.Add(pageTemplate);
    //Save the document
    loadedDocument.Save("output.pdf");
    //Close the document
    loadedDocument.Close(true);
    'Loads an existing PDF Document
    Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
    'Get the first page of the document
    Dim page As PdfPageBase = loadedDocument.Pages(0)
    'Create a page template
    Dim pageTemplate As PdfPageTemplate = New PdfPageTemplate(page)
    'Sets the PdfPageTemplate name
    pageTemplate.Name = "pageTemplate"
    'Sets the PdfPageTemplate is visible
    pageTemplate.IsVisible = True
    'Adds the page template
    loadedDocument.PdfPageTemplates.Add(pageTemplate)
    'Save the document
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close(True)

    PdfPageTemplate(PdfPageBase, String, Boolean)

    Create a PdfPageTemplate

    Declaration
    public PdfPageTemplate(PdfPageBase page, string name, bool isVisible)
    Parameters
    Type Name Description
    PdfPageBase page
    System.String name
    System.Boolean isVisible
    Examples
    // Loads an existing PDF Document
    PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
    //Get the first page of the document
    PdfPageBase page = loadedDocument.Pages[0];
    //Create a page template
    PdfPageTemplate pageTemplate = new PdfPageTemplate(page);
    //Sets the PdfPageTemplate name
    pageTemplate.Name = "pageTemplate";
    //Sets the PdfPageTemplate is visible
    pageTemplate.IsVisible = true;
    //Adds the page template
    loadedDocument.PdfPageTemplates.Add(pageTemplate);
    //Save the document
    loadedDocument.Save("output.pdf");
    //Close the document
    loadedDocument.Close(true);
    'Loads an existing PDF Document
    Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
    'Get the first page of the document
    Dim page As PdfPageBase = loadedDocument.Pages(0)
    'Create a page template
    Dim pageTemplate As PdfPageTemplate = New PdfPageTemplate(page)
    'Sets the PdfPageTemplate name
    pageTemplate.Name = "pageTemplate"
    'Sets the PdfPageTemplate is visible
    pageTemplate.IsVisible = True
    'Adds the page template
    loadedDocument.PdfPageTemplates.Add(pageTemplate)
    'Save the document
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close(True)

    Properties

    IsVisible

    Gets or sets the PdfPageTemplate is visible or not

    Declaration
    public bool IsVisible { get; set; }
    Property Value
    Type
    System.Boolean
    Remarks

    Default Value: true

    Examples
    // Loads an existing PDF Document
    PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
    //Get the first page of the document
    PdfPageBase page = loadedDocument.Pages[0];
    //Create a page template
    PdfPageTemplate pageTemplate = new PdfPageTemplate(page);
    //Sets the PdfPageTemplate name
    pageTemplate.Name = "pageTemplate";
    //Sets the PdfPageTemplate is visible
    pageTemplate.IsVisible = true;
    //Adds the page template
    loadedDocument.PdfPageTemplates.Add(pageTemplate);
    //Save the document
    loadedDocument.Save("output.pdf");
    //Close the document
    loadedDocument.Close(true);
    'Loads an existing PDF Document
    Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
    'Get the first page of the document
    Dim page As PdfPageBase = loadedDocument.Pages(0)
    'Create a page template
    Dim pageTemplate As PdfPageTemplate = New PdfPageTemplate(page)
    'Sets the PdfPageTemplate name
    pageTemplate.Name = "pageTemplate"
    'Sets the PdfPageTemplate is visible
    pageTemplate.IsVisible = True
    'Adds the page template
    loadedDocument.PdfPageTemplates.Add(pageTemplate)
    'Save the document
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close(True)

    Name

    Gets or sets the PdfPageTemplate name

    Declaration
    public string Name { get; set; }
    Property Value
    Type
    System.String
    Examples
    // Loads an existing PDF Document
    PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
    //Get the first page of the document
    PdfPageBase page = loadedDocument.Pages[0];
    //Create a page template
    PdfPageTemplate pageTemplate = new PdfPageTemplate(page);
    //Sets the PdfPageTemplate name
    pageTemplate.Name = "pageTemplate";
    //Sets the PdfPageTemplate is visible
    pageTemplate.IsVisible = true;
    //Adds the page template
    loadedDocument.PdfPageTemplates.Add(pageTemplate);
    //Save the document
    loadedDocument.Save("output.pdf");
    //Close the document
    loadedDocument.Close(true);
    'Loads an existing PDF Document
    Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
    'Get the first page of the document
    Dim page As PdfPageBase = loadedDocument.Pages(0)
    'Create a page template
    Dim pageTemplate As PdfPageTemplate = New PdfPageTemplate(page)
    'Sets the PdfPageTemplate name
    pageTemplate.Name = "pageTemplate"
    'Sets the PdfPageTemplate is visible
    pageTemplate.IsVisible = True
    'Adds the page template
    loadedDocument.PdfPageTemplates.Add(pageTemplate)
    'Save the document
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close(True)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved