# PDF::Writer centered text in the middle of the page

**URL:** <https://www.ruby-forum.com/t/pdf-writer-centered-text-in-the-middle-of-the-page/144706>\
**Category:** Ruby\
**Created:** [August 1, 2008, 12:02pm UTC](https://www.ruby-forum.com/t/pdf-writer-centered-text-in-the-middle-of-the-page/144706 "2008-08-01T12:02:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gunbol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/13edae/32.png) [@gunbol](https://www.ruby-forum.com/u/gunbol)\
**Post date:** [August 1, 2008, 12:02pm UTC](https://www.ruby-forum.com/t/pdf-writer-centered-text-in-the-middle-of-the-page/144706/1 "2008-08-01T12:02:38Z")

</div>

Hello,

I am trying to generate a PDF File with a centered text in the middle of  
the page.

I have tryed to use the add\_text and add\_text\_wrapped methods, but the  
text either not fitting in the page, or the text is truncated.

Maybe I am not using correctly the API correctly ?

Thank you for your help

Gunther THEVENIN
