galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.15k stars 170 forks source link

How to align center text at modifying a PDF #148

Open rubenjimenez opened 7 years ago

rubenjimenez commented 7 years ago

Hi,

I'm trying to modify an existing PDF. I got it and it works, but the text I'm writing on I want it to be center aligned.

I've been reading the documentation but I've not found anything about it.

Is there any way to accomplish it?

Thanks in advance!

galkahana commented 7 years ago

you can measure the text and then place it in relation to whatever it is that you want to center against. measuring text - https://github.com/galkahana/HummusJS/wiki/Show-text#measuring-text

rubenjimenez commented 7 years ago

Correct, thanks.

Anyway, wouldn't it be good to have a easier method to set up the alignment? I guess it is pretty common.

galkahana commented 7 years ago

:) sure. Im not against contributions