PdfFileStamp.AddPageNumber

AddPageNumber(string)

Add page number to file. Page number text may contain # sign which will be replaced with number of the page. Page number is placed in the bottom of the page centered horizontally.

public void AddPageNumber(string formatString)
ParameterTypeDescription
formatStringStringText of page number

Examples

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber("Page #");
fileStamp.Close();

See Also


AddPageNumber(FormattedText)

Adds page number to the page. Page number may contain # sign which will be replaced with page number. Page number is placed in the bottom of the page centered horizontally.

public void AddPageNumber(FormattedText formattedText)
ParameterTypeDescription
formattedTextFormattedTextFormat string for page number representes as FormattedText.

Examples

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber(new FormattedText("Page #"));
fileStamp.Close();

See Also


AddPageNumber(string, int, float, float, float, float)

Adds page number to the pages of document.

public void AddPageNumber(string formatString, int position, float leftMargin, float rightMargin, 
    float topMargin, float bottomMargin)
ParameterTypeDescription
formatStringStringFormat string for page number.
positionInt32Position where page number will be placed on the page. 0-bottom middle, 1-bottom right, 2-upper right, 3 - sides right, 4 - upper middle,5 - bottom left,6 - sides left,7 - upper left. You can use the following constants: PosBottomMiddle = 0, PosBottomRight = 1, PosUpperRight = 2, PosSidesRight = 3, PosUpperMiddle, PosBottomLeft = 5, PosSidesLeft, PosUpperLeft
leftMarginSingleMargin on the left edge of the page.
rightMarginSingleMargin on the right edge of the page.
topMarginSingleMargin on the top edge of the page.
bottomMarginSingleMargin on the bottom edge of the page.

Examples

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber("Page #", PdfFileStamp.PosBottomLeft, 100, 100, 200, 200);
fileStamp.Close();

See Also


AddPageNumber(string, float, float)

Adds page number at the specified position on the page.

public void AddPageNumber(string formatString, float x, float y)
ParameterTypeDescription
formatStringStringFormat string. Format string can contain # sign which will be replaced with page number.
xSingleX coordinate of page number.
ySingleY coordinate of page number.

Examples

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber(new FormattedText("Page  #"), 123, 357);
fileStamp.Close();

See Also


AddPageNumber(FormattedText, int, float, float, float, float)

Adds page number to the pages of document.

public void AddPageNumber(FormattedText formattedText, int position, float leftMargin, 
    float rightMargin, float topMargin, float bottomMargin)
ParameterTypeDescription
formattedTextFormattedTextFormattedText object which represents page number format and properties iof the text.
positionInt32Position where page number will be placed on the page. 0-bottom middle, 1-bottom right, 2-upper right, 3 - sides right, 4 - upper middle,5 - bottom left,6 - sides left,7 - upper left. You can use the following constants: PosBottomMiddle = 0, PosBottomRight = 1, PosUpperRight = 2, PosSidesRight = 3, PosUpperMiddle, PosBottomLeft = 5, PosSidesLeft, PosUpperLeft
leftMarginSingleMargin on the left edge of the page.
rightMarginSingleMargin on the right edge of the page.
topMarginSingleMargin on the top edge of the page.
bottomMarginSingleMargin on the bottom edge of the page.

Examples

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber(new FormattedText("Page #"), PdfFileStamp.PosBottomLeft, 100, 100, 200, 200);
fileStamp.Close();

See Also


AddPageNumber(FormattedText, float, float)

Adds page number at the specified position on the page.

public void AddPageNumber(FormattedText formattedText, float x, float y)
ParameterTypeDescription
formattedTextFormattedTextFormatted text which represents page number format and properties of the text. Format string can contain # sign which will be replaced with page number.
xSingleX coordinate of page number.
ySingleY coordinate of page number.

Examples

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber(new FormattedText("Page  #"), 123, 357);
fileStamp.Close();

See Also


AddPageNumber(string, int)

Adds page number to the pages.

public void AddPageNumber(string formatString, int position)
ParameterTypeDescription
formatStringStringFormat of the page number. This text may contain # which will be replaced with page number.
positionInt32Position where page number will be placed on the page. 0-bottom middle, 1-bottom right, 2-upper right, 3 - sides right, 4 - upper middle,5 - bottom left,6 - sides left,7 - upper left. You can use the following constants: PosBottomMiddle = 0, PosBottomRight = 1, PosUpperRight = 2, PosSidesRight = 3, PosUpperMiddle, PosBottomLeft = 5, PosSidesLeft, PosUpperLeft

Examples

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber("Page #", PdfFileStamp.PosUpperRight);
fileStamp.Close();

See Also


AddPageNumber(FormattedText, int)

Adds page number to the pages.

public void AddPageNumber(FormattedText formattedText, int position)
ParameterTypeDescription
formattedTextFormattedTextFormattedText object which contains format of the page number and text properties. This text may contain # which will be replaced with page number.
positionInt32Position where page number will be placed on the page. 0-bottom middle, 1-bottom right, 2-upper right, 3 - sides right, 4 - upper middle,5 - bottom left,6 - sides left,7 - upper left. You can use the following constants: PosBottomMiddle = 0, PosBottomRight = 1, PosUpperRight = 2, PosSidesRight = 3, PosUpperMiddle, PosBottomLeft = 5, PosSidesLeft, PosUpperLeft

Examples

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber("Page #", PdfFileStamp.PosUpperRight);
fileStamp.Close();

See Also