On Sun, Jul 05, 2009 at 10:06:02PM +0200, Hartmut Henkel wrote:
Hi Khaled,
On Thu, 2 Jul 2009, Khaled Hosny wrote:
PDF annotations are not placed correctly in TRT directions (and I guess other directions as well), I tried to track this issue and apparently directions are not taken into account when doing do_annot() in pdflistout.c.
checked your test file. i guess it's looking wrong since you did not set width, height, or depth of the \pdfannot. Then by default it takes as annotation rectangle dimensions and position the width from the current point to the end of the surrounding box (as pdftex does). And in TRT mode the end of the box is left from the current point, as the surrounding \hbox goes across the full \hsize. The viewer then places the annotation text flush left into this rectangle, so it ends up rather left on the paper. I guess one does not have good control over this other than stating width, height, and depth as arguments to \pdfannot. Seems to be also rather implementation dependent.
Just set width to some value (e. g. 20mm, see also samplepdf.tex from pdftex) and you will hopefully see that the annotation will be about where you want it. And have a look at the /Rect [] array in the PDF file.
OK, got that and I think it is fine that way. However, if I don't set page and body dir, annotations in vertical mode will be positioned at the left side of the page: \pardir TRT\textdir TRT \pdfannot {/Subtype/Text/Contents(My comment)} \leavevmode\pdfannot {/Subtype/Text/Contents(My comment)} \bye Is that related to hbox in vmode issue? (I think that was the source of my problem, but I didn't realize that then). Regards, Khaled -- Khaled Hosny Arabic localiser and member of Arabeyes.org team Free font developer