Module

Archived
Forum
(read-only)

PDF Press

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From Doug Black, Jr.

     

How to create header and footer in PDF

General

Pavel
Pavel

Hi,

I need create header and footer which will be repeated on every generated page in PDF.
Is it possible to somehow achieved that?

In other words is there a way how to divide HTML code into separate container symbolizing each page of PDF?

Thank You
Pavel

owlookit
# 1
owlookit

Hi there,

I have the same problem and want to place a page numbering also.

Thank you in advance.

Cheers
Ruslan

patpohler
# 2
Developer
patpohler

Hi Ruslan, setting a header and footer can be done in CSS:

CSS:

#header { font-family:'Helvetica';font-size:.8em;font-weight:bold;position: fixed; left: 0px; top: -45px; right: 0px; height: 30px; text-align: center; border-bottom:1px solid #ccc;padding-top:5px;}
   #footer { font-family:'Helvetica';font-size:.8em;font-weight:bold;position: fixed; left: 0px; bottom: -45px; right: 0px; height: 30px;border-top:1px solid #ccc;padding-top:5px; }
   #footer .page:after { content: counter(page, upper-roman); } 

HTML, in your template

<div id="header">
     
Like what you seeGet PDF Press on <a href="http://dvt.ee/pdfprss">Devot:ee</a> or <a href="http://www.anecka.com/products/pdf-press">directly at Anecka.com</a>.
 </
div>
 <
div id="footer">
  
This is a live example of PDF Press generated on {current_time format="%Y-%m-%d %H:%i:%s"}
     
<script type="text/php">
      if ( isset(
$pdf) ) {
          $font 
Font_Metrics::get_font("helvetica");
    
$size 8;
    
$y $pdf->get_height() - 20;
    
$x $pdf->get_width() - 60 Font_Metrics::get_text_width($pageText$font$size);
          
$pdf->page_text($x$y"{PAGE_NUM} of {PAGE_COUNT}",
                          
$font$size);
     
</script>
   
</div

The <script> tag will allow you to set the page number in the footer. You’ll have to experiment with the height/width values to position the text.

owlookit
# 3
owlookit

Great info, thanks a lot, Patrick, for the quick reply!

Cheers
Ruslan

Colten Ryan
# 4
Colten Ryan

I think MiniMe is a great concept. I’ve had a lot of fun playing around with it and showing it to friends and family. I’m excited to see what people do with it. I think there’s still some work to be done on the software side of things — adding more features to the app, making it easier to use, etc. Visit https://masterbundles.com/templates/presentations/powerpoint/church/ source to download Church PPT templates for free. But from a hardware perspective, I think they’re off to a great start.

King Foster
# 5
King Foster

The process of creating header and footer in PDF is very simple and straightforward. You just need to open the document in which you want to create the header and footer. Go to the Insert tab and click on the Header & Footer option. A new dialog box will appear on the screen. In this dialog box, you can choose the position of the header and footer, as well as their alignment before you start reading https://www.on-magazine.co.uk/business/jobs-and-work/5-steps-to-write-perfect-executive-cv/ article. You can also choose to have a different header or footer for odd and even pages. Once you have made your selections, click on OK.

Mildred Lindsey
# 6
Mildred Lindsey

The header and footer of a PDF can be created using the page number, page title, and document name properties. In this huffpost.com/archive/ca/entry/to-pay-or-not-to-pay-someone-to-write-my-essay-for-me_b_14793970 article, I will show you how to create both on a Mac computer and on a Pc in Windows 10. Creating a header and footer in a PDF is not as complicated as you might imagine. You just need to follow some simple steps in order to make it happen.