Purepdf Centre text

Just starting out? Need help? Post your questions and find answers here.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Purepdf Centre text

Post by collectordave »

Probably a silly question.

just need to centre text in PDF is there a simple way or is it gettextwidth etc.

Regards

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Purepdf Centre text

Post by IdeasVacuum »

Hi collectordave

Use pdf_Cell(), which is basically like a StringGadget() on Steroids. If the text is to be centred to the page width, just define the cell to be page width by specifying width 0 (= extends from left margin to right margin)

Code: Select all

pdf_SetX(20.0)
pdf_Cell(0, 5, "My Text Centred", 0,-2, #PDF_ALIGN_CENTER, 0)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: Purepdf Centre text

Post by collectordave »

Brilliant

Text centering done thanks very much.

Is there a help file or manual that shows what each parameter on these functions are for?

Regards

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Purepdf Centre text

Post by IdeasVacuum »

There is a Help Document:
PurePDF.chm
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: Purepdf Centre text

Post by collectordave »

Found the help file but it just lists the commands with no explanation.

Regards
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Post Reply