PHP - Fpdf Output() Not Working In Chrome
<?PHP require("../fpdf/fpdf.php"); include("db.classes.php"); $g = new DB(); $g->connection(); class PDF extends FPDF { .....codes..... } $pdf = new PDF(); .....codes..... $pdf->SetFont('Arial','',14); $pdf->AddPage('L', 'Legal'); $pdf->SetXY(20,20); $pdf->image('../images/DCWD Watermark.png'); $pdf->SetY(35); // call the table creation method $pdf->SetFont('Arial','B',16); $pdf->Cell(0,10,$plateNo); $pdf->SetY(45); $pdf->SetFont('Arial','B',16); $pdf->Cell(0,10,$model); $pdf->SetXY(310, 45); $pdf->SetFont('Arial','B',16); $pdf->Cell(0,10,date("m/d/Y")); $pdf->SetY(55); $pdf->BuildTable($header,$data); $pdf->Output(); ?>Why is FPDF's Output not working? or is something wrong with my browser? I already tried putting paramaters on it but still no go I tried Output('foo.pdf','I') not working but if i itegrate my chrome withIDM it just downloads but when i disable integrationnothing happens. Similar TutorialsThis topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=351832.0 This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=316303.0 hi, I try to login through a form but when I click the button it does nothing in firefox7 and chrome. It works fine in IE. here's the code: Code: [Select] $a=""; $b=""; if ($_POST) { $a=trim($_POST["id"]); $b=trim($_POST["password"]); $a=str_replace("'","",$a); $b=str_replace("'","",$b); $a=str_replace("\"","",$a); $b=str_replace("\"","",$b); } if ($a=="" || $b=="") { if ($_SESSION["id_session"]=="" || $_SESSION["password_session"]=="") { ?> <form action=members.php method=post> <br><br><Center><table><tr><td colspan=2 align=center><h3>Members Login Area</h3></td></tr> <tr><td>Member's ID</td><td><input type=text name=id></td></tr> <tr><td>Password</td><td><input type=password name=password></td></tr> <tr><td> </td><td> <a href="forgot.php" onclick="doexit=false;"><font face="Verdana,Arial,Helvetica" size="1" color="#000000"><b>Forgot Your Password?</b></font></a></td></tr> <tr><td colspan=2 align=center><input type=submit value="Log In"></td></tr> </table></form> <? } else { middle(); } } else { $check=0; $id=$_POST["id"]; $rs = mysql_query("select * from members where ID='$id'"); if ($rs) { $arr=mysql_fetch_array($rs); $n2=$arr['Password']; if ($n2==$b) { $check=1; $_SESSION["id_session"]=$arr[0]; $_SESSION["password_session"]=$arr[9]; middle(); } } if ($check==0) { print "<h2>Invalid User Id or Password</h2>"; ?> <form action=members.php method=post> <br><br><Center><table><tr><td colspan=2 align=center><h3>Members Login Area</h3></td></tr> <tr><td>Member's ID</td><td><input type=text name=id></td></tr> <tr><td>Password</td><td><input type=password name=password></td></tr> <tr><td> </td><td> <a href="forgot.php" onclick="doexit=false;"><font face="Verdana,Arial,Helvetica" size="1" color="#000000"><b>Forgot Your Password?</b></font></a></td></tr> <tr><td colspan=2 align=center><input type=submit value="Log In"></td></tr> </table></form> <? } } thanks this outputs but I need the corresponding subfields tied next to the =tags thanks for some ideas? <?php $doc = new DOMDocument(); $doc->load( 'loc.xml' ); $librecords = $doc->getElementsByTagName( "record" ); foreach( $librecords as $record ){ $leader = $record->getElementsByTagName( "leader" ); $controlfields = $record->getElementsByTagName( "controlfield" ); $datafields = $record->getElementsByTagName( "datafield" ); $subfields = $record->getElementsByTagName( "subfield" ); $leader = $leader->item(0)->nodeValue; echo '=LDR '.$leader.'<BR>'; foreach( $controlfields as $controlfield ){ $tag = $controlfield->getAttribute('tag'); $cf_value = $controlfield->firstChild->nodeValue; echo "=".$tag." ".$cf_value.'<BR>'; } foreach( $datafields as $datafield ){ $tag = $datafield->getAttribute('tag'); $ind1 = $datafield->getAttribute('ind1'); $ind2 = $datafield->getAttribute('ind2'); if ($ind1 ==" ") {$ind1 = "_";} if ($ind2 ==" ") {$ind2 = "_";} echo "=".$tag." ".$ind1.$ind2; echo '<BR>'; } foreach( $subfields as $subfield ){ $code = $subfield->getAttribute('code'); $sf_value = $subfield->firstChild->nodeValue; echo '$'.$code.$sf_value.'<BR>'; } echo '<BR><BR>'; } ?> here is the xml file, I called it loc.xml Code: [Select] <?xml version="1.0"?> <zs:searchRetrieveResponse xmlns:zs="http://www.loc.gov/zing/srw/"><zs:version>1.1</zs:version><zs:numberOfRecords>2144</zs:numberOfRecords><zs:records><zs:record><zs:recordSchema>info:srw/schema/1/marcxml-v1.1</zs:recordSchema><zs:recordPacking>xml</zs:recordPacking><zs:recordData><record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01026ngm a22002773a 4500</leader> <controlfield tag="001">16429180</controlfield> <controlfield tag="005">20100823131409.0</controlfield> <controlfield tag="007">vffcjaho|</controlfield> <controlfield tag="008">100823s2010 xxu060 mleng </controlfield> <datafield tag="906" ind1=" " ind2=" "> <subfield code="a">0</subfield> <subfield code="b">cbc</subfield> <subfield code="c">orignew</subfield> <subfield code="d">u</subfield> <subfield code="e">ncip</subfield> <subfield code="f">20</subfield> <subfield code="g">y-movingim</subfield> </datafield> <datafield tag="955" ind1=" " ind2=" "> <subfield code="b">qm12 2010-08-23</subfield> </datafield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 2010608899</subfield> </datafield> <datafield tag="017" ind1=" " ind2=" "> <subfield code="a">PA0001684303</subfield> <subfield code="b">U.S. Copyright Office</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">DLC</subfield> <subfield code="c">DLC</subfield> <subfield code="e">amim</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">VBU 4599 (viewing copy)</subfield> </datafield> <datafield tag="245" ind1="0" ind2="0"> <subfield code="a">30 Rock.</subfield> <subfield code="p">Emmanuelle goes to Dinosaur Land.</subfield> </datafield> <datafield tag="246" ind1="3" ind2="0"> <subfield code="a">Emmanuelle goes to Dinosaur Land</subfield> </datafield> <datafield tag="246" ind1="3" ind2=" "> <subfield code="a">Thirty rock.</subfield> <subfield code="p">Emmanuelle goes to Dinosaur Land</subfield> </datafield> <datafield tag="257" ind1=" " ind2=" "> <subfield code="a">United States.</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="c">2010-05-13.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 videocassette of 1 (Betacam SP) (60 min.) :</subfield> <subfield code="b">sd., col. ;</subfield> <subfield code="c">1/2 in.</subfield> <subfield code="3">viewing copy.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Episode no. 4021.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Sources used: videocassette container; Copyright catalog online; Copyright description.</subfield> </datafield> <datafield tag="655" ind1=" " ind2="0"> <subfield code="a">Situation comedies (Television programs)</subfield> </datafield> <datafield tag="655" ind1=" " ind2="0"> <subfield code="a">Fiction television programs.</subfield> </datafield> <datafield tag="710" ind1="2" ind2=" "> <subfield code="a">Copyright Collection (Library of Congress)</subfield> <subfield code="5">DLC</subfield> </datafield> </record></zs:recordData><zs:recordPosition>2</zs:recordPosition></zs:record><zs:record><zs:recordSchema>info:srw/schema/1/marcxml-v1.1</zs:recordSchema><zs:recordPacking>xml</zs:recordPacking><zs:recordData><record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01718cjm a22003971a 4500</leader> <controlfield tag="001">13463061</controlfield> <controlfield tag="005">20051217130827.0</controlfield> <controlfield tag="007">sd fsngnnmmned</controlfield> <controlfield tag="008">040120r19961983caurcn eng d</controlfield> <datafield tag="024" ind1="1" ind2=" "> <subfield code="a">076744000422</subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(DLC) 2004567544</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">KFW</subfield> <subfield code="c">KFW</subfield> <subfield code="d">IEP</subfield> <subfield code="d">OCLCQ</subfield> <subfield code="d">DLC</subfield> </datafield> <datafield tag="020" ind1=" " ind2=" "> <subfield code="c">$17.98</subfield> </datafield> <datafield tag="024" ind1="1" ind2="0"> <subfield code="a">076744000422</subfield> </datafield> <datafield tag="028" ind1="0" ind2="2"> <subfield code="a">HIPD 40004</subfield> <subfield code="b">Hip-O Records</subfield> </datafield> <datafield tag="028" ind1="0" ind2="2"> <subfield code="a">40004-2</subfield> <subfield code="b">Hip-O Records</subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(OCoLC)ocm35640234 </subfield> </datafield> <datafield tag="028" ind1="0" ind2="2"> <subfield code="a">HIPD-40004</subfield> <subfield code="b">Hip-O Records</subfield> </datafield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 2004567544</subfield> </datafield> <datafield tag="042" ind1=" " ind2=" "> <subfield code="a">lcderive</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">SDA 85496</subfield> </datafield> <datafield tag="245" ind1="0" ind2="4"> <subfield code="a">The '80s hit(s) back!</subfield> <subfield code="h">[sound recording].</subfield> </datafield> <datafield tag="246" ind1="3" ind2=" "> <subfield code="a">Eighty's hit(s) back!</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">Universal City, Calif. :</subfield> <subfield code="b">Hip-O Records,</subfield> <subfield code="c">p1996.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 sound disc :</subfield> <subfield code="b">digital ;</subfield> <subfield code="c">4 3/4 in.</subfield> </datafield> <datafield tag="511" ind1="0" ind2=" "> <subfield code="a">Various performers.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Selections previously released 1983-1988.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Compact disc.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">She drives me crazy (Fine Young Cannibals) -- Walk the dinosaur (Was (Not Was)) -- You keep me hangin' on (Kim Wilde) -- The safety dance (Men Without Hats) -- Walking on sunshine (Katrina & The Waves) -- One thing leads to another (The Fixx) -- Heaven is a place on earth (Belinda Carlisle) -- Everybody have fun tonight (Wang Chung) -- Cruel summer (Bananarama) -- Weird science (Oingo Boingo) -- Axel F (Harold Faltermeyer) -- The future's so bright, I gotta wear shades (Timbuk 3).</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Rock music</subfield> <subfield code="y">1981-1990.</subfield> </datafield> <datafield tag="655" ind1=" " ind2="7"> <subfield code="a">Compact discs.</subfield> <subfield code="2">lcsh</subfield> </datafield> <datafield tag="906" ind1=" " ind2=" "> <subfield code="a">7</subfield> <subfield code="b">cbc</subfield> <subfield code="c">copycat</subfield> <subfield code="d">3</subfield> <subfield code="e">ncip</subfield> <subfield code="f">20</subfield> <subfield code="g">y-genmusic</subfield> </datafield> <datafield tag="925" ind1="0" ind2=" "> <subfield code="a">acquire</subfield> <subfield code="b">2 copies</subfield> <subfield code="x">policy default</subfield> </datafield> <datafield tag="952" ind1=" " ind2=" "> <subfield code="a">muzerec</subfield> </datafield> <datafield tag="955" ind1=" " ind2=" "> <subfield code="a">vn76 2004-01-20 to MBRS/RS</subfield> <subfield code="e">vn76 2004-01-20 copy 2 to MBRS/RS</subfield> </datafield> <datafield tag="985" ind1=" " ind2=" "> <subfield code="c">OCLC</subfield> <subfield code="e">srreplace 2005-08</subfield> </datafield> </record></zs:recordData><zs:recordPosition>3</zs:recordPosition></zs:record><zs:record><zs:recordSchema>info:srw/schema/1/marcxml-v1.1</zs:recordSchema><zs:recordPacking>xml</zs:recordPacking><zs:recordData><record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01461ngm a22003375a 4500</leader> <controlfield tag="001">11624471</controlfield> <controlfield tag="005">00000000000000.0</controlfield> <controlfield tag="008">930921s1967 xxu vaeng </controlfield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="9">(DLC) 93513624</subfield> </datafield> <datafield tag="906" ind1=" " ind2=" "> <subfield code="a">0</subfield> <subfield code="b">ibc</subfield> <subfield code="c">orignew</subfield> <subfield code="d">u</subfield> <subfield code="e">ncip</subfield> <subfield code="f">19</subfield> <subfield code="g">y-movingim</subfield> </datafield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 93513624 </subfield> </datafield> <controlfield tag="007">v| ||||||</controlfield> <datafield tag="017" ind1=" " ind2=" "> <subfield code="a">PA608-254</subfield> <subfield code="b">U.S. Copyright Office</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">DLC</subfield> <subfield code="c">DLC</subfield> <subfield code="e">amim</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">VBK 2042 (viewing copy)</subfield> </datafield> <datafield tag="245" ind1="0" ind2="0"> <subfield code="a">Abbott & Costello cartoons.</subfield> <subfield code="p">Dinosaur Dilemna /</subfield> <subfield code="c">a Hanna-Barbera Production in association with RKO Pictures Company-Jomar Productions ; directed and produced by Joseph Barbera and William Hanna.</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">United States :</subfield> <subfield code="b">[s.n.],</subfield> <subfield code="c">1967.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 videocassette of 1 :</subfield> <subfield code="b">sd., col. ;</subfield> <subfield code="c">3/4 in. viewing copy.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Copyright: PUB 5May67; PA608-254.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Copyright notice on film: RKO General Inc., Jomar Prod. Inc., Hanna-Barbera Productions, Inc. ; 1967.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">On cassette with episodes: Frigid fugitive ; Invader raider ; Paddleboat pirate.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Number 12</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Animation.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Source used: copyright data sheet.</subfield> </datafield> <datafield tag="541" ind1=" " ind2=" "> <subfield code="d">Received: 4/27/1993;</subfield> <subfield code="3">viewing copy;</subfield> <subfield code="c">copyright deposit--RNR;</subfield> <subfield code="a">Copyright Collection.</subfield> </datafield> <datafield tag="710" ind1="2" ind2=" "> <subfield code="a">Copyright Collection (Library of Congress)</subfield> <subfield code="5">DLC</subfield> </datafield> <datafield tag="740" ind1="0" ind2=" "> <subfield code="a">Dinosaur dilemna.</subfield> </datafield> <datafield tag="740" ind1="0" ind2=" "> <subfield code="a">Abbott and Costello cartoons.</subfield> <subfield code="p">Dinosaur dilemna.</subfield> </datafield> <datafield tag="953" ind1=" " ind2=" "> <subfield code="a">TE01</subfield> </datafield> <datafield tag="969" ind1=" " ind2=" "> <subfield code="a">qxp</subfield> </datafield> <datafield tag="991" ind1=" " ind2=" "> <subfield code="b">c-MP&TV</subfield> <subfield code="h">VBK 2042 (viewing copy)</subfield> <subfield code="w">MUMS VM File</subfield> </datafield> </record></zs:recordData><zs:recordPosition>4</zs:recordPosition></zs:record><zs:record><zs:recordSchema>info:srw/schema/1/marcxml-v1.1</zs:recordSchema><zs:recordPacking>xml</zs:recordPacking><zs:recordData><record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01461ngm a22003375a 4500</leader> <controlfield tag="001">11624468</controlfield> <controlfield tag="005">00000000000000.0</controlfield> <controlfield tag="008">930921s1967 xxu vaeng </controlfield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="9">(DLC) 93513621</subfield> </datafield> <datafield tag="906" ind1=" " ind2=" "> <subfield code="a">0</subfield> <subfield code="b">ibc</subfield> <subfield code="c">orignew</subfield> <subfield code="d">u</subfield> <subfield code="e">ncip</subfield> <subfield code="f">19</subfield> <subfield code="g">y-movingim</subfield> </datafield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 93513621 </subfield> </datafield> <controlfield tag="007">v| ||||||</controlfield> <datafield tag="017" ind1=" " ind2=" "> <subfield code="a">PA608-252</subfield> <subfield code="b">U.S. Copyright Office</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">DLC</subfield> <subfield code="c">DLC</subfield> <subfield code="e">amim</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">VBK 2042 (viewing copy)</subfield> </datafield> <datafield tag="245" ind1="0" ind2="0"> <subfield code="a">Abbott & Costello cartoons.</subfield> <subfield code="p">Frigid fugitive /</subfield> <subfield code="c">a Hanna-Barbera Production in association with RKO Pictures Company-Jomar Productions ; directed and produced by Joseph Barbera and William Hanna.</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">United States :</subfield> <subfield code="b">[s.n.],</subfield> <subfield code="c">1967.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 videocassette of 1 :</subfield> <subfield code="b">sd., col. ;</subfield> <subfield code="c">3/4 in. viewing copy.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Copyright: PUB 12May67; PA608-252.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Copyright notice on film: RKO General Inc., Jomar Prod. Inc., Hanna-Barbera Productions, Inc. ; 1967.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">On cassette with episodes: Invader raider ; Dinosaur dilemna ; Paddleboat pirate.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Number 12.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Animation.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Source used: copyright data sheet.</subfield> </datafield> <datafield tag="541" ind1=" " ind2=" "> <subfield code="d">Received: 4/27/1993;</subfield> <subfield code="3">viewing copy;</subfield> <subfield code="c">copyright deposit--RNR;</subfield> <subfield code="a">Copyright Collection.</subfield> </datafield> <datafield tag="710" ind1="2" ind2=" "> <subfield code="a">Copyright Collection (Library of Congress)</subfield> <subfield code="5">DLC</subfield> </datafield> <datafield tag="740" ind1="0" ind2=" "> <subfield code="a">Frigid fugitive.</subfield> </datafield> <datafield tag="740" ind1="0" ind2=" "> <subfield code="a">Abbott and Costello cartoons.</subfield> <subfield code="p">Frigid fugitive.</subfield> </datafield> <datafield tag="953" ind1=" " ind2=" "> <subfield code="a">TE01</subfield> </datafield> <datafield tag="969" ind1=" " ind2=" "> <subfield code="a">qxp</subfield> </datafield> <datafield tag="991" ind1=" " ind2=" "> <subfield code="b">c-MP&TV</subfield> <subfield code="h">VBK 2042 (viewing copy)</subfield> <subfield code="w">MUMS VM File</subfield> </datafield> </record></zs:recordData><zs:recordPosition>5</zs:recordPosition></zs:record><zs:record><zs:recordSchema>info:srw/schema/1/marcxml-v1.1</zs:recordSchema><zs:recordPacking>xml</zs:recordPacking><zs:recordData><record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01458ngm a22003375a 4500</leader> <controlfield tag="001">11624469</controlfield> <controlfield tag="005">00000000000000.0</controlfield> <controlfield tag="008">930921s1967 xxu vaeng </controlfield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="9">(DLC) 93513622</subfield> </datafield> <datafield tag="906" ind1=" " ind2=" "> <subfield code="a">0</subfield> <subfield code="b">ibc</subfield> <subfield code="c">orignew</subfield> <subfield code="d">u</subfield> <subfield code="e">ncip</subfield> <subfield code="f">19</subfield> <subfield code="g">y-movingim</subfield> </datafield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 93513622 </subfield> </datafield> <controlfield tag="007">v| ||||||</controlfield> <datafield tag="017" ind1=" " ind2=" "> <subfield code="a">PA608-253</subfield> <subfield code="b">U.S. Copyright Office</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">DLC</subfield> <subfield code="c">DLC</subfield> <subfield code="e">amim</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">VBK 2042 (viewing copy)</subfield> </datafield> <datafield tag="245" ind1="0" ind2="0"> <subfield code="a">Abbott & Costello cartoons.</subfield> <subfield code="p">Invader raider /</subfield> <subfield code="c">a Hanna-Barbera Production in association with RKO Pictures Company-Jomar Productions ; directed and produced by Joseph Barbera and William Hanna.</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">United States :</subfield> <subfield code="b">[s.n.],</subfield> <subfield code="c">1967.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 videocassette of 1 :</subfield> <subfield code="b">sd., col. ;</subfield> <subfield code="c">3/4 in. viewing copy.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Copyright: PUB 1Jun67; PA608-253.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Copyright notice on film: RKO General Inc., Jomar Prod. Inc., Hanna-Barbera Productions, Inc. ; 1967.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">On cassette with episodes: Frigid fugitive ; Dinosaur dilemna ; Paddleboat pirate.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Number 12.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Animation.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Source used: copyright data sheet.</subfield> </datafield> <datafield tag="541" ind1=" " ind2=" "> <subfield code="d">Received: 4/27/1993;</subfield> <subfield code="3">viewing copy;</subfield> <subfield code="c">copyright deposit--RNR;</subfield> <subfield code="a">Copyright Collection.</subfield> </datafield> <datafield tag="710" ind1="2" ind2=" "> <subfield code="a">Copyright Collection (Library of Congress)</subfield> <subfield code="5">DLC</subfield> </datafield> <datafield tag="740" ind1="0" ind2=" "> <subfield code="a">Invader raider.</subfield> </datafield> <datafield tag="740" ind1="0" ind2=" "> <subfield code="a">Abbott and Costello cartoons.</subfield> <subfield code="p">Invader raider.</subfield> </datafield> <datafield tag="953" ind1=" " ind2=" "> <subfield code="a">TE01</subfield> </datafield> <datafield tag="969" ind1=" " ind2=" "> <subfield code="a">qxp</subfield> </datafield> <datafield tag="991" ind1=" " ind2=" "> <subfield code="b">c-MP&TV</subfield> <subfield code="h">VBK 2042 (viewing copy)</subfield> <subfield code="w">MUMS VM File</subfield> </datafield> </record></zs:recordData><zs:recordPosition>6</zs:recordPosition></zs:record></zs:records></zs:searchRetrieveResponse> Code: [Select] //display an external link or form button if ($product_link = $meta['mp_product_link']) { $button = '<a class="mp_link_buynow" href="' . esc_url($product_link) . '">' . __('Buy Now »', 'mp') . '</a>'; } else { if ($all_out) { $button .= '<span class="mp_no_stock">' . __('Out of Stock', 'mp') . '</span>'; } else { $button = '<div class="mp_product_variations" name="variation">'; //create select list if more than one variation if (is_array($meta["mp_price"]) && count($meta["mp_price"]) > 1 && empty($meta["mp_file"])) { // for each as foreach ($meta["mp_price"] as $key => &$value) { $disabled = (in_array($key, $no_inventory)) ? ' disabled="disabled"' : ''; $variation_select = '<form name="' . $key . '" class="mp_buy_form" method="post" action="' . mp_cart_link(false, true) . '">\n'; $variation_select .= '<input type="hidden" name="product_id" value="' . $post_id . '" />'; $variation_select .= '<input type="hidden" name="variation" value="' . $key . '">'; $variation_select .= '<span>' . esc_html($meta["mp_var_name"][$key]) . ' - '; if ($meta["mp_is_sale"] && $meta["mp_sale_price"][$key]) { $variation_select .= $mp->format_currency('', $meta["mp_sale_price"][$key]); } else { $variation_select .= $mp->format_currency('', $value); }$variation_select .= "</span>\n"; if ($context == 'list') { if ($variation_select) { $variation_select .= '<a class="mp_link_buynow" href="' . get_permalink($post_id) . '">' . __('Choose Option »', 'mp') . '</a>'; } else if ($settings['list_button_type'] == 'addcart') { $variation_select .= '<input type="hidden" name="action" value="mp-update-cart" />'; $variation_select .= '<input class="mp_button_addcart" type="submit" name="addcart" value="' . __('Add To Cart »', 'mp') . '" />'; } else if ($settings['list_button_type'] == 'buynow') { $variation_select .= '<input class="mp_button_buynow" type="submit" name="buynow" value="' . __('Buy Now »', 'mp') . '" />'; } } else { $button .= $variation_select; //add quantity field if not downloadable if ($settings['show_quantity'] && empty($meta["mp_file"])) { $button .= '<span class="mp_quantity"><label>' . __('Quantity:', 'mp') . ' <input class="mp_quantity_field" type="text" size="1" name="quantity" value="1" /></label></span> '; } if ($settings['product_button_type'] == 'addcart') { $button .= '<input type="hidden" name="action" value="mp-update-cart" />'; $button .= '<input class="mp_button_addcart" type="submit" name="addcart" value="' . __('Add To Cart »', 'mp') . '" />'; } else if ($settings['product_button_type'] == 'buynow') { $button .= '<input class="mp_button_buynow" type="submit" name="buynow" value="' . __('Buy Now »', 'mp') . '" />'; } } $variation_select .= "</form>\n"; } //end for each $variation_select .= '</div>'; } else { $button .= '<input type="hidden" name="variation" value="0" />'; } } } Everything inbetween "for each" is being looped, except for the <form>. How can I get it to include <form> and </form> in the loop? I need a little help with fpdf: Code: [Select] <?php include_once("connect.php"); if($_POST['submit']){ $startdate=$_POST['startdate']; $enddate=$_POST['enddate']; $sql = mysql_query("SELECT * FROM transactions where date between '$startdate' and '$enddate' "); while($row = mysql_fetch_array($sql)){{ $date = $row["date"]; $product = $row["product"]; $month = $row["month"]; $day = $row["day"]; $year = $row["year"]; $category = $row["category"]; $academy = $row["academy"]; $price = $row["price"]; $priceunit = $row["priceunit"]; $quantity = $row["quantity"]; } // Query member data from the database and ready it for display require('fpdf.php'); class PDF extends FPDF { function EAN13($x=1, $y, $barcode, $h=16, $w=.35) { $this->Barcode(13,5,$barcode,$h,$w,13); } function UPC_A($x, $y, $barcode, $h=16, $w=.35) { $this->Barcode($x,$y,$barcode,$h,$w,12); } function GetCheckDigit($barcode) { //Compute the check digit $sum=0; for($i=1;$i<=11;$i+=2) $sum+=3*$barcode[$i]; for($i=0;$i<=10;$i+=2) $sum+=$barcode[$i]; $r=$sum%10; if($r>0) $r=10-$r; return $r; } function TestCheckDigit($barcode) { //Test validity of check digit $sum=0; for($i=1;$i<=11;$i+=2) $sum+=3*$barcode[$i]; for($i=0;$i<=10;$i+=2) $sum+=$barcode[$i]; return ($sum+$barcode[12])%10==0; } function Barcode($x, $y, $barcode, $h, $w, $len) { //Padding $barcode=str_pad($barcode,$len-1,'0',STR_PAD_LEFT); if($len==12) $barcode='0'.$barcode; //Add or control the check digit if(strlen($barcode)==12) $barcode.=$this->GetCheckDigit($barcode); elseif(!$this->TestCheckDigit($barcode)) $this->Error('Incorrect check digit'); //Convert digits to bars $codes=array( 'A'=>array( '0'=>'0001101','1'=>'0011001','2'=>'0010011','3'=>'0111101','4'=>'0100011', '5'=>'0110001','6'=>'0101111','7'=>'0111011','8'=>'0110111','9'=>'0001011'), 'B'=>array( '0'=>'0100111','1'=>'0110011','2'=>'0011011','3'=>'0100001','4'=>'0011101', '5'=>'0111001','6'=>'0000101','7'=>'0010001','8'=>'0001001','9'=>'0010111'), 'C'=>array( '0'=>'1110010','1'=>'1100110','2'=>'1101100','3'=>'1000010','4'=>'1011100', '5'=>'1001110','6'=>'1010000','7'=>'1000100','8'=>'1001000','9'=>'1110100') ); $parities=array( '0'=>array('A','A','A','A','A','A'), '1'=>array('A','A','B','A','B','B'), '2'=>array('A','A','B','B','A','B'), '3'=>array('A','A','B','B','B','A'), '4'=>array('A','B','A','A','B','B'), '5'=>array('A','B','B','A','A','B'), '6'=>array('A','B','B','B','A','A'), '7'=>array('A','B','A','B','A','B'), '8'=>array('A','B','A','B','B','A'), '9'=>array('A','B','B','A','B','A') ); $code='101'; $p=$parities[$barcode[0]]; for($i=1;$i<=6;$i++) $code.=$codes[$p[$i-1]][$barcode[$i]]; $code.='01010'; for($i=7;$i<=12;$i++) $code.=$codes['C'][$barcode[$i]]; $code.='101'; //Draw bars for($i=0;$i<strlen($code);$i++) { if($code[$i]=='1') $this->Rect($x+$i*$w,$y,$w,$h,'F'); } //Print text uder barcode $this->SetFont('Arial','B',12); $this->Text($x,$y+$h+11/$this->k,substr($barcode,-$len)); } //Instanciation of inherited class function Header() { global $name; global $date; global $product; global $month; global $day; global $year; global $academy; global $price; global $priceunit; global $category; global $quantity; // get the variable $name1 into the scope of this function //Logo //Arial bold 15 $this->SetFont('Arial','B',15); //Move to the right $this->Cell(70); //Title $this->Cell(0,0,'Please bring this to the next Scout Meeting',0,0,C); // Query member data from the database and ready it for display //Line break $this->Ln(20); $this->Cell(0,0,'',1,0); $this->Ln(20); $this->cell(50,10, 'Product:', 1,0); $this->cell(50,10, 'Category:', 1,0); $this->cell(50,10, 'Price:', 1,0); $this->Ln(10); $this->cell(50,10,$product, 'L,R',0); $this->cell(50,10, $category, 'L',0); $this->cell(50,10, $price, 'L,R',0); } //Page footer function Footer() { //Position at 1.5 cm from bottom $this->SetY(-15); //Arial italic 8 $this->SetFont('Arial','B',8); //Page number $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); } }} //Instanciation of inherited class $pdf=new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Arial','B',12); $pdf->Output('ticket.pdf', 'I');}?> Problem I am having is running the code through a loop. I need the products and such to run through the loop of querying the database so that all the entries in database meet the specs. please help:) Hi All, New here to PHP. Was designing a pdf file using FPDF. Here is my problem: I want to display a table. I want to have rows and columns. For example the code below gives me one row perfectly: $this->SetFont('Arial','',10); // Logo //$this->Image(SETTING_MAIN_URL . 'images/logo.png',10,19,33); $this->Image($this->image_folder . 'pdf_logo.png',10,5,33); // Right hand header $this->SetFont('Arial','B',13); $this->Text(45,14,"test test test"); $this->SetFont('','',10); $this->Text(10,22,"Account: "); $this->Text(25,22,Sessionmanager::getUser()->getAccount()); $this->Text(10,27,"Date: "); $this->Text(20,27,$today = date("m.d.y")); $this->Ln(20); $this->Cell(30,7,"Number",1,0,'L'); $this->Cell(33,7,"NAME",1); $this->Cell(33,7,"address",1); $this->Cell(33,7,"address2",1); $this->Cell(33,7,"address3",1); $this->Cell(33,7,"country",1); $this->Ln(10); $i=0; $this->SetFont('Arial','B',5); for($i=0;$i<sizeof($this->list);$i++) { $consignment= $this->list[$i]; $this->Cell(33,7,$consignment->getBIll(),1,'L'); $this->Cell(33,7,"asdfasdfasdf",1,'L'); $this->MultiCell(33,7,$consignment->getCom()."\n".$consignment->AddressLine1()."\n".$consignment->getAddressLine2()."\n".$consignment->getCity()."\n".$consignment->getCountry(),1,'L'); $this->Ln(1); Now When I add this line to the code just before $this->Ln(1) $this->Cell(33,7,"test 4",'L'); It goes to a new line for some reason even before i call the $this->Ln(). Any ideas? I want to display the "test4" in the same row too. So i guess my question basically is that i dont understand how fpdf distinguishes between when to switch to a new row and when to keep on adding to the same row. Thank you very much for your help. I would like to create a page in pdf format and I found it possible by using fpdf, but how would I create a page that looks something like this: 1 Flathead nails 3/4" 1,170.00KG @ 60.00 70,200.00 2 Drip edge using plain G.I sheet 3,304.00PCS @ 80.00 264,320.00 4" x 8" x Ga. #24 including cutting and bending (as per drawing). requirements : 472 sheets 1 sheet = 7 pieces 3 Wall flashing using plain G.I sheet 712.00PCS @ 70.00 49,840.00 4" x 8" x Ga. #24 including cutting and bending (as per drawing) requirements : 89 sheets 1 sheet = 8 pieces ********************* NOTHING FOLLOWS ********************* I really need something like this that shows no border because borders are already pre printed. Before posting here I googled it first And found a code that would possibly create my concern but I found some problem of the code and I need some help to make this working. Existing code: Code: [Select] <?php require('fpdf/fpdf.php'); $pdf = new FPDF(); $pdf->AddFont('Bookman','','Bookos.php'); $pdf->AddPage(); $pdf->SetFont('Bookman','',14); $x=16; $y=26; $width=30; $height=35; $leftmargin=16; $content = "content"; //$content = "This is a very long content, this must goes to the next line. "; for ($r=0;$r<5;$r++){ for ($c=0;$c<6;$c++){ $pdf->SetY($y); //set pointer back to previous values $pdf->SetX($x); $x=$pdf->GetX()+$width; $y=$pdf->GetY(); $pdf->MultiCell($width,$height,$content,1,'L'); } $y+=$height; $x=$leftmargin; $pdf->SetY($y); } $pdf->Output(); ?> There are two problems with this code: 1.) Only the first page is working well. 2.) It will not create a newline in each cell if the content is long.... Tnx in advance to everyone..... pls..... Hello,
I am trying to print the invoice in pdf, using fpdf. i am not getting how to do it. I am able to display line items , but its not in proper format. I tried changing X, Y positions, but its not going into my head . Also i want to display Logo and address in left side, invoice number and order date in right side.
Here is the code i have done so far... Please please help me in this
<?php require('includes/fpdf/fpdf.php'); //Connect to your database include("connect/DB_Connect.php"); $id = $_GET['id']; //Select the Products you want to show in your PDF file $result=mysql_query("select invoice_no, order_no, order_date, completion_date, artwork, customer_po, order_quantity, comments, order_amount from invoice where invoice_no='".$id."' ") or die(mysql_error()); $number_of_products = mysql_numrows($result); //Initialize the 3 columns and the total $column_order_date = ""; $column_order_no = ""; $column_artwork = ""; $column_cpo = ""; $column_order_quantity = ""; $column_order_amount = ""; $column_comments = ""; $total = 0; //For each row, add the field to the corresponding column while($row = mysql_fetch_array($result)) { $order_date = $row["order_date"]; $order_no = $row["order_no"]; $artwork = $row['artwork']; $cpo = $row['customer_po']; $oquantity = $row['order_quantity']; $oamount = $row['order_amount']; $comments = $row['comments']; //$price_to_show = number_format($row["Price"],',','.','.'); $column_order_date = $column_order_date.$order_date."\n"; $column_order_no = $column_order_no.$order_no."\n"; $column_artwork = $column_artwork.$artwork."\n"; $column_cpo = $column_cpo.$cpo."\n"; $column_order_quantity = $column_order_quantity.$oquantity."\n"; $column_order_amount = $column_order_amount.$oamount."\n"; $column_comments = $column_comments.$comments."\n"; //Sum all the Prices (TOTAL) $total = $total+$oamount; } mysql_close(); //Create a new PDF file $pdf=new FPDF(); $pdf->AddPage(); //Fields Name position $Y_Fields_Name_position = 20; //Table position, under Fields Name $Y_Table_Position = 26; //First create each Field Name //Gray color filling each Field Name box $pdf->SetFillColor(232,232,232); //Bold Font for Field Name $pdf->SetFont('Arial','B',12); $pdf->SetY($Y_Fields_Name_position); $pdf->SetX(5); $pdf->Cell(25,6,'Order Date',1,0,'L',1); $pdf->SetX(30); $pdf->Cell(50,6,'Graphixide Order No',1,0,'L',1); $pdf->SetX(75); $pdf->Cell(40,6,'Artwork',1,0,'L',1); $pdf->SetX(110); $pdf->Cell(20,6,'PO #',1,0,'L',1); $pdf->SetX(130); $pdf->Cell(20,6,'Quantity',1,0,'L',1); $pdf->SetX(150); $pdf->Cell(25,6,'Amount',1,0,'L',1); $pdf->SetX(175); $pdf->Cell(25,6,'Comments',1,0,'L',1); //Now show the 3 columns $pdf->SetFont('Arial','',12); $pdf->SetY($Y_Table_Position); $pdf->SetX(5); $pdf->MultiCell(25,6,$column_order_date,1); $pdf->SetY($Y_Table_Position); $pdf->SetX(30); $pdf->MultiCell(80,6,$column_order_no,1); $pdf->SetY($Y_Table_Position); $pdf->SetX(75); $pdf->MultiCell(40,6,$column_artwork,1); $pdf->SetY($Y_Table_Position); $pdf->SetX(110); $pdf->MultiCell(20,9,$column_cpo,1); $pdf->SetY($Y_Table_Position); $pdf->SetX(130); $pdf->MultiCell(20,6,$column_order_quantity,1); $pdf->SetY($Y_Table_Position); $pdf->SetX(150); $pdf->MultiCell(75,6,$column_order_amount,1); $pdf->SetY($Y_Table_Position); $pdf->SetX(175); $pdf->MultiCell(25,10,$column_comments,1); $pdf->SetY($Y_Table_Position); $pdf->SetX(150); $pdf->MultiCell(130,6,'$ '.$total,1,'R'); //Create lines (boxes) for each ROW (Product) //If you don't use the following code, you don't create the lines separating each row $i = 0; while ($i < $number_of_products) { $pdf->SetX(45); $pdf->MultiCell(120,6,'',1); $i = $i +1; } $pdf->Output(); ?>Here is the output of this code ss.PNG 32.3KB 7 downloads Fatal error: Uncaught Error: Call to undefined method FPDF::TextWithRotation() in C:\laragon\www\arx\fpdf\rot.php:8 Stack trace: #0 {main} thrown in C:\laragon\www\arx\fpdf\rot.php on line 8 this issue is coming in my file don't knw i want to rotate my text in pdf
<?php require('rpdf.php');
$pdf=new FPDF();
$pdf->AddPage(); $pdf->SetFont('Arial','',40); $pdf->TextWithRotation(50,65,'Hello',45,-45); $pdf->SetFontSize(30); $pdf->TextWithDirection(110,50,'world!','L'); $pdf->TextWithDirection(110,50,'world!','U'); $pdf->TextWithDirection(110,50,'world!','R'); $pdf->TextWithDirection(110,50,'world!','D'); $pdf->Output(); ?>
please help me Edited August 11, 2020 by Ali9980Hi I am using the Quote fpdf library to generate a PDF. What I'm looking to do, is to possibly 'nest' cells inside another cell. Code: [Select] ============================ | Main Cell | | ============= =========== | | Cell 2 | | Cell 3 | | ============= =========== | | ============================ So you can see I have one, main cell, and inside this I have Cell 2 and Cell 3, which I'd like inside/nested the main cell. Is this possible using the fpdf library? Thanks Hello freaks, I am using the FPDF class to generate PDF's on the fly, and I needed a way to generate multiline (flowing) text with specific widths. I found this FPDF extension function from FPDF's website, but can't seem to call it properly. I recieve an undefined function error! The function with in my script is as follows: Code: [Select] <?php include_once "fpdf16/fpdf.php"; class PDF extends FPDF { function WordWrap(&$text, $maxwidth) { $text = trim($text); if ($text==='') return 0; $space = $this->GetStringWidth(' '); $lines = explode("\n", $text); $text = ''; $count = 0; foreach ($lines as $line) { $words = preg_split('/ +/', $line); $width = 0; foreach ($words as $word) { $wordwidth = $this->GetStringWidth($word); if ($wordwidth > $maxwidth) { // Word is too long, we cut it for($i=0; $i<strlen($word); $i++) { $wordwidth = $this->GetStringWidth(substr($word, $i, 1)); if($width + $wordwidth <= $maxwidth) { $width += $wordwidth; $text .= substr($word, $i, 1); } else { $width = $wordwidth; $text = rtrim($text)."\n".substr($word, $i, 1); $count++; } } } elseif($width + $wordwidth <= $maxwidth) { $width += $wordwidth + $space; $text .= $word.' '; } else { $width = $wordwidth + $space; $text = rtrim($text)."\n".$word.' '; $count++; } } $text = rtrim($text)."\n"; $count++; } $text = rtrim($text); return $count; } } ?> My call to this function with in my script is as follows: Code: [Select] <?php $text = $useDesc1; $pdf -> WordWrap($text, $useDescTextWidth); $pdf -> Write(10, $text); ?> Does anyone have a reccommendations as to why this is happening? Thanks in advance. Hi, With my attendance system I generated one fpdf link to generate pdf file. What if I have 50 staff members, Its hard to open the 50 pdf files separately. Is there a away to merge them all in one big pdf file? Edited April 3, 2020 by ramiwahdantypo error Does anyone knows if FPDF supports Norwegian letters or not? When I write codes of letters it is not showing letter. Are there any command to specify charset? For example in this code is it possible to specify charset? $pdf=new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','',14); $pdf->Write(5,'Følgende '); This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=357112.0 hi, i'm using the fpdf library to generate PDF's from form input. It all worked well on my local host, but now that i have transferred to a web server it displays the following error when trying to generate a PDF. Warning: require(/fpdf16/fpdf.php) [function.require]: failed to open stream: No such file or directory in /home/ddgq0o2n/public_html/quote_builder/pdf.php on line 2 Fatal error: require() [function.require]: Failed opening required '/fpdf16/fpdf.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ddgq0o2n/public_html/quote_builder/pdf.php on line 2 i have searched for "include_path", but can't find it anywhere. i'm thinking it's a server problem, where the library may not be compatible or something needs to be switched on, as it worked fine on my local host. any help and suggestions welcome thanks.
I have used this program for many years without problems. I have not altered the file in any way, so why is this happening? Is it to do with PHP upgrade?😖 Here is the file: <?php include("connect_Verses4Cards.php"); $conn=get_db_conn_verse(); session_start(); $display_block =""; $color=""; $r =""; $g =""; $b =""; $image =""; //Get the Card Variables $Get_Size_sql = "SELECT * FROM `CSize` WHERE `Size` ='".$_POST["CSize"]."'"; $Get_Size_res = mysqli_query($conn, $Get_Size_sql) or die(mysqli_error($conn)); if (mysqli_num_rows($Get_Size_res) < 1) { //this Card does not exist $display_block = "You have selected an invalid Card size. Please try again."; } else { //get the print variables while ($Size_info = mysqli_fetch_array($Get_Size_res)) { $BoxX = stripslashes($Size_info['BoxX']); $Cellw = stripslashes($Size_info['Cellw']); $Cellh = stripslashes($Size_info['Cellh']); $SizeI = stripslashes($Size_info['Size']); $SID = stripslashes($Size_info['SID']); $floatx = stripslashes($Size_info['floatx']); $floaty = stripslashes($Size_info['floaty']); $floatw = stripslashes($Size_info['floatw']); $floath = stripslashes($Size_info['floath']); $ort = stripslashes($Size_info['ort']); } //create the display string $display_block = "$ort"; } //verify the Event exists //$the_id = mysqli_real_escape_string($mysqli, $_SESSION[VID]); $Get_Verse_sql = "SELECT id, Event, Sub_Type, Verse FROM verses WHERE id='".$_SESSION['Test']."'"; $Get_Verse_res = mysqli_query($conn, $Get_Verse_sql) or die(mysqli_error($conn)); if (mysqli_num_rows($Get_Verse_res) < 1) { //this Event does not exist $display_block = "You have selected an invalid Event. Please try again."; } else { //get the Event ID while ($Verse_info = mysqli_fetch_array($Get_Verse_res)) { $Verse = stripslashes($Verse_info['Verse']); } //create the display string $display_block = "$Verse"; //free results mysqli_free_result($Get_Verse_res); mysqli_free_result($Get_Size_res); //close connection to MySQL } mysqli_close($conn); require('fpdf.php'); class PDF extends FPDF { var $B; var $I; var $U; var $HREF; function PDF($orientation='P', $unit='mm', $size='A4') { // Call parent constructor $this->FPDF($orientation,$unit,$size); // Initialization $this->B = 0; $this->I = 0; $this->U = 0; $this->HREF = ''; } function SetStyle($tag, $enable) { // Modify style and select corresponding font $this->$tag += ($enable ? 1 : -1); $style = ''; foreach(array('B', 'I', 'U') as $s) { if($this->$s>0) $style .= $s; } $this->SetFont('',$style); } } $color = $_POST['color']; $r = substr($color,0,3); $g = substr($color,3,3); $b = substr($color,6,3); $image=$_POST['image']; $pdf = new PDF($ort,'mm','A4'); $pdf->AddPage(); $pdf->AddFont('French Script MT','','/frscript.php'); $pdf->AddFont('Batavia','','Batavia_.php'); $pdf->AddFont('Algerian','','Alger.php'); $pdf->AddFont('Bladerunner','','BLADRMF_.php'); $pdf->AddFont('Brush Script','','BRUSHSCI.php'); $pdf->AddFont('Helterskelter','','Helte___.php'); $pdf->AddFont('Justice','','Justice_.php'); $pdf->AddFont('Magneto','','MAGNETOB.php'); $pdf->AddFont('Old English','','OldEngl.php'); $pdf->AddFont('Sneakerhead Outline','','Sneabo__.php'); $pdf->AddFont('Trendy','','Trendy__.php'); $pdf->AddFont('Vladimir Script','','VLADIMIR.php'); $pdf->SetLeftMargin('float0'); $pdf->SetTextColor($r,$g,$b); $pdf->SetFont($_POST['fontface'],'',$_POST['font']); $pdf->SetXY($BoxX, $_POST['Top']); $pdf->Image($image,$floatx,$floaty,$floatw,$floath,'',''); $pdf->MultiCell($Cellw,$Cellh,$display_block,'' ,'C'); //$pdf->SetDisplayMode('fullpage',''); $pdf->SetFont(''); $pdf->Output('verse.pdf','D'); //end: ?>
I'm using FPDF to generate dynamic reports. How can I make sure MySQL queried results don't overflow into adjacent cells if the text length is longer then the cells designated width? I once accomplished this by using CSS with white-space:nowrap and overflow:hidden. But I can't think of how to do this with FPDF. Any ideas?? Hi, I'm creating a PDF document using the FPDF library. All is fine, using a sample image that came with the library. However, I need to get the data for the PDF from a database. The data's fine - the query is performed and the data prints out as I need. However, there's one line which takes a value which is a filepath. When I put that into the following line, I get an error from FPDF: Code: $this->Image($row['imgpath'],10,10,190); Error produced: FPDF error: Image file has no extension and no type was specified: However, if I print out the value of $row['imgpath'] and manually insert it into the code as follows, it works fine: Code: $this->Image('../assets/images/products/5777A.jpg',10,10,190); I've come across this problem once before but can't for the life of me remember what the solution was. It was something to do with how I was reading the value into the code, I think. Can anyone jog my memory, please?? |