SetStructElemBBox

Tagged PDF, Accessibility

Beschrijving

Zet het attribuut /BBox (Layout-attribuuteigenaar) op het structuurelement dat momenteel open staat op de tagstack. De bounding box koppelt een rechthoekig gebied in user-space-coördinaten aan het structuurelement, wat wordt gebruikt door accessibilitytools en re-flow-engines. Gelijk aan het aanroepen van AddTagAttribute met Owner=Layout, Name=BBox en een door spaties gescheiden coördinaatstring

Syntaxis

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);

Parameters

LeftDe linkerrand van de bounding box in standaard user space-eenheden (punten, 1/72 inch)
BottomDe onderrand van de bounding box
RightDe rechterrand van de bounding box
TopDe bovenrand van de bounding box

Retourwaarde

Retourneert 1 bij succes. Retourneert 0 als er geen document is geopend of momenteel geen tag op de tagstack geopend is

Remarks

Roep deze functie aan na BeginTag of BeginTagEx en vóór EndTag. De coördinaten volgen het PDF-standaardcoördinatensysteem, waarin de oorsprong linksonder op de pagina ligt

Het attribuut /BBox is gedefinieerd in ISO 32000-1 §14.8.5.4 (Layout-attribuuteigenaar). Het is bijzonder nuttig voor de structuurelementtypen Figure, Form en Formula

Voorbeeld

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;

Zie ook

AddTagAttribute, SetStructElemScope, BeginTag, EndTag