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 6349823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:41:29+00:00 2026-05-24T21:41:29+00:00

I am using mPDF ( http://mpdf.bpm1.com ) to create pdf receipts, but at the

  • 0

I am using mPDF (http://mpdf.bpm1.com) to create pdf receipts, but at the moment they only display on a full A4 page.

I would like to resize them down to a reasonable size because we are using a epson tm-t88iv. This is the first dilemma I have.

The second problem I have involves invoking auto print on the printer attached.

I would like to do this when the form is processed (on the same page).

But I’m not sure how to implement this into the code I have right now:

  <?php 

// post

$id = $_GET['id'];
$user = $_GET['user'];
$week = $_GET['week'];
$pRent = $_GET['pRent'];
$rentPaid = $_GET['rentPaid'];
$result = $_GET['result'];
$pDate = date("d/m/Y");

$html = '

<style>
@page {
 margin-top: 20px;
 margin-left: 20px;
}
</style>

<div style="text-align:center; font-family: Arial, Helvetica, sans-serif;">
        <div style="border: 0px; padding: 0px; width: 175px; text-align:center;">
        <img src="resources/speedline.png" width="161" height="58" />
        <p style="font-weight: bold;" align="center">
        DRIVER '.$id.' RECEIPT</p>    
  <p style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;">'.$week.'</p>
    <span style="font-size: 10px;">PROCESSED BY '.$user.'</span><p>
          <table width="100%" border="0" cellspacing="0" cellpadding="0" >
  <tr>
    <td align="left" style="font-weight: bold; font-family: Arial, Helvetica, sans-serif;">DATE PAID</td>
    <td style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;" align="right">'.$pDate.'</td>
  </tr>
  <tr>
    <td align="left"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="left" style="font-weight: bold; font-family: Arial, Helvetica, sans-serif;">TOTAL RENT</td>
    <td style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;" align="right">£'.$pRent.'</td>
  </tr>
  <tr>
    <td align="left" style="font-weight: bold; font-family: Arial, Helvetica, sans-serif;">RENT PAID</td>
    <td style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;" align="right">£'.$rentPaid.'</td>
  </tr>
  <tr>
    <td align="left">&nbsp;</td>
    <td></td>
  </tr>
  <tr>
    <td align="left" style="font-weight: bold; font-family: Arial, Helvetica, sans-serif;">REMAINING</td>
    <td align="right" style="font-family: Arial, Helvetica, sans-serif;">£'.$result.'</td>
  </tr>
</table>
<br />
<span style="font-size:8px">THANK YOU FOR YOUR PAYMENT. PLEASE KEEP THIS RECEIPT FOR FUTURE REFERENCE. YOU WILL BE ASKED TO PRESENT IT AS EVIDENCE OF PAYMENT MADE.</span>
  </div>';

//==============================================================
//==============================================================
//==============================================================
include("mpdf/mpdf.php");
$mpdf=new mPDF('UTF-8-s','');
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
//==============================================================
//==============================================================
//==============================================================
//==============================================================
//==============================================================
?>
  • 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-05-24T21:41:29+00:00Added an answer on May 24, 2026 at 9:41 pm

    Try:
    $mpdf = new mPDF(”, ‘Letter’, 0, ”, 12.7, 12.7, 14, 12.7, 8, 8);

    and adjust the values at the end for the margins you want. Check out their documentation

    Sorry, not sure about auto printing, but there is some info here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Symfony and mPDF. I'm trying to integrate both but am running into
Using Google Maps InfoBox - http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html Currently the map will scroll - pan control
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
I need to create a PDF on a PHP page for a client whose
Using C#, I want to format a decimal to only display two decimal places
I'm using the mPDF library to generate PDF docs directly from HTML output. The
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using the RichTextArea in GWT, It looks like I can only change the font
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I
Using Entity Framework CodeFirst, how do I create a created datetime column that gets

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.