PDF annotation coordinate system

I want to generate a freetext annotation at the top right of a page from javascript I have to put in bound { x: 528, y: 12, width: 72, height: 22 } and it produces rect {"x":"528","y":"758","width":"600","height":"780"} in JSON annotation

How to calculate the input bound given the JSON rect from Webviewer?


1 Reply

JT Jeyalakshmi Thangamarippandian Syncfusion Team March 30, 2026 09:46 AM UTC

Hi Jackson Tong,

 

Rect (the annotation dictionary entry) and PdfAnnotation.bounds represent the same annotation rectangle but in different coordinate contexts. Rect is the raw PDF rectangle stored in the annotation dictionary (PDF page coordinate space); PdfAnnotation.bounds is the rectangle the API returns after converting that raw rectangle into the document/UI coordinate space (taking page size, rotation, and origin conventions into account).

 

Rect: The raw rectangle from the annotation dictionary (PDF tuple [llx, lly, urx, ury]) in PDF page coordinates (origin at bottom‑left). It’s the stored PDF value and is not adjusted for UI/page orientation.
PdfAnnotation.bounds: The API-computed rectangle after transforming Rect into the document/UI coordinate system. The library applies the page height, rotation, and origin conversion, so the numbers can differ from the raw Rect.

 

Recommendation:
- When creating annotations via the API, supply coordinates in the coordinate system the API expects (use bounds semantics described in your API docs).
- When reading/exporting the raw PDF dictionary or low‑level data, read Rect and convert it using the page height and rotation if you need UI coordinates.
- If you need a reliable UI position, import the annotation into the document and read PdfAnnotation.bounds (the API will perform the necessary transforms for you).

 

Please let us know if you need any further assistance in this.

 

Please find more details from https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/annotations documentation.

 

With regards,

Jeyalakshmi T


Loader.
Up arrow icon