ApiPictureForm

class ApiPictureForm extends ApiFormBase

Description

Class representing a document picture form.

Instance Methods

GetScaleFlag(): ScaleFlag

Returns the current scaling condition of the picture form.

SetScaleFlag(sScaleFlag): boolean

Sets the scaling condition to the current picture form.

SetLockAspectRatio(isLock): boolean

Locks the aspect ratio of the current picture form.

IsLockAspectRatio(): boolean

Checks if the aspect ratio of the current picture form is locked or not.

SetPicturePosition(nShiftX, nShiftY): boolean

Sets the picture position inside the current form: 0 - the picture is placed on the left/top; 50 - the picture is placed in the center; 100 - the picture is placed on the right/bottom.

GetPicturePosition(): percentage[]

Returns the picture position inside the current form.

SetRespectBorders(isRespect): boolean

Respects the form border width when scaling the image.

IsRespectBorders(): boolean

Checks if the form border width is respected or not.

GetImage(): base64img

Returns an image in the base64 format from the current picture form.

SetImage(sImageSrc, nWidth, nHeight): boolean

Sets an image to the current picture form.

GetClassType()

Returns a type of the ApiFormBase class.

GetFormType()

Returns a type of the current form.

GetFormKey()

Returns the current form key.

SetFormKey(sKey)

Sets a key to the current form.

GetTipText()

Returns the tip text of the current form.

SetTipText(sText)

Sets the tip text to the current form.

IsRequired()

Checks if the current form is required.

SetRequired(bRequired)

Specifies if the current form should be required.

IsFixed()

Checks if the current form is fixed size.

ToFixed(nWidth, nHeight)

Converts the current form to a fixed size form.

ToInline()

C.

SetBorderColor(r, g, b, bNone)

Sets the border color to the current form.

SetBackgroundColor(r, g, b, bNone)

Sets the background color to the current form.

GetText()

R.

Clear()

Clears the current form.

GetWrapperShape()

R.

SetPlaceholderText(sText)

S.

SetTextPr(oTextPr)

S.

GetTextPr()

R.

MoveCursorOutside(isAfter)

Places a cursor before/after the current form.

Copy()

Copies the current form (copies with the shape if it exists).

Extends

ApiFormBase

Class representing a document form base.

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).