Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# DocumentImage.pad Method

Module: DocumentImage

## Definition

Add padding around the image

Only works for BGR 24 bits, RGB 24 bits and Grayscale 8bits images.

For grayscale image, the padding color is the red component.

Python

    pad(self, top: int, left: int, bottom: int, right: int, color_red: int, color_green: int, color_blue: int) -> None

Parameters

> `top` int
> in Padding on top.
> `left` int
> in Padding on left.
> `bottom` int
> in Padding on bottom.
> `right` int
> in Padding on right.
> `color_red` int
> in Padding color red (from 0 to 255)
> `color_green` int
> in Padding color green (from 0 to 255)
> `color_blue` int
> in Padding color blue (from 0 to 255)

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Dart

    void pad(int top, int left, int bottom, int right, int colorRed, int colorGreen, int colorBlue)

Parameters

> `top` int
> in Padding on top.
> `left` int
> in Padding on left.
> `bottom` int
> in Padding on bottom.
> `right` int
> in Padding on right.
> `colorRed` int
> in Padding color red (from 0 to 255)
> `colorGreen` int
> in Padding color green (from 0 to 255)
> `colorBlue` int
> in Padding color blue (from 0 to 255)

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C#

    public void Pad(int top, int left, int bottom, int right, int colorRed, int colorGreen, int colorBlue)

Parameters

> `top` int
> in Padding on top.
> `left` int
> in Padding on left.
> `bottom` int
> in Padding on bottom.
> `right` int
> in Padding on right.
> `colorRed` int
> in Padding color red (from 0 to 255)
> `colorGreen` int
> in Padding color green (from 0 to 255)
> `colorBlue` int
> in Padding color blue (from 0 to 255)

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Java

    public void pad(int top, int left, int bottom, int right, int colorRed, int colorGreen, int colorBlue) throws DocumentException

Parameters

> `top` int
> in Padding on top.
> `left` int
> in Padding on left.
> `bottom` int
> in Padding on bottom.
> `right` int
> in Padding on right.
> `colorRed` int
> in Padding color red (from 0 to 255)
> `colorGreen` int
> in Padding color green (from 0 to 255)
> `colorBlue` int
> in Padding color blue (from 0 to 255)

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Swift

    public func pad(top: Int32, left: Int32, bottom: Int32, right: Int32, colorRed: Int32, colorGreen: Int32, colorBlue: Int32) throws

Parameters

> `top` Int32
> in Padding on top.
> `left` Int32
> in Padding on left.
> `bottom` Int32
> in Padding on bottom.
> `right` Int32
> in Padding on right.
> `colorRed` Int32
> in Padding color red (from 0 to 255)
> `colorGreen` Int32
> in Padding color green (from 0 to 255)
> `colorBlue` Int32
> in Padding color blue (from 0 to 255)

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C

    int id3DocumentImage_Pad (
        ID3_DOCUMENT_IMAGE hDocumentImage,
        int top,
        int left,
        int bottom,
        int right,
        int colorRed,
        int colorGreen,
        int colorBlue)

Parameters

> `hDocumentImage` ID3_DOCUMENT_IMAGE
> in Handle to the DocumentImage object.
> `top` int
> in Padding on top.
> `left` int
> in Padding on left.
> `bottom` int
> in Padding on bottom.
> `right` int
> in Padding on right.
> `colorRed` int
> in Padding color red (from 0 to 255)
> `colorGreen` int
> in Padding color green (from 0 to 255)
> `colorBlue` int
> in Padding color blue (from 0 to 255)

Returns

> `int`
> An error code.
> See id3DocumentError file for the list of possible error codes.