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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:34:20+00:00 2026-05-26T07:34:20+00:00

I use this code for create a 80×30 mm pdf file with a 25×25

  • 0

I use this code for create a 80×30 mm pdf file with a 25×25 mm qrcode: I change the qrcode width and height but it doesn’t resize and I always see a little qrcode into the page.
Where is the error?? Please help me… I can’t undertand the problem! 🙂

<?php
require_once('../config/lang/eng.php');
require_once('../tcpdf.php');

// create new PDF document
$pdf = new TCPDF("L", "mm", array(80,30) , true, 'UTF-8', false);

//set margins
$pdf->SetMargins(0, PDF_MARGIN_TOP, 0);
$pdf->SetHeaderMargin(0);
$pdf->SetFooterMargin(0);

$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);

//set auto page breaks
$pdf->SetAutoPageBreak(false, 0);

//set image scale factor
$pdf->setImageScale(1);

//set some language-dependent strings
$pdf->setLanguageArray($l);

// add a page
$pdf->AddPage();

$pdf->SetAutoPageBreak(false, 0);

// new style
$style = array(
    'border' => false,
    'padding' => 'auto',
    'fgcolor' => array(0,0,0),
    'bgcolor' => false
);

$pdf->write2DBarcode('http://www.google.it/', 'QRCODE,H', 50, 1, 300, 300, $style, 'N');

// ---------------------------------------------------------

//Close and output PDF document
$pdf->Output('test.pdf', 'I');

//============================================================+
// END OF FILE
//============================================================+
?>    

Thank you!!!

  • 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-26T07:34:20+00:00Added an answer on May 26, 2026 at 7:34 am

    Problem solved:

    Before:

    [...]
    $pdf = new TCPDF("L", "mm", array(80,30) , true, 'UTF-8', false);
    [...]
    $pdf->AddPage();
    [/code]
    

    After:

    [code]
    [...]
    $pdf = new TCPDF("P", "mm", array(80,30) , true, 'UTF-8', false);
    [...]
    $pdf->AddPage('L', '', false, false);
    [/code]
    

    The problem is the constructor page orientation that create confusion to the system: default portrait is ok, I have only to change the Add page orientation to Landscape and the problem is solved.

    Thank you again for the attention.

    🙂

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

Sidebar

Related Questions

I use this code to determine checkbox width and height: var chk = $('input[type=checkbox]:first');
For full screenshots, I use this code: form1.Hide; sleep(500); bmp := TBitmap.Create; bmp.Height :=
i use this code for html file but it not working how to solve
I use this code to create all day event on Exchange 2010sp1: <?xml version=1.0
I use this code to create and plot N points: N=input('No. of Nodes:'); data
I use this code to create and plot N points: N = input('No. of
i have to create connecting server<=>client. I use this code: Server: import socket HOST
I use this code to create and show a MessageWindow: var newTitleWindow:MessageWindow = PopUpManager.createPopUp(contextView,MessageWindow,
I use this code to create a simple jquery carousel animation: $(document).ready(function() { var
I use this code to create arrays inside array. array_push($lists, $list); And then I

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.