Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Watermark Positioning

$
0
0
Hi
I am currently using PDF generator version 9.7 (usnig the XML method), Visual Studio 2010, .NET 4.0.

I am having some trouble positioning a watermark in a PDF document. Basically, what I want to do is position some text (user-supplied, limited to 20 characters) diagonally from bottom left to top right of the page, centred both horizontally and vertically. I have attached a sample that I generated using Adobe for reference.
I can add the text, rotate it, and sort of position it, but I can't get it into exactly the right position without a lot of tweaking of margins and paddings, that would change for different page sizes, and different text lengths.
I was wondering if you could provide some guidance as to how to achieve my goal. I have attached a sample XML file, in which I have added borders around the watermark floating box, and the text within it for reference only - the borders would not be in the finished product.

A couple of additional points that would be helpful if you could address:
  • The "TextVerticalAlignment" attribute of the Watermark seems to have no discernible effect. No matter what you set it to, the text doesn't move.
  • There is no equivalent horizontal alignment for the text in the Watermark.
  • It would be helpful if the rotation point of the text could be set. It currently only rotates from the bottom left hand corner of the text. It would go a long way to fixing my problem if the text could be rotated around its centre.
  • Text wrapping around to the next line is also a problem in this situation. If the text in the stand horizontal position would have wrapped (for example, use "Draft Copy" instead of "Draft"), then it appears wrapped in the rotated version, even though it would have fit in that position. I have worked around this problem by setting the right padding of the watermark to a large negative value (-15cm), allowing extra room for the horizontal text to expand.
I have searched your site, and Googled this problem as well, but have been unable to find a suitable solution.
Could you please advise a way I could achieve this?

Thanks
Chris.


Viewing all articles
Browse latest Browse all 3131

Trending Articles