pdf-lib icon indicating copy to clipboard operation
pdf-lib copied to clipboard

Is there a method to adjust length?

Open kamranmuazzam opened this issue 6 years ago • 1 comments

In svg there is a way to fit text into width <text textLength="75" lengthAdjust="spacing">This is a shrunked text</text>

I know of the maxWidth property but is there something like lengthAdjust.

Here is more info about the svg lenghtAdjust Property https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/lengthAdjust

kamranmuazzam avatar Dec 11 '19 05:12 kamranmuazzam

Hello @kamranmuazzam! I'm afraid there is currently no such API available in pdf-lib. However, all of the primitives that would be necessary to develop one exist (specifically, the ability to measure text dimensions in a given font and adjust the size when drawing text). If anybody would like to submit a PR implementing this feature, I'd be willing to merge it.

Hopding avatar Dec 16 '19 13:12 Hopding