SetStructElemBBox
Tagged PDF, Accessibility
Descrição
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.
Sintaxe
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);
Parâmetros
| Left | Left edge of the bounding box in default user space units (points, 1/72 inch). |
|---|---|
| Bottom | Bottom edge of the bounding box. |
| Right | Right edge of the bounding box. |
| Top | Top edge of the bounding box. |
Valor de retorno
Retorna 1 em caso de sucesso. Retorna 0 se nenhum documento estiver aberto ou nenhuma tag estiver aberta na pilha de tags
Remarks
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.
Exemplo
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;