Skip to main content

CreateBlipFill

Creates a blip fill to apply to the object using the selected image as the object background.

Syntax​

expression.CreateBlipFill(imageUrl, blipFillType);

expression - A variable that represents a Api class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
imageUrlRequiredstringThe path to the image used for the blip fill (currently only internet URL or Base64 encoded images are supported).
blipFillTypeRequiredBlipFillTypeThe type of the fill used for the blip fill (tile or stretch).

Returns​

ApiFill

Example​

Fill a shape with an image in a PDF.

// How do I use an image as a fill in a PDF?

// Apply a repeating image pattern to a shape in a PDF.

const doc = Api.GetDocument();
const page = doc.GetPage(0);

const fill = Api.CreateBlipFill("https://static.onlyoffice.com/assets/docs/samples/img/presentation_sky.png", "tile");
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const drawing = Api.CreateShape("star10", 150 * 36000, 65 * 36000, fill, stroke);
drawing.SetPosition(608400, 1267200);
page.AddObject(drawing);