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

  • Home
  • SEARCH
  • 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 6758899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:51:36+00:00 2026-05-26T13:51:36+00:00

So I coded a PDF document using fpdf (PHP) However when we go to

  • 0

So I coded a PDF document using fpdf (PHP)

However when we go to print these documents it seems to print correctly from my computer, but when I print from my bosses laptop it screws things up.

The only difference is he has installed the HP settings and I have not.

here is my code maybe something wrong in there?

<?php
mysql_connect("localhost","DBUSER","DBPASS");
mysql_select_db("DB");
require('fpdf/fpdf.php');

class PDF extends FPDF
{
// Page header
    function Header()
    {
        // Logo
        $this->Image('header.png',10,0,200);
        // Arial bold 15
        $this->SetFont('Arial','B',15);
        // Move to the right
        $this->Cell(80);
        // Line break
        $this->Ln(20);
    }

// Page footer
    function Footer()
    {
    // Position at 1.5 cm from bottom
    $this->SetY(-15);

    //$this->Image('footer.png',0,200,'210%');
    // Arial italic 8
    //$this->SetFont('Arial','I',8);
    // Page number
    //$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
    }
}

$pdf=new FPDF();

//Select the Products you want to show in your PDF file
$arr = array($_GET['ids']);
reset($arr);
while (list(, $value) = each($arr)) {

$result=mysql_query("SELECT customer.* FROM customer_detail as customer WHERE customer.customer_id IN ({$value})");
$number_of_customers = mysql_numrows($result);



//For each row, add the field to the corresponding column
while($row = mysql_fetch_array($result))
{
$pdf->AliasNbPages();
$pdf->AddPage(); 
    $name = "";
    $TradingName = "";
    $Street = "";
    $City = "";
    $state = "";


    $name = ucfirst($row["FirstName"])." ".ucfirst($row["LastName"]);
    $TradingName = $row["TradingName"];
    $Street = $row["Street"];
    $City = $row["City"];
    $state = $row["State"];

    if($state == 1)
    {
    $states = "VIC";
    }
    else if($state == 2)
    {
    $states = "NSW";
    }
    else if($state == 3)
    {
    $states = "QLD";
    }
    else if($state == 4)
    {
    $states = "WA";
    }
    else if($state == 5)
    {
    $states = "TAS";
    }
    else if($state == 6)
    {
    $states = "SA";
    }
    else if($state == 7)
    {
    $states = "ACT";
    }
    else if($state == 8)
    {
    $states = "NT";
    } 

    $PostCode = $row["PostCode"];

    $TradingName_code = $TradingName_code.$TradingName."\n";
    $Name_Code = $Name_code.$name."\n";
    $Address_code = $Address_Code.$Street."\n";
    $StateCityPostcode_code = $City." ".$states." ".$PostCode."\n";





//Create lines (boxes) for each ROW (Product)
//If you don't use the following code, you don't create the lines separating each row





// Instanciation of inherited class
    $pdf->SetFont('Arial','B',12);
    $pdf->Ln(60);
    $pdf->SetXY(25,65);
    $pdf->Cell(0,5,$TradingName,0,1);
    $pdf->SetXY(25,70);
    $pdf->Cell(0,5,$name,0,1);
    $pdf->SetFont('Arial','',12);
    $pdf->SetXY(25,75);
    $pdf->Cell(0,5,$Street,0,1);
    $pdf->SetXY(25,80);
    $pdf->Cell(0,5,$StateCityPostcode_code,0,1);
    $pdf->Ln(30);
    $pdf->Cell(0,5,"Dear ". ucfirst($row['FirstName']),0,1);
    $pdf->Ln(5);
    $pdf->Write(5,'Thank you and welcome to the Company program.');
    $pdf->Ln(8);
    $pdf->Write(5,'Please find enclosed your preliminary iNcard to access our Company program.');
    $pdf->Ln(8);
    $pdf->Write(5,'An Company representative will contact you by telephone in the next couple of days to assist you in validating your iNcard. To allow us to complete your business listing and start promoting it to over 300,000 of our iNcard holders, the validation process is as follows:');
    $pdf->SetXY(25,170);
    $pdf->Cell(0,5,"1. Your iNcard is activated over the phone and loaded with $1",0,1);
    $pdf->SetXY(25,175);
    $pdf->Cell(0,5,"2. An SMS confirmation is then sent to your mobile number",0,1);
    $pdf->SetXY(25,180);
    $pdf->Cell(0,5,"3. Once received, please run the $1.00 transaction through your EFTPOS terminal",0,1);
    $pdf->SetXY(25,185);
    $pdf->Cell(0,5,"4. You will then receive a follow up call to nominate a user name unique to your business",0,1);
    $pdf->SetXY(25,190);
    $pdf->Cell(0,5,"and to capture  your business details",0,1);
    $pdf->SetXY(25,195);
    $pdf->Cell(0,5,"5. A password is then supplied to enable you to access your account activities ",0,1);
    $pdf->SetXY(25,200);
    $pdf->Cell(0,5,"via http://manage.URL.com.au ",0,1);
    $pdf->Ln(8);
    $pdf->Write(5,"Once again, welcome to the program and should you require any assistance or clarification on any of the above points please do not hesitate to contact us.");
    $pdf->Ln(12);
    $pdf->Cell(0,5,"Kind regards,",0,1);
    $pdf->Cell(0,5,"Retail Support",0,1);
    $pdf->Cell(0,5,"Comp Pty Ltd",0,1);



}
mysql_close();
}

$pdf->Output();
?>
  • 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-26T13:51:36+00:00Added an answer on May 26, 2026 at 1:51 pm

    I don’t think there’s a problem with your code. It has more to do with different settings on different computers. Your boss might have some settings which controls the page layout and thus the printed page looks different compared to when you print it without those settings.

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

Sidebar

Related Questions

I am using iTextsharp to generate a PDF document from C# application. I am
i render Thumbnails of newly recieved PDF Document to the Documents-Directory. I'm using the
I am creating a pdf document using C# code in my process. I need
How can I modify the PDF document properties programmatically using .NET code? I have
I've been using the following code to open Office Documents, PDF, etc. on my
I'm making a LaTeX PDF document and using the hyperref package and \ref to
I'm trying to embed a PDF file into a Word document using the OLE
Currently I am using FOP to generate a pdf from java code and an
I create simple test PDF document using iTextSharp. I'm just using PdfContentByte to show
I'm using the following code to display a PDF document in IE: <a class=menu

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.