iText 9.8.0 API
iText.Layout.Properties.Margins.PageMarginBoxes Class Reference

Class to store information about all page margin boxes for a single page. More...

Public Member Functions

  PageMarginBoxes (IList< PageMarginContent > margins)
  Creates new PageMarginBoxes instance. More...
 
  PageMarginBoxes (iText.Layout.Properties.Margins.PageMarginBoxes other)
  Creates new PageMarginBoxes instance by copying existing one. More...
 
virtual PageMarginContent  GetPageMarginContent (MarginBoxName marginBoxName)
  Gets page margin content PageMarginContent by margin box name. More...
 
virtual float[]  GetMarginSizes ()
  Gets page margin sizes in top, right, bottom, left order. More...
 
virtual iText.Layout.Properties.Margins.PageMarginBoxes  SetMarginSizes (float[] marginSizes)
  Sets page margin sizes in top, right, bottom, left order. More...
 
virtual float[]  Layout (DocumentRenderer documentRenderer, int pageNumber, Rectangle pageSize)
  Layouts all page margins to calculate their occupied area and page margin sizes. More...
 
virtual void  Draw (DocumentRenderer documentRenderer, PdfDocument document, int pageNumber)
  Draws all page margins for the page specified via page number. More...
 
override bool  Equals (Object o)
 
override int  GetHashCode ()
 

Static Public Member Functions

static void  Draw (IRenderer marginRenderer, Rectangle marginRect, DocumentRenderer documentRenderer, PdfDocument document, int pageNumber, String marginBoxName)
  Draws all page margins for the page specified via page number. More...
 
static IRenderer  CreateRendererFromElement (IElement element, DocumentRenderer documentRenderer, PdfDocument pdfDocument)
  Creates renderer from element excluding page breaks and adds tagging tree hints. More...
 

Package Functions

virtual void  SetPageMarginTagRole (IElement element)
  Sets the role of the page margin element to use in the document tag tree. More...
 

Detailed Description

Class to store information about all page margin boxes for a single page.

Constructor & Destructor Documentation

◆ PageMarginBoxes() [1/2]

iText.Layout.Properties.Margins.PageMarginBoxes.PageMarginBoxes ( IList< PageMarginContent >  margins )
inline

Creates new PageMarginBoxes instance.

Parameters
margins list of PageMarginContent instances representing page margin content for corresponding margin box name MarginBoxName (position on the page)

◆ PageMarginBoxes() [2/2]

iText.Layout.Properties.Margins.PageMarginBoxes.PageMarginBoxes ( iText.Layout.Properties.Margins.PageMarginBoxes  other )
inline

Creates new PageMarginBoxes instance by copying existing one.

Parameters
other

PageMarginBoxes to copy

Member Function Documentation

◆ CreateRendererFromElement()

static IRenderer iText.Layout.Properties.Margins.PageMarginBoxes.CreateRendererFromElement ( IElement  element,
DocumentRenderer  documentRenderer,
PdfDocument  pdfDocument 
)
inlinestatic

Creates renderer from element excluding page breaks and adds tagging tree hints.

Parameters
element

iText.Layout.Element.IElement to create renderer for

Parameters
documentRenderer document renderer to use as parent for margin renderer
pdfDocument

iText.Kernel.Pdf.PdfDocument to which content is written

Returns
created iText.Layout.Renderer.IRenderer

◆ Draw() [1/2]

virtual void iText.Layout.Properties.Margins.PageMarginBoxes.Draw ( DocumentRenderer  documentRenderer,
PdfDocument  document,
int  pageNumber 
)
inlinevirtual

Draws all page margins for the page specified via page number.

Parameters
documentRenderer document renderer to use as parent for margin renderer
document

iText.Kernel.Pdf.PdfDocument to which content is written

Parameters
pageNumber page number

◆ Draw() [2/2]

static void iText.Layout.Properties.Margins.PageMarginBoxes.Draw ( IRenderer  marginRenderer,
Rectangle  marginRect,
DocumentRenderer  documentRenderer,
PdfDocument  document,
int  pageNumber,
String  marginBoxName 
)
inlinestatic

Draws all page margins for the page specified via page number.

Parameters
marginRenderer renderer for the margin content to draw
marginRect page margin box rectangle
documentRenderer document renderer to use as parent for margin renderer
document

iText.Kernel.Pdf.PdfDocument to which content is written

Parameters
pageNumber page number
marginBoxName string value representing margin box name (defining its position on the page)

◆ GetMarginSizes()

virtual float [] iText.Layout.Properties.Margins.PageMarginBoxes.GetMarginSizes ( )
inlinevirtual

Gets page margin sizes in top, right, bottom, left order.

Returns
array of float top, right, bottom, left margin sizes

◆ GetPageMarginContent()

virtual PageMarginContent iText.Layout.Properties.Margins.PageMarginBoxes.GetPageMarginContent ( MarginBoxName  marginBoxName )
inlinevirtual

Gets page margin content PageMarginContent by margin box name.

Parameters
marginBoxName

MarginBoxName margin box name to get content for

Returns
page margin content PageMarginContent by margin box name

◆ Layout()

virtual float [] iText.Layout.Properties.Margins.PageMarginBoxes.Layout ( DocumentRenderer  documentRenderer,
int  pageNumber,
Rectangle  pageSize 
)
inlinevirtual

Layouts all page margins to calculate their occupied area and page margin sizes.

Parameters
documentRenderer

iText.Layout.Renderer.DocumentRenderer renderer for the document to which content will be written

Parameters
pageNumber page number
pageSize page size
Returns
float array of top, right, bottom, left margin sizes

◆ SetMarginSizes()

virtual iText.Layout.Properties.Margins.PageMarginBoxes iText.Layout.Properties.Margins.PageMarginBoxes.SetMarginSizes ( float[]  marginSizes )
inlinevirtual

Sets page margin sizes in top, right, bottom, left order.

Parameters
marginSizes array of float top, right, bottom, left margin sizes
Returns
this same PageMarginBoxes instance

◆ SetPageMarginTagRole()

virtual void iText.Layout.Properties.Margins.PageMarginBoxes.SetPageMarginTagRole ( IElement  element )
inlinepackagevirtual

Sets the role of the page margin element to use in the document tag tree.

Parameters
element

iText.Layout.Element.IElement to set role for