PDFWriter and Page Breaks

I’m sure this is something that someone here has done. More probably,
I’m missing the obvious.

In order to produce a report, I need to know when the text I’m printing
(or about to print - I’m not picky) is going to do a page overflow so
that I can put the neadings on the new page. I’ve been going through the
API, and I don’t see how to check this.

Can anyone offer some insights into this?

Michael S. wrote:

I’m sure this is something that someone here has done. More probably,
I’m missing the obvious.

In order to produce a report, I need to know when the text I’m printing
(or about to print - I’m not picky) is going to do a page overflow so
that I can put the neadings on the new page. I’ve been going through the
API, and I don’t see how to check this.

Can anyone offer some insights into this?

It doesn’t. You have to do it by yourself. If it is out of page borders
it will be printed out of borders.

by
TheR

It doesn’t. You have to do it by yourself. If it is out of page borders
it will be printed out of borders.

That smart text insertion wraps both lines and pages is documented.
Unless the documentation is wrong, it won’t be out of borders when using
the text method. The question is how to measure the height of the next
item to print so that I can do a “manual” new page and insert headings.

Even if smart text insertion didn’t auto-wrap and “You have to do it by
yourself”, the question remains the same. “How do I measure the vertical
height of the text I’m about to add to the document?”

Why don’t you try Prawn?

http://prawn.majesticseacreature.com/

On Tue, Apr 28, 2009 at 3:27 AM, jonty [email protected] wrote:

Why don’t you try Prawn?

http://prawn.majesticseacreature.com/

A good idea generally, but keep in mind that the OP will need to do
manual calculations whether he uses PDF::Writer or Prawn. They just
might be slightly more pleasant to do in Prawn. We do have very rough
header support, but anything interesting needs to be done manually
(for now). Hopefully we’ll improve in that area soon.

-greg