SetStructElemBBox
Структурированный PDF, Доступность
Описание
Sets the /BBox attribute (Layout attribute owner) on the structure element currently open on the tag stack. The bounding box associates a rectangular region in user-space coordinates with the structure element, which is used by accessibility tools and re-flow engines. Equivalent to calling AddTagAttribute with Owner=Layout, Name=BBox, and a space-separated coordinate string.
Синтаксис
Delphi
Function TPDFlib.SetStructElemBBox(Left, Bottom, Right, Top: Double): Integer;
ActiveX
Function PDFlib::SetStructElemBBox(Left As Double, Bottom As Double, Right As Double, Top As Double) As Long
DLL
int DLSetStructElemBBox(int InstanceID, double Left, double Bottom, double Right, double Top);
Параметры
| Left | Левый край ограничивающего блока в единицах пользовательского пространства по умолчанию (пункты, 1/72 дюйма) |
|---|---|
| Bottom | Нижний край ограничивающего прямоугольника |
| Right | Правый край ограничивающего прямоугольника |
| Top | Верхний край ограничивающего блока |
Возвращаемое значение
Возвращает 1 в случае успеха, 0 — если документ не открыт или на стеке тегов нет открытого тега
Примечания
Call this function after BeginTag or BeginTagEx and before EndTag. The coordinates follow the PDF default coordinate system where the origin is at the bottom-left of the page.
The /BBox attribute is defined in ISO 32000-1 §14.8.5.4 (Layout attribute owner). It is particularly useful for Figure, Form, and Formula structure element types.
Пример
var
ImgX, ImgY, ImgW, ImgH: Double;
begin
// Draw an image and tag it as a Figure with its bounding box
ImgX := 72; ImgY := 600; ImgW := 150; ImgH := 100;
PDFlib.BeginTag('Figure', 'Product photo', '', '');
PDFlib.SetStructElemBBox(ImgX, ImgY, ImgX + ImgW, ImgY + ImgH);
PDFlib.DrawImageMatrix(ImgID, ImgX, ImgY, ImgW, ImgH, 0);
PDFlib.EndTag;
end;