General Question

200 views
Skip to first unread message

Ollie

unread,
Apr 19, 2013, 10:02:58 AM4/19/13
to dom...@googlegroups.com
Dear all,
before I have used  fpdf and fpdi for gererating pdfs on the fly. But it doesn't support siple formatting, like I get from tiny mce.

So I am tryng to switch to dompdf.
Like documentated I am using it like:
[code]
<?php require_once("dompdf_config.inc.php");

$html =<head></head><body>my text ....</body></html>';
$dompdf = new DOMPDF();
// add the header
$canvas = $dompdf->get_canvas();
$font = Font_Metrics::get_font("helvetica", "bold");

// the same call as in my previous example

$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
[/code]

Where and how do I have to add scripts like <script type="text/php">?
Normally the $html-var is a long string.
But setting it before "$html=" I got an error.

As well when I tried something like:

'<h2>Section 1'.$PAGE_NUM.'</h2>'

php is enabled in dompdf_config.inc.php.
def("DOMPDF_ENABLE_PHP", true);

What are my goals?
1. Generate a pdf from a form of tiny mce (lightweight formatting editor) The above google one would be enough.
2. I would like to add a different header starting at the 2nd page.

I tried something like

if($PAGE_NUM>1) $html=$html.'xyz';
else
echo $html=$html.'abc';

Thirdly would it be nice to add an existing pdf at the end automatically, This is not that important as this could be added via database.

Please help. :)
regards
Oliver

BrianS

unread,
Apr 19, 2013, 11:47:50 AM4/19/13
to dom...@googlegroups.com
See response below.
-b


On Friday, April 19, 2013 10:02:58 AM UTC-4, Ollie wrote:
Like documentated I am using it like:
[code]
<?php require_once("dompdf_config.inc.php");

$html =<head></head><body>my text ....</body></html>';
$dompdf = new DOMPDF();
// add the header
$canvas = $dompdf->get_canvas();
$font = Font_Metrics::get_font("helvetica", "bold");

// the same call as in my previous example

$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
[/code]

You don't need the $canvas or $font variables. $canvas is only useful if you plan to work with the rendering library directly. And $font is only necessary if you're using inline script (PHP script that's parsed as part of the HTML). So the following would suffice:

<?php
require_once("dompdf_config.inc.php");

$html = "<html><head></head><body>my text ....</body></html>';
$dompdf = new DOMPDF();

$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
?>

 
Where and how do I have to add scripts like <script type="text/php">?
Normally the $html-var is a long string.
But setting it before "$html=" I got an error.

If you want to run inline scripts your script text must be inside the HTML document contained in the BODY element. So something like the following:

<?php
require_once("dompdf_config.inc.php");

$html = "<html><head></head><body><script type="text/php">...</script> my text ....</body></html>';
$dompdf = new DOMPDF();

$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
?>

 
As well when I tried something like:

'<h2>Section 1'.$PAGE_NUM.'</h2>'
php is enabled in dompdf_config.inc.php.
def("DOMPDF_ENABLE_PHP", true);

That's not really how you use inline script. But if what you want is the page number you can do it via CSS:

<style>.pagenum:before { content: counter(page); }</style> ... <h2>Section 1.<span class=".pagenum"></span></h2>

 
What are my goals?
1. Generate a pdf from a form of tiny mce (lightweight formatting editor) The above google one would be enough.

So work on this first. Make sure you understand how to convert HTML to PDF. Also spend some time learning about inline PHP and make sure you understand how it works. You can find some example inline script in the FAQ on the old wiki:
http://code.google.com/p/dompdf/wiki/FAQ

And you're gonna need to know inline script it if you want to do your next goal:

 
2. I would like to add a different header starting at the 2nd page.

I tried something like

if($PAGE_NUM>1) $html=$html.'xyz';
else
echo $html=$html.'abc';

Not easy to do right now. See the following issue:
https://github.com/dompdf/dompdf/issues/608

 
Thirdly would it be nice to add an existing pdf at the end automatically, This is not that important as this could be added via database.

You can't really do this with an unmodified copy of dompdf. It's sole purpose is to convert from HTML to PDF. You could use it in tandem with another library, creating your PDF in dompdf and combining it with another PDF using the other library.

Ollie

unread,
Apr 25, 2013, 11:04:40 AM4/25/13
to dom...@googlegroups.com
Good morning folks,
now back to the beginning. ;)
I just copied an example from dompdf:

<?php
require_once("dompdf_config.inc.php");
$html="<html>
<head>
<style>
.first-page-header { position: absolute; left: 0px; right: 0px; top: 0px; background-color: black; color: white; text-align: center; }
.first-page-footer { position: absolute; left: 0px; right: 0px; bottom: 0px; background-color: black; color: white; text-align: center; }

.header { position: fixed; top: 0px; left: 0px; right: 0px; }
.header .content {  background-color: black; color: white; text-align: center; }
.footer { position: absolute; bottom: 0px; left: 0px; right: 0px; }
.footer .content { background-color: black; color: white; text-align: center; }


.pagenum:before {   content: counter(page); }
</style>
</head>
<body>

<div class='first-page-header'>
  <div class='content'>My Great Treatise</div>
</div>
<div class='first-page-footer'>
  <div class='content'>something something</div>
</div>";?>

<script type='text/php'>
$GLOBALS['header'][] = array();
$GLOBALS['footer'] = NULL;
</script>
<?php $html=$html."
<div class='header'>";?>
  <script type='text/php'>$GLOBALS['header'][] = $pdf->open_object();</script>
  <div class='content'>Page <span class='pagenum'></span></div>
  <script type='text/php'>$pdf->close_object();</script>
</div>
<div class='footer'>
  <script type='text/php'>$GLOBALS['footer'] = $pdf->open_object();</script>
  <div class='content'>Copyright &copy;. All rights reserved.</div>
  <script type='text/php'>$pdf->close_object();</script><?php
$html=$html."/div>

<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vulputate suscipit nibh, non lacinia tortor ullamcorper et. Integer tortor sem, rhoncus fringilla porta vitae, laoreet a purus. Etiam vitae urna vel nulla blandit laoreet id vel magna. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras euismod est ut mi rhoncus at porta risus aliquet. Sed in dolor risus. Aenean at libero hendrerit lectus elementum pellentesque. Vivamus malesuada, metus ac mollis tincidunt, massa libero tristique lacus, egestas elementum nibh sem id urna.
</p>
<p>
Nunc neque mi, vehicula nec tempus eu, malesuada eu dui. Donec sed diam enim. Duis fringilla, tellus non venenatis imperdiet, metus velit convallis nisl, sit amet sollicitudin justo erat ac arcu. Ut quis adipiscing ante. Phasellus purus ante, scelerisque et bibendum nec, commodo nec mi. Fusce aliquet, dolor sit amet semper vehicula, mauris dolor pellentesque tellus, a vulputate nisi libero vitae nisl. Integer suscipit, lacus at posuere consectetur, nibh felis malesuada felis, a bibendum diam velit sed libero. Proin tempus tincidunt augue sed lobortis. Vestibulum commodo lectus vitae diam iaculis ultricies. Ut lacus felis, bibendum vitae rutrum quis, convallis in quam. Aliquam nec leo metus, ut gravida quam. Nullam sed lorem erat, quis placerat lacus. Nunc tortor nisl, vehicula in aliquam ac, sollicitudin ut sapien. Pellentesque vitae neque purus.
</p>
<p>
Integer ullamcorper iaculis diam eget facilisis. Donec at neque ante, quis tempor lorem. Mauris lobortis nulla felis, eget vestibulum elit. Nullam aliquet bibendum convallis. Etiam nec mi orci. Praesent libero nibh, laoreet non dapibus ac, ullamcorper vitae erat. Morbi semper elit ac nibh commodo posuere. Duis in risus mauris. Suspendisse aliquam, nisi non mattis consectetur, urna augue aliquam leo, ut aliquet lectus urna sed libero. Quisque eu lectus ac lacus mollis porttitor. Morbi a velit metus, eu feugiat risus. Sed vulputate diam ornare magna pulvinar dignissim laoreet nulla hendrerit. Mauris quis massa quis velit vulputate bibendum ut eget ligula. Mauris sit amet dui eu turpis blandit fermentum. Donec dapibus diam vel mi tincidunt fermentum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
</p>
<p>
Praesent purus arcu, condimentum ac accumsan quis, pulvinar quis orci. Ut massa arcu, eleifend vitae tincidunt id, egestas sed erat. Donec pretium porta tellus, eu tincidunt arcu sodales vitae. Cras convallis scelerisque mi, et bibendum libero feugiat eu. Nulla facilisi. Praesent in turpis eget purus tempor mattis at in ligula. Nunc nec erat a urna iaculis laoreet. Donec eu leo mauris. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
</p>
<p>
Nullam magna lorem, volutpat vel auctor in, bibendum a nisl. Vivamus pretium mollis tempus. Nulla ligula augue, porttitor quis luctus ut, varius sit amet ante. Pellentesque id est dui, in dignissim justo. Sed placerat ornare laoreet. In ligula dui, interdum sed pellentesque sit amet, accumsan nec enim. Duis convallis diam massa, sed condimentum sem. In faucibus, ipsum vel mollis auctor, lacus lacus aliquet leo, et bibendum ante dolor vel augue. Cras varius, metus sed tempus varius, arcu sem venenatis diam, ut elementum ligula tortor eu dolor.
</p>
<p>
Aliquam facilisis molestie congue. Suspendisse vel ante sapien. Nulla posuere ultricies tincidunt. Pellentesque mauris magna, ullamcorper vel gravida vel, mattis sed mi. Phasellus condimentum lobortis elit, quis commodo augue porta volutpat. Sed rhoncus augue ut magna consequat non aliquam ligula rutrum. Nam eu nunc nisl, id ultricies justo. Vestibulum eget sem mauris, quis gravida urna. Morbi porta neque et elit suscipit at auctor massa lobortis. Duis nisl urna, rhoncus at scelerisque nec, laoreet posuere risus. Nam faucibus mattis massa, ut condimentum diam dignissim dignissim. Aliquam erat volutpat. Nullam lorem odio, fermentum sed varius quis, sollicitudin eget risus. Fusce in ante lectus, non rhoncus ipsum.
</p>
<p>
Nullam convallis convallis lobortis. Sed sit amet est a purus bibendum porta in a tortor. Phasellus sed consequat ipsum. Nulla facilisi. Sed nisi odio, auctor eget aliquam non, mattis non velit. Mauris eget nibh turpis. In vel fringilla urna. Quisque vitae magna vel nulla tristique vulputate et quis mauris. Ut pellentesque accumsan est vel tincidunt. Praesent vehicula enim eget magna euismod rutrum. Duis euismod vehicula turpis et venenatis. Vestibulum auctor magna vel nibh vestibulum id scelerisque tellus vulputate. Integer volutpat, enim et vehicula blandit, mauris nisl laoreet nisl, vel accumsan arcu arcu eu orci. Phasellus viverra risus in nulla imperdiet suscipit.
</p>
<p>
Praesent varius rhoncus quam at congue. Vestibulum fermentum lorem non mauris gravida fermentum. Duis tempus metus tellus. Vivamus blandit elementum sem. Duis mollis, urna eget fringilla dignissim, arcu ligula auctor orci, ut vestibulum eros magna at metus. Suspendisse turpis erat, dictum non accumsan a, vestibulum eu libero. Sed mauris leo, vulputate sit amet pharetra a, vulputate in odio.
</p>
<p>
In et lorem non nunc malesuada auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec semper magna in est faucibus vestibulum. Ut condimentum, orci et gravida pulvinar, est ligula congue quam, eu iaculis est nisi eu nisi. Aenean ac eleifend nisi. Nunc tortor lectus, rutrum ac facilisis fringilla, faucibus nec lacus. Cras dictum, nisi vitae ultrices varius, elit velit accumsan metus, quis laoreet leo diam vitae erat. Vestibulum dapibus dolor justo.
</p>
<p>
Praesent ornare, risus eget tincidunt volutpat, tellus dolor eleifend felis, in ullamcorper diam eros id sem. Integer ut nisi non nibh elementum viverra ut quis mi. Aliquam magna urna, varius at dictum in, laoreet nec nibh. Pellentesque lobortis turpis et ante ultricies lacinia. Duis eu orci ipsum, eu tincidunt massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nec augue non arcu auctor ornare id ac massa. Donec vel orci a nisl eleifend pharetra. Suspendisse arcu risus, posuere et ultrices tempus, rhoncus id mauris. Proin tincidunt fringilla rhoncus. Quisque sapien arcu, sagittis ut vehicula nec, vulputate vel purus. Fusce in dolor lacus, sed tristique tortor. Morbi turpis ante, vestibulum id fringilla id, dapibus eget libero.
</p>
<p>
Sed erat erat, ultrices id commodo eu, scelerisque ut lectus. Vestibulum molestie cursus justo, id fringilla felis ullamcorper ut. Proin ornare massa et nunc placerat ac iaculis magna cursus. Aenean venenatis, augue non dignissim imperdiet, libero leo fermentum nisi, a tristique libero ipsum in orci. Sed pharetra dapibus metus ac cursus. Sed tristique dignissim nulla, sit amet auctor felis commodo vel. Nam vitae velit sapien, vitae eleifend erat. Morbi vel orci quis quam rutrum vehicula tempor vel lorem. Sed ac justo viverra lectus blandit scelerisque sit amet nec purus. Aenean sed adipiscing nibh. Fusce pulvinar fermentum diam, nec vulputate sem euismod sit amet.
</p>
<p>
Ut rutrum fermentum lectus non consequat. Duis scelerisque iaculis sem vitae suscipit. Mauris auctor suscipit elit ut dictum. Aenean posuere nisi non tortor tempor non aliquet risus auctor. Suspendisse potenti. Vestibulum ultrices, nibh aliquam tincidunt consequat, nulla nisl gravida felis, in rhoncus purus sapien ac quam. Vivamus nisi lectus, convallis nec tempus vitae, sodales in eros. In at enim et risus pellentesque imperdiet. Nunc et dolor urna. Mauris felis felis, ultricies quis eleifend vitae, dignissim ornare leo. Nunc nibh felis, pulvinar vitae facilisis quis, tempus in nisl.
</p> 
</body>
</html>";
?>
<script type='text/php'>
error_log(print_r($GLOBALS['footer'],TRUE));
  $pdf->page_script('
    if ($PAGE_NUM >= 2) {
      $pdf->add_object($GLOBALS["header"][$PAGE_NUM],"add");
      $pdf->add_object($GLOBALS["footer"],"add");
    }
  ');
</script>
   <?php
   $dompdf = new DOMPDF();

$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");?>

The funny thing is, that  the pdf is generated, but when I try to open it I got an error message like, "An error occured when opening this document. The file is damaged an cannot be repaired." German error, so may not be correct translated.
After deleting every <script> part the pdf works fine. The online version works fine , too. With the scripts!

BrianS

unread,
Apr 25, 2013, 11:52:46 AM4/25/13
to dom...@googlegroups.com
On Thursday, April 25, 2013 11:04:40 AM UTC-4, Ollie wrote:
I just copied an example from dompdf:
<html>
...

<body>

<div class='first-page-header'>
  <div class='content'>My Great Treatise</div>
</div>
<div class='first-page-footer'>
  <div class='content'>something something</div>
</div>";?>

<script type='text/php'>
$GLOBALS['header'][] = array();
$GLOBALS['footer'] = NULL;
</script>
<?php $html=$html."
<div class='header'>";?>
  <script type='text/php'>$GLOBALS['header'][] = $pdf->open_object();</script>
  <div class='content'>Page <span class='pagenum'></span></div>
  <script type='text/php'>$pdf->close_object();</script>
</div>
<div class='footer'>
  <script type='text/php'>$GLOBALS['footer'] = $pdf->open_object();</script>
  <div class='content'>Copyright &copy;. All rights reserved.</div>
  <script type='text/php'>$pdf->close_object();</script><?php
$html=$html."/div>
...
</body>
</html>";
?>
<script type='text/php'>
error_log(print_r($GLOBALS['footer'],TRUE));
  $pdf->page_script('
    if ($PAGE_NUM >= 2) {
      $pdf->add_object($GLOBALS["header"][$PAGE_NUM],"add");
      $pdf->add_object($GLOBALS["footer"],"add");
    }
  ');
</script>
...

You don't quite have it. The sample that you're looking at is all part of the HTML document. The <script> content in that sample belong inside the HTML, not extracted as part of the PHP document performing the PDF render. dompdf (if set up to do so) will parse these scripts as part of the rendering process. That's why they're surrounded by the HTML <script> tags.

And this is probably why you're having the following problem:
 
The funny thing is, that  the pdf is generated, but when I try to open it I got an error message like, "An error occured when opening this document. The file is damaged an cannot be repaired." German error, so may not be correct translated.
After deleting every <script> part the pdf works fine. The online version works fine , too. With the scripts!
 
You probably have output buffering enabled. PHP is attempting to send errors to the browser, but with buffering enabled the errors are getting caught in the PDF stream. If you open your PDF in a text file you'll probably see the errors at the top of the document. You should either disable output buffering or disable displaying errors to the web browser (you can send them to a log file instead).

Ollie

unread,
Apr 25, 2013, 2:03:51 PM4/25/13
to dom...@googlegroups.com
Hm,
looks like I have a lack of understanding...
If I got it right, every output is written into a variable:
eg $content="<html><head></head><body>.. my text ...<script>.....</script></body></html>";
Than I have to sent $content to the dompdf stuff,right?

But when I do this, I have the problem :



Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) inC:\xampp\htdocs\dompdf\example1.php on line 27

Line 27:   <script type='text/php'>

    $GLOBALS['header'][] = array();
    $GLOBALS['footer'] = NULL;
    </script>


Normally a string has do be encaptured with " or  ' like $variable="text text text".$anothervar."text tect";
So it looks like these <string> Operator is ignored?
Thanks Brian for your help! :)

BrianS

unread,
Apr 25, 2013, 6:03:31 PM4/25/13
to dom...@googlegroups.com
Everything from that sample file goes into the same variable. You're getting an error because the script stuff should also go in as-is. It's not parsed then placed in the variable.

Let me try to simplify this. I'm adding ellipses to shorten the content. Your script should look like the following:

<?php
require_once("dompdf_config.inc.php");

$html="
  <html>
  <head>
    <style>...</style>
  </head>
  <body>

  ...

  <!-- DO NOT STOP BUILDING THE $html STRING VARIABLE, THE FOLLOWING IS PART OF THE STRING (FYI, this is an HTML comment) -->

  <script type='text/php'>
    $GLOBALS['header'][] = array();
    $GLOBALS['footer'] = NULL;
  </script>

  <div class='header'>

    <script type='text/php'>$GLOBALS['header'][] = $pdf->open_object();</script>
    <div class='content'>Page <span class='pagenum'></span></div>
    <script type='text/php'>$pdf->close_object();</script>
  </div>
  <div class='footer'>
    <script type='text/php'>$GLOBALS['footer'] = $pdf->open_object();</script>
    <div class='content'>Copyright &copy;. All rights reserved.</div>
    <script type='text/php'>$pdf->close_object();</script>
  </div>

  ...

  <!-- AGAIN, DO NOT STOP BUILDING THE $html STRING VARIABLE, THE FOLLOWING IS PART OF THE STRING -->
  <script type='text/php'>

    $pdf->page_script('
      if ($PAGE_NUM >= 2) {
        $pdf->add_object($GLOBALS['header'][$PAGE_NUM],'add');
        $pdf->add_object($GLOBALS['footer'],'add');
      }
    ');
  </script>

  </body>
  </html>

  <!-- NOW WE ARE DONE CREATING OUR HTML CONTENT, STOP BUILDING THE $html STRING VARIABLE -->
";


$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
?>

Ollie

unread,
Apr 26, 2013, 11:55:32 AM4/26/13
to dom...@googlegroups.com
Dear Brian,
first thanks for your patience.

Here I gave you a screenshot of my reduced source.
http://screencast.com/t/6KHHgIDiH7L

It says there is an error at $GLOBALS['header'][] = array();

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) inC:\xampp\htdocs\dompdf\example1.php on line 23

So problems with the ' inside the  ['header'
I cut the whole text to 3 lines. As you casn see in the ss.
Or is it any misconfiguration from my apache?
Best from Ger
Oliver

BrianS

unread,
Apr 26, 2013, 8:50:23 PM4/26/13
to dom...@googlegroups.com
I would reverse the quotes usage in this instance. You don't want PHP to parse any of the variables inside the $html string, so use single quotes to encapsulate the string and double quotes on the inside.

Also, try pastebin plus line numbers ... it'd make it a bit easier to parse/test.

Ollie

unread,
Apr 27, 2013, 11:14:03 AM4/27/13
to dom...@googlegroups.com
Hey, unbelievable.
It is working, till now.
So $html='text "more text"...'; works.
$html="text 'more text'..."; does not.

Firtst of all thank you. Never expected it, because normally it doesn't matter which way in normal php.

Thank you very much!
Oliver

Ollie

unread,
May 8, 2013, 11:39:53 AM5/8/13
to dom...@googlegroups.com

Dear all,
Ok, simple header works. Tried sevaral different solutions.
Now, I am still at the problem with different headers/footers or designing a normal page and from 2nd page on there should be a header/footer with Logo.
I tried this:
<code>


<?php
require_once("dompdf_config.inc.php");
$html='<html>
<head>
<style>
.first-page-header { position: absolute; left: 0px; right: 0px; top: 0px; background-color: black; color: white; text-align: center; }
.first-page-footer { position: absolute; left: 0px; right: 0px; bottom: 0px; background-color: black; color: white; text-align: center; }

.header { position: fixed; top: 0px; left: 0px; right: 0px; }
.header .content {  background-color: black; color: white; text-align: center; }
.footer { position: absolute; bottom: 0px; left: 0px; right: 0px; }
.footer .content { background-color: black; color: white; text-align: center; }

 .pagenum:before { content: counter(page); }

.pagenum:before {   content: counter(page); }
</style>
</head>
<body>
  <div class="first-page-header">
  <div class="content">My Great Treatise</div>
</div>
<div class="first-page-footer">
  <div class="content">something something</div>
</div>
      <script type="text/php">
$GLOBALS["header"][] = array();
$GLOBALS["footer"] = NULL;
</script>
<div class="header">";
  <script type="text/php">$GLOBALS["header"][] = $pdf->open_object();</script>
  <div class="content">Page <span class="pagenum"></span></div>
  <script type="text/php">$pdf->close_object();</script>
</div>
<div class="footer">
  <script type="text/php">$GLOBALS["footer"] = $pdf->open_object();</script>
<h2>Section 1.<span class=".pagenum"></span></h2>

  <script type="text/php">$pdf->close_object();</script>
</div>

lots of text ...lots of text ...lots of text ...lots of text ...

</body>

<script type="text/php">
error_log(print_r($GLOBALS["footer"],TRUE));
  $pdf->page_script("
    if ($PAGE_NUM >= 2) {
      $pdf->add_object($GLOBALS["header"][$PAGE_NUM],"add");
      $pdf->add_object($GLOBALS["footer"],"add");
    }
  ");
</script></html> ';

   $dompdf = new DOMPDF();

$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("pussy.pdf");?>
</code>

The first page is showing the header/footer. The following not.
I need it just the other way round...
First page clear, 2nd with header. The thing is, I have no idea how long the text will be. Could be 1 page or 10.
1 page: No header/footer
10 pages: 1 page no header/footer; 2-10 page header and footer.

The part
<style>
.first-page-header { position: absolute; left: 0px; right: 0px; top: 0px; background-color: black; color: white; text-align: center; }
.first-page-footer { position: absolute; left: 0px; right: 0px; bottom: 0px; background-color: black; color: white; text-align: center; }

.header { position: fixed; top: 0px; left: 0px; right: 0px; }
.header .content {  background-color: black; color: white; text-align: center; }
.footer { position: absolute; bottom: 0px; left: 0px; right: 0px; }
.footer .content { background-color: black; color: white; text-align: center; }

 .pagenum:before { content: counter(page); }

.pagenum:before {   content: counter(page); }
</style>

looks interesting, but  looks like being ignored.

I found a solution with fixed content on first page and fixed amount of text. But dynamically...
Best regards
Ollie
Reply all
Reply to author
Forward
0 new messages