Probably a silly question.
just need to centre text in PDF is there a simple way or is it gettextwidth etc.
Regards
CD
Purepdf Centre text
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Purepdf Centre text
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.
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Purepdf Centre text
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)
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.
If it sounds simple, you have not grasped the complexity.
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Purepdf Centre text
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
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.
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Purepdf Centre text
There is a Help Document:
PurePDF.chm
PurePDF.chm
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Purepdf Centre text
Found the help file but it just lists the commands with no explanation.
Regards
CD
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.