Jump to content

tripwater

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About tripwater

  • Rank
    Newbie
  1. Hello, for the longest time we were using FPDF to generate our pdf invoices. We recently upgraded to TCPDF and noticed we lost the bold font style. Our system admin says the font files are where they should be, in fact we can call $pdf->SetFont( 'Arial', 'BI', 10 ); and it is bold italic. Pass in 'I' and it is Italic but if we only pass in 'B' for bold, it display as normal font, no style. In the older FPDF, bold worked fine. Is there something we might be missing? We really need headers, certain labels and info to stand out in bold. Thank you for any help with this. Running the latest version of TCPDF on a Linux server. Thank you for any help with this.
  2. tripwater

    FPDF Help

    You are my hero!I also removed the call to AddPage() in InvoiceHeader();Here is my code now and it does in fact add the header now even with the multicell spilling over to page 2. Thank you so much.<?require( $RootPath.'/pdf/fpdf.php');//just prints the date top rightfunction InvoiceHeader( ){global $x;global $y;global $pdf;$x = .5;$y = .5;$pdf->SetXY( $x, $y );$pdf->SetFont( 'Arial', '', 8 );//setup fonts$pdf->Cell( 0, 0, "Printed On ".date( "Y-m-d" ), 0, 0, 'R' );}function PrintInvoiceTest(){global $pdf;global $dbname;global $RootPath;class PDF extends FPDF { function Header() { InvoiceHeader( ); } }$pdf=new PDF( 'P', 'in', array( 8.5, 11 ) );$pdf->AddPage( );InvoiceHeader();//just to keep simple and not have to print a bunch of text, we will start near the bottom of the page$x = .5;$y = 9.5;$pdf->SetXY( $x, $y );$pdf->SetFont( 'Arial', '', 10 );//setup fonts$var = 'sdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfg';$pdf->MultiCell( 0, .15, $var );$path = $RootPath."/attachments/".$dbname;$file = $path."/test_invoice.pdf";system( "rm ".$file );$pdf->Output( $file );}?>
  3. tripwater

    FPDF Help

    Hello,Right now I have a function called InvoiceHeader() the does all the necessary queries in php to mysql and builds a header of company info and customer info. I take this function and use like so class PDF extends FPDF{function Header(){InvoiceHeader( );}} Now, this works in all cases when the page reaches the bottom and calls add page EXCEPT when a multicell spills over to a new page. The problem is that at the end of the invoice we print Signature____________________This signature has to be on a page with a invoice header so that the signed document can be linked to the other pages by way of the date and invoice#. Just before the signature line we print Invoice Notes then Terms. Both of these are set by the customer in their own system so it has to be dynamic. One company may have a single paragraph of terms where as another has 5 paragraphs. So I use the multicell to contain the entire text. The problem is when the terms reach the end of the page it goes to another page and keeps printing and does not add our header. In all other situations when it gets within the default distance from the bottom and adds a page our header is printed. Just not when a multicell/blob of data spills over.So this results is a single page withblahblahbalhblahSignature______________________My question is this, how do I ensure that no matter what, my header is printed on every single page that exists? No matter if a multicell is what spills over or not. Here is a test page example of what I am talking aboutI took the time to put together a very simple example that just prints the header then instead of filling the pdf body up with a bunch of info I just started the Y position most of the way down the page so that it will act as if there is data above it.I then took a variable and filled it full of jibberish that could in all intents and purposes be considered a Terms agreement on an invoice or Invoice Notes that are of length.If you take the code below and build a test page, changing out the path it outputs the file to our just output to browser, you will see that the header ( which is just a date ) will print on the first page, then the variable contents in the multicell starts printing about 9 or so inches as specified, then it spills over to page 2 without a header.This is exactly what I am dealing with on a much larger scale with my invoice. If you can tell me what I am doing wrong here, then I can apply it to my Invoice. Thank you for your time. <?include( $RootPath.'/pdf/fpdf.php');//just prints the date top rightfunction InvoiceHeader( ){global $x;global $y;global $pdf;$x = .5;$y = .5;$pdf->AddPage( );$pdf->SetXY( $x, $y );$pdf->SetFont( 'Arial', '', 8 );//setup fonts$pdf->Cell( 0, 0, "Printed On ".date( "Y-m-d" ), 0, 0, 'R' );}function PrintInvoiceTest(){global $pdf;global $dbname;used for path on my serverglobal $RootPath;//used for path on my server$pdf=new FPDF( 'P', 'in', array( 8.5, 11 ) );class PDF extends FPDF{function Header(){InvoiceHeader( );}}InvoiceHeader();//just to keep simple we will start near the bottom of the page$x = .5;$y = 9.5;$pdf->SetXY( $x, $y );$pdf->SetFont( 'Arial', '', 10 );//setup fonts$var = 'sdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfgsdkjfhglskdfghjlskdjfghlskdfjghlskdjfghlskdjfghlskjdhfglskdjfhglskdjhfglskdfjhglksdjfhglsdkjfghlsdkfjghlsdkjfhglskdfjhglksdjfhglsdfg';$pdf->MultiCell( 0, .15, $var );$path = $RootPath."/attachments/".$dbname;$file = $path."/test_invoice.pdf";system( "rm ".$file );$pdf->Output( $file );}?> In my work flow I then have a page that includes this file and calls the function to generate and provides a link with the path to the pdf to open. You can output it anyway you prefer.
×
×
  • Create New...