Skip to main content

PdfStyle

Definition

Namespace: Surya.Ab.Export.Client.Models
Assembly: Surya.Ab.Export.dll

It holds all style related properties for the PDF Document and a common style property for all DataSets.

public class PdfStyle : SheetStyle

Inheritance SheetStyle -> PdfStyle

Structure

public class PdfStyle : SheetStyle { }

Example

// get an instance of PdfStyleBuilder
var pdfStyleBuilder = serviceProvider.GetRequiredService<IPdfStyleBuilder>();

// create and build PdfStyle
var pdfStyle = pdfStyleBuilder
.HeaderStyle(new AbStyle()
{
FontSize = 20,
BackgroundColor = Color.AliceBlue
})
.FooterStyle(new AbStyle()
{
FontSize = 8,
Color = Color.Brown
})
//Styles for dataset items
.DatasetHeaderStyle(new AbStyle()
{
FontSize = 15,
Color = Color.Green
})
.DatasetTableHeaderStyle(new AbStyle()
{
FontSize = 12,
BackgroundColor = Color.Magenta
})
.DatasetBodyStyle(new AbStyle()
{
BackgroundColor = Color.LightYellow,
FontSize = 10
})
.DatasetFooterStyle(new AbStyle()
{
FontSize = 8,
Color = Color.PaleGoldenrod
})
.Build()

Edit on GitHub