Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Force a PDF page break
Force a PDF page break [message #1682] Mon, 22 September 2008 06:00 Go to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Tony,

In the documentation you provide an example, using _cm_ListView_pre_print() to produce line breaks. Is it possible to do something similar to produce a page break?
Re: Force a PDF page break [message #1685 is a reply to message #1682] Mon, 22 September 2008 08:51 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
I'm afraid not.

Re: Force a PDF page break [message #1687 is a reply to message #1685] Mon, 22 September 2008 09:23 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
You could try calling $this->Header() within your code at the appropriate place.

Re: Force a PDF page break [message #1688 is a reply to message #1682] Mon, 22 September 2008 09:27 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
I'll give it a try and let you know how I get on.
Re: Force a PDF page break [message #1689 is a reply to message #1688] Mon, 22 September 2008 10:02 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
I've just tried forcing a page break in my test system and discovered the following:

(1) The code you actually need in your table object is:
$this->pdf->AddPage();


(2) In order to populate $this->pdf you will need to update the outputPDF_ListView() method in std.table.class.inc as follows:
$pdf = new PDF_list($structure); <== existing line
$this->pdf =& $pdf;              <== add this line

I will put this change in the next release.


Re: Force a PDF page break [message #1690 is a reply to message #1682] Mon, 22 September 2008 10:48 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Thanks Tony,

That works exactly as I needed.
Re: Force a PDF page break [message #1691 is a reply to message #1682] Mon, 22 September 2008 11:58 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Actually Tony - I realise I have fallen foul of a small problem:

I only want to force page breaks in one particular report. Now that I have put code in the table class to form page breaks on change of a value, all my reports based on that table class now perform the page breaks.

How can I access the name of the output task from within _cm_ListView_pre_print to be able to handle this?
Re: Force a PDF page break [message #1692 is a reply to message #1691] Mon, 22 September 2008 12:03 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
The various options are described in FAQ49: How do you deal with task-specific behaviour?

Re: Force a PDF page break [message #1693 is a reply to message #1682] Mon, 22 September 2008 12:05 Go to previous message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Sorry yes - realised I knew the answer as soon as I posted!
Previous Topic: Delete files in filepicker screen?
Next Topic: Problem with _cm_filterwhere, how can do this?
Goto Forum:
  


Current Time: Tue Apr 23 15:18:32 EDT 2024

Total time taken to generate the page: 0.01192 seconds