I am using Phaxio for send FAX and it's working fine till now. Now i have to add some extra stuff to it. I want to generate some of the data in new pages into same PDF(generate PDF on success of send fax by phaxio).
Currently its being generate new pages only when while it's come up at bottom of the page.
i tried following code by paging paging parameters as given on Phaxio official site http://www.phaxio.com/docs/paging/ but it's not working at all or might be i don't know how to use it.
Please take a look at following code.
require ("Phaxio.php");
$apiKeys['test']='xxxxxxxxxxxxxxxxxxxxxxxxxxx';
$apiSecrets['test']='xxxxxxxxxxxxxxxxxxxxxxxxxxx';
$apiHost='https://api.phaxio.com/v1/';
$filename='html_data.html';
$toNumber="my-10-digit-phone-no";
$phaxio=new Phaxio($apiKeys['test'], $apiSecrets['test'], $apiHost);
$phresult=$phaxio->sendFax($toNumber, $filename,
array('maxperpage' => '400','page' => '1'));
echo "<pre>";
print_r($phresult);
if ( !$phresult->succeeded() ) {
echo ("<H4>Error sending fax to $toNumber with " . $phresult->getMessage()."</H4>");
return FALSE;
}
else {
echo ("<H4>Your fax has been sent.</<H4>");
return TRUE;
}
After spending couple of hours i finally got a very silly but useful solution.
Actually my requirement was that in my FAX PDF there was number of repeated HTML was there like generate invoice in same format(using loop), and i really need like every invoice HTML should be in separate PDF page.
So I've simply used CSS style="page-break-before:always;" and i was done with my issue.
1) via CSS - for the advanced HTML users:
<p style="page-break-after:always;"></p>
2) with a simple comment:
<p><!-- pagebreak --></p>