Menu

Empty textbox on last page - can't dele...

Help
Anonymous
2010-06-25
2012-10-24
  • Anonymous

    Anonymous - 2010-06-25

    Hi, I use TCPDF an FPDI to generate a PDF file. Everything works fine, but on
    the last page, there is always an empty textbox on the bottom left on the
    page. If I put some more pages to the document, the empty textbox is always at
    the same position on the last page of the document. Does anyone know, where
    this textbox came from an how it can be deleted? Heres my code:

    // just require TCPDF instead of FPDF
    require_once('../xxx/tcpdf/config/lang/eng.php');
    require_once('../xxx/tcpdf/tcpdf.php');
    require_once('../xxx/fpdi/fpdi.php');
    
    class PDF extends FPDI
    {
    function Header()
    {
    }
    function Footer()
    {
    }
    }
    
    $pdf =& new FPDI();
    $pdf =& new PDF();
    
    // Load template pdf files
    $pagecount = $pdf->setSourceFile($qf_pdf_template);
    $tplidx = $pdf->importPage(1, '/MediaBox');
    $tplidx2 = $pdf->importPage(2, '/MediaBox');
    $tmplsize = $pdf->getTemplateSize($tplidx,0,0);
    
    //disable automatic page break
    $pdf->SetAutoPageBreak(false);
    
    // PDF informations
    $pdf->SetCreator('xxxxxxxxxxxxxx');
    $pdf->SetAuthor('xxxxxxxxx');
    $pdf->SetTitle('xxxxxxxxxx:'.$getuserid_userdata);
    $pdf->SetDisplayMode('fullpage');
    
    // First Page ####################################################################################
    $pdf->SetFont('arial','',5,'',true);
    $pdf->addPage('L', array(212,299));
    $pdf->useTemplate($tplidx,0,0,0,0,true);
    // insert customer logo an center it over the text box if a pdf file is available
    $pos = strpos($row_userdata['xxxxxxxx'], ".pdf");
    if($pos !== false) {
        $pdf->setSourceFile($qf_pdf_logo);
        $tplidx3 = $pdf->importPage(1); 
        $size = $pdf->getTemplateSize($tplidx3,0,30);
        if($size['w'] > 80) { 
            // reduce size if the logo is large landscape (heigt: 15 mm)
            $size = $pdf->getTemplateSize($tplidx3,0,15);
            $pdf->useTemplate($tplidx3, (148-($size['w']/2)),156,0,15); 
        } else {
            // print normal version (height: 30 mm)
            $pdf->useTemplate($tplidx3, (148-($size['w']/2)),156,0,30); 
        }
    }
    // write adress in text box
    $pdf->SetFont('arial','',8,'',true);
    $pdf->SetY(190);
    $pdf->SetX(108);
    $pdf->MultiCell(80,40,htmlentities($row_userdata['xxxxx']).'<br>'.htmlentities($row_userdata['xxxxx']),0,'C',0,1,'','','','',true);
    
    // Second Page ####################################################################################
    $pdf->addPage('L', array(212,299));
    $pdf->useTemplate($tplidx2,0,0,0,0,true);
    
    // Third Page test ####################################################################################
    // $pdf->addPage('L', array(212,299)); // if activated, the empty textbox appears on this page
    
    // output pdf
    $qf_filename = $row_userdata['xxxxxxxxxx']."-".date('d-m-Y').".pdf";
    $pdf->Output($qf_filename, 'D');
    

    Thanks for yout help!

     
  • JakeJ

    JakeJ - 2010-06-25

    It must be something in the default settings. Back up your existing TCPDF and
    FPDI folders and start with clean copies and see if you get the same results.
    Do one at a time of course so you know which of the two is causing the
    problem.

     
  • Anonymous

    Anonymous - 2010-06-28

    The error occures, even if I use the latest unchanged version of TCPDF
    (5.5.004). When I use the original FDPF Library, the textfield is not there
    anymore. So I think, there must be a bug in in TCPDF Class.

     
  • Nicola Asuni

    Nicola Asuni - 2010-06-28

    Please open the default examples at www.tcpdf.org
    If the examples are ok, probably you have some problems on your script.

     
  • Anonymous

    Anonymous - 2010-06-28

    Yes, on the original examples there is the same problem. Check out Example 005
    and have a look at the left bottom of the page. There is the empty textbox. I
    attached the screenshot an you can find the box for example with professional
    PDF tools like Enfocus Pitstop.

     
  • Nicola Asuni

    Nicola Asuni - 2010-06-28

    The thing indicated with the red arrow is not an empty textbox.
    It is just an invisible small text printed on the last page of PDF documents.
    You can ignore it.

     
  • Arseur

    Arseur - 2012-06-13

    Hi.

    I'm digging up this ooooold thread to ask something about this small invisible
    text. Is there a way not to print it ?
    I'll tell you why : i'm a professional printer and all of my TCPDF generated
    PDF are checked with a piece of software called PitStop. One of the things it
    checks is the presence of invisible objects (which can cause some problems
    during the printing process), and this small object here causes a check
    failure. So all my automation process is stopped by this line of text !
    It's very inconvenient and it would really help if it could not show up :)

    Thanks in advance !

     
  • Nicola Asuni

    Nicola Asuni - 2012-06-13

    This text is never printed.

     
  • Xander

    Xander - 2012-09-21

    Hello,

    I have this problem too. In the "empty textbox" there is a link to
    www.tcpdf.org. The font for this text (helvetica) is not embedded in the pdf
    (The fonts that could be not embedded are only the standard core fonts and
    CID-0 fonts.).

    The pdfs made with tcpdf will be printed in foreign countries. However on some
    locations helvetica is not available and can't be installed (don't ask me
    why). Without having this font there are some problems in opening the pdf (not
    just warnings).

    All other used textfonts are embedded. Is it possible to change the used
    textfont of this invisible link to one of the embedded fonts instead of
    helvetica?

    I am using TCPDF 5.9.162

    Greetings

     
  • Rob

    Rob - 2012-10-24

    I too have this problem.
    The font is not embedded and we cannot pass the preflight.

    Can you set this up to embed this font.
    I really don't want to hack the open source and get ride of the code that is doing this.

    Not cool

    Thanks,
    Rob

     
  • Florian Schaeffer

    Hello Rob,

    although I don't know if this is allowed or intended you could simply overwrite the Close()-function in your own PDF-class without hacking the source code.
    Again, I think credits for Nicola are valid to be embedded in the PDF but if your PitStop stops working this copyright box could be removed or you could adjust the font setting for that box so it uses a font you're embedding, as this textbox will never be printed anyway.

    Usually you are starting your project with

    $PDF = new TCPDF();
    

    In your case you should then start with

    class myPDF extends TCPDF() {
      public function Close() {
        ...
          your adjusted code for the close function goes here
          just examine the existing Close-function
        ...    
      }
    }
    
    $PDF = new myPDF();
    
     
    • Rob

      Rob - 2012-10-24

      Yes, I agree with a credits for Nicola. No argument here.

      Anyway, we try this and some other ways but it only removes the links from the PDF but the font (not embedded) is still there (see Document Properties in Acrobat Pro, under fonts). There is nothing on a page that use this font yet the font is in a list of used fonts.

      Any help with this is appreciate.

      Thanks,
      Rob

       
  • Jet

    Jet - 2012-10-24

    Florian, you've got exactly the place to remove that link.
    But, however, inside PDF, it's still showing that the font is not embedded, this is really bad for any print production.

     
  • Jim Hanlon

    Jim Hanlon - 2012-10-24

    The text to which you are referring contains some TCPDF branding: a link to the TCPDF website and some 1 pt text. You can easily remove it by setting property 'tcpdflink' to FALSE (since version 5.9.152). The property is protected, so you need to subclass tcpdf in order to modify the property. I set it to false in a subclass constructor.

    This is but one of several nitty mods that are necessary in order to create documents that are "clean" for press production. However, with some effort it is possible to create PDFs that are PDF/X compliant (I use both PDF/X-3:2003 and PDF/X-4 regularly) and will pass validation suites such as Adobe's "prepress" validation tools.

     
  • Nicola Asuni

    Nicola Asuni - 2012-10-24

    Hi Jim, if you post here the steps to produce a PDF/X compliant doc, I'll integrate it to the next TCPDF release so it will be much easier to control.

     
    • Jim Hanlon

      Jim Hanlon - 2012-10-24

      Sure, Nicola, I'll try to find some time to post them (to a separate thread).

       

Log in to post a comment.