Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9109771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:07:22+00:00 2026-06-17T03:07:22+00:00

I am trying to create a pdf report using dompdf. The report needs to

  • 0

I am trying to create a pdf report using dompdf. The report needs to have the company logo on the top of the first page as well as a header and footer on every page. I have found solutions for adding a header and footer to a dompdf document elsewhere on stackoverflow. The problem I’m running into is that the company logo needs to be above the page header on the first page and not displayed on other pages

something like this

Company Logo
 - header
 - content here
 - footer
 ------
 - header
 - content here 
 - footer

Is there any way of doing this using dompdf?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:07:23+00:00Added an answer on June 17, 2026 at 3:07 am

    This is kludgey, but it works. You can basically fake the different headers by creating a normal header using fixed positioning and the special page 1 header using absolute positioning. If you set things up in the right order the page 1 header will be rendered on top of the standard header, obscuring it.

    <html>
      <head>
        <style>
          @page {
            margin: 0px;
          }
          @page :first {
            margin-top: 100px;
          }
          body {
            margin: 100px 20px 50px 20px;
          }
          #headerA {
            position: fixed;
            left: 0px; right: 0px; top: 0px;
            text-align: center;
            background-color: orange;
            height: 90px;
          }
          #headerB {
            position: absolute;
            left: -20px; right: -20px; top: -200px;
            text-align: center;
            background-color: orange;
            height: 190px;
          }
          #footer {
            position: fixed;
            left: 0px; right: 0px; bottom: 0px;
            text-align: center;
            background-color: orange;
            height: 40px;
          }
        </style>
      </head>
      <body>
        <div id="headerA">
          <h1>Widgets Express</h1>
        </div>
        <div id="headerB">
          <img class="logo" src="http://eclecticgeek.com/images/macro/ants.jpg" height="100" width="500">
          <h1>Widgets Express</h1>
        </div>
    
        <div id="footer">
          <p>Copyright, all rights reserved, yadda yadda</p>
        </div>
    
        <div id="content">
          ...
        </div>
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a pdf report using iTextSharp and I'm stumped as to
We're trying to create a .NET aspx page that will have a PDF within
I am trying to create PDF file using DOM pdf and Codeigniter. I have
I am trying to create Landscape PDF using iTextSharp but It is still showing
I am trying to create a PDF using iTextSharp library (version 4.1.2.0). At the
I'm trying to create Pdf from java using iText. How Can I Add two
I am trying to create a PDF file using struts 2.Action class location is
i am trying to create a pdf email using data inputed into a html
I'm trying to dynamically create a PDF using the TCPDF library in a document
I am trying to create a directory to download some pdf-files. I have been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.