On Monday, March 26, 2012 8:45:59 AM UTC-4, maverick wrote:
I need to have different margin per page... even numbered pages should
have margin-right 10cm and odd numbered pages should have margin-left
10cm and margin-right 0cm... how can i do that?
was looking at different methods available in the $pdf object
available in inline php but couldn't find any that would change
margin... and i have found a problem with the method $pdf-
>get_page_number() and variable $PAGE_NUM which always return 1 ... i
am using dompdf 6.0 beta 2 and according to the posts in this group,
$PAGE_NUM should return the correct page number in dompdf 6.0
You wouldn't be able to affect the margins using inline script. The HTML rendering engine works to a large degree independently of anything you do via scripting.
As for your other problems, can you post some sample code? I suspect you're using them in a way that won't produce what you want. Inline scripts are only executed once even if the result is duplicated across multiple pages. So if you call get_page_number() on the first page you will always get "1" as the result.
There are methods available via both HTML+CSS and inline script that will output the current page number on a page. We can provide more detail once we know what you're trying to achieve.