lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] PATCH: simplify attachment page handling


From: Greg Chicares
Subject: Re: [lmi] PATCH: simplify attachment page handling
Date: Wed, 30 May 2018 22:38:54 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 2018-05-27 18:37, Vadim Zeitlin wrote:
> On Sat, 26 May 2018 23:54:00 +0000 Greg Chicares <address@hidden> wrote:
[...]
> GC> As mentioned above, page_count() is unit-tested by test_page_count(),
> GC> and I believe such unit testing is extremely valuable. Will the new
> GC> approach be similarly amenable to unit testing?
> 
>  Not really. The method itself is pretty trivial:

[... int get_extra_pages_needed() ...]

> and while you could think that the real logic is inside paginate_html(),
> it's quite simple as well as it uses wxHTML classes to do real pagination.
> These classes do have some unit tests (which I've added while streamlining
> them a little), but these tests are, of course, not lmi-specific.
> 
>  It's not obvious if we can/should insert some unit tests between wxHTML
> and lmi code here.

Okay. (I didn't realize that wxHTML now handles pagination.)

> GC> I just ran a 'sample2_naic' illustration, and on the last page (the page
> GC> with "Certification Statements"), the "AGENT OR AUTHORIZED REPRESENTATIVE"
> GC> text almost touches the bluish line that separates it from the footer. If
> GC> evolving business requirements require more to be printed on this virtual
> GC> page, it will need to become two physical pages. We can't rule that out
> GC> because business requirements can be capricious, even though the 
> motivating
> GC> idea was to produce one single sheet of paper that a customer would sign
> GC> with a pen.
> 
>  It would also presumably be needed to avoid page breaks in the middle of
> this section, wouldn't it?

Presumably, yes. It's a hypothetical case that I hope won't arise in
practice, because I believe the regulators' intention is to have the
"numeric summary" and the signatures all on one side of a single sheet
of paper. But if so many more words are added to the text that this
becomes impossible, then above all we wouldn't want the customer's
signature on a second page and everything else on the first. Thus:

> This is not implemented yet (but hopefully will
> be soon), but I plan to allow using CSS page-break-inside property in
> wxHTML for this, e.g. you'd be able to use
> 
>       <div style="page-break-inside: avoid">
>               <p>
>               AGENT / AUTHORIZED REPRESENTATIVE<br>
>               ...
>       </div>
> 
> to prevent any page breaks inside this section (unless its height is
> greater than the page size...).

Yes, exactly. CSS seems to have all the power we need.

> I hope this should be enough to achieve the
> wanted layout in all cases, but please let me know if you see any cases
> that would not be covered by this.

I see none.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]