pdf_text_rotate

Hi All,

Is it just me or does the pdf_text_rotate procedure not work?

I am trying to get a watermark to go across the page at an angle but when i add the rotate feature nothing changed no matter what the angle set.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

works here

With this code, I get it. Note that it only works with angles multiple of 45°
can you try the following code?
--------------------------------
{ pdf_inc.i "THIS-PROCEDURE"}

RUN pdf_new ("Spdf", rotatetext.pdf").
RUN pdf_new_page("Spdf").

/* Place some text */
RUN pdf_text ("Spdf", FILL("HORIZONTAL ",2)).

RUN pdf_text_rotate ("Spdf",90).
RUN pdf_text ("Spdf", FILL("VERTICAL ",2)).

RUN pdf_text_rotate ("Spdf",0).
RUN pdf_text ("Spdf", FILL("HORIZON ",2)).

RUN pdf_text_rotate ("Spdf",270).
RUN pdf_text ("Spdf", FILL("VERT ",2)).

RUN pdf_text_rotate ("Spdf",0).
RUN pdf_set_font ("Spdf",pdf_Font("Spdf"),12).
RUN pdf_text_color ("Spdf",1,0,0).
RUN pdf_text ("Spdf", "SNAKEHEAD----8~~ ").

/* Part 2 */
RUN pdf_text_rotate ("Spdf",0).
RUN pdf_skipn("Spdf",15).
RUN pdf_text_at ("Spdf", "HORIZONTAL HORIZONTAL ",1).

RUN pdf_text_rotate ("Spdf",45).
RUN pdf_text ("Spdf", " 045 DEGREES").

RUN pdf_text_rotate ("Spdf",315).
RUN pdf_text ("Spdf", " 315 DEGREES").

RUN pdf_text_rotate ("Spdf",135).
RUN pdf_text ("Spdf", " 135 DEGREES").

RUN pdf_text_rotate ("Spdf",225).
RUN pdf_text ("Spdf", " 225 DEGREES").

RUN pdf_text_rotate ("Spdf",0).
RUN pdf_text ("Spdf", " HORIZONTAL HORIZONTAL ").
/* End Part 2 */

RUN pdf_close("Spdf").
IF RETURN-VALUE > '' THEN
MESSAGE RETURN-VALUE
VIEW-AS ALERT-BOX ERROR BUTTONS OK.
--------------------------------
anyway the result is quite ugly for oblique angles (45, 135 & the like).


Missing construction

The 2 procedures pdf_text and pdf_watermark use completely different token constructions so what needs to be changed in pdf_watermark to include a rotation is a mystery.

The closest solution I have used is to change pdf_text_render = 1 to produce an outline character; then use pdf_text_rotate & pdf_text.

The sequence is important to get the color:
pdf_text_color()
pdf_text_render()
pdf_text_rotate()
pdf_set_font()
pdf_text()