Issues related to exporting PDFs

Source: Internet
Author: User
Problems with exporting PDFs
This post was last edited by Zhuhao on 2012-12-31 19:54:16


$id =$_get[' number '];

$uploaddir = ' download/';
$Date = Date ("Ymdhis");
$filenamepdf = $uploaddir. " Label_print ". $Date.". PDF ";



Require_once (' tcpdf/config/lang/eng.php ');
Require_once (' tcpdf/tcpdf.php ');
Include ("conn.php");

$pdf = new TCPDF (' L ', ' mm ', ' business_card_jp ', true, ' UTF-8 ', false);
$pdf->setprintheader (FALSE);
$pdf->setprintfooter (FALSE);
$pdf->setfont (' arialunicid0 ', ', 10);
$pdf->setmargins (1,1,2,false);
$pdf->setfootermargin (1);
$pdf->setautopagebreak (True, 1);


$SQL _hkpdf = "SELECT *, Group_concat ('", Concat_ws (' X ', ' sku ', ' quantity-purchased '), if (' quantity-purchased ') ; 1, ' * * * ', '), Group_concat (', ' order_id ', ') from (SELECT * from ' sale_orders ' ORDER BY ' SKU ') T WHERE ' Shi Pments ' =0 and ' number ' = $id GROUP by ' recipient-name ', ' ship-address-1 ' ORDER by Length (Group_concat (' ", Concat_ws (' X ', ' sku ', ' quantity-purchased '), ') DESC, ' SKU ';


$Result = mysql_query ($Sql _hkpdf);


while ($rs = Mysql_fetch_array ($Result)) {

$ship _address= $rs [' ship-address-1 ']. $rs [' ship-address-2 ']. $rs [' ship-address-3 '];
$sku = $rs ["Group_concat", Concat_ws (' X ', ' sku ', ' quantity-purchased '), if (' quantity-purchased ' > 1, ' * * * * ', ' ') )"];
$ship _postal_code= "〒". $rs [' Ship-postal-code '];

$ship _city= "Japan". $rs [' ship-state ']. " ". $rs [' ship-city '];
$recipient _name= $rs [' Recipient-name ']. "Like";
$buyer _phone_number= "Tel:" $rs [' Buyer-phone-number '];
$hkdizhi = ' From:unit A1, 7/f,cheung Kong Factory Bldg, 6 Cheung Yee Street, Lai Chi Kok, Hong Kong ';
$pdf->addpage ();
$pdf->setfont (' arialunicid0 ', ', 8);
$pdf->write (0, $sku, ', 0, ' R ', True, 0, False, False, 0);
$yy = $pdf->gety ();
$xx = $pdf->getx ();
$style = Array (' width ' = + 0.2, ' cap ' = ' butt ', ' join ' = ' miter ', ' dash ' = = 0, ' color ' = = Array (0, 0, 0));
$pdf->line (2, $yy +0.3, $yy +0.3, $style);
$pdf->setfont (' arialunicid0 ', ', 10);
$pdf->write (0, $ship _postal_code, ', 0, ' L ', True, 0, False, False, 0);
$pdf->write (0, "\ n", "', 0, ' L ', True, 0, False, False, 0);
$pdf->write (0, $ship _city, ', 0, ' L ', True, 0, False, False, 0);
$pdf->write (0, $ship _address, ', 0, ' L ', True, 0, False, False, 0);
$pdf->write (0, "\ n", "', 0, ' L ', True, 0, False, False, 0);
$pdf->setfont (' arialunicid0 ', ', 12);
$pdf->write (0, $recipient _name, ', 0, ' C ', True, 0, False, False, 0);
$pdf->setfont (' arialunicid0 ', ', 10);
$pdf->write (0, $buyer _phone_number, ', 0, ' C ', True, 0, False, False, 0);
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.