ssimms / pdfapi2

Create, modify, and examine PDF files in Perl
Other
15 stars 20 forks source link

Keep length of the last line of the justified paragraph #36

Closed cl0ne closed 2 years ago

cl0ne commented 3 years ago

The length of the last line of the justified paragraph is not used by current implementation of the paragraph method. But it's useful to those who use text_fill_* methods directly (for example, to implement custom paragraph method).

ssimms commented 2 years ago

I've applied this pull request, thanks.

The text_fill_* methods are currently undocumented (they were marked "experimental" in earlier releases). Can you tell me more about why you're implementing a custom paragraph method instead of using the built-in one, please?

cl0ne commented 2 years ago

Can you tell me more about why you're implementing a custom paragraph method instead of using the built-in one, please?

While most of the extra features for paragraph formatting can be implemented by wrapping the existing method and playing with the height/width parameters, the crucial missing feature of the existing method for me is the ability to skip the last newline and get the last line width. This is required when you use different formatting within the paragraph, for example.