当前位置: 首页>>代码示例>>PHP>>正文


PHP Cpdf::addJpegFromFile方法代码示例

本文整理汇总了PHP中Cpdf::addJpegFromFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Cpdf::addJpegFromFile方法的具体用法?PHP Cpdf::addJpegFromFile怎么用?PHP Cpdf::addJpegFromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cpdf的用法示例。


在下文中一共展示了Cpdf::addJpegFromFile方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: image

 function image($img, $x, $y, $w, $h, $resolution = "normal")
 {
     list($width, $height, $type) = dompdf_getimagesize($img);
     $debug_png = $this->_dompdf->get_option("debug_png");
     if ($debug_png) {
         print "[image:{$img}|{$width}|{$height}|{$type}]";
     }
     switch ($type) {
         case IMAGETYPE_JPEG:
             if ($debug_png) {
                 print '!!!jpg!!!';
             }
             $this->_pdf->addJpegFromFile($img, $x, $this->y($y) - $h, $w, $h);
             break;
         case IMAGETYPE_GIF:
         case IMAGETYPE_BMP:
             if ($debug_png) {
                 print '!!!bmp or gif!!!';
             }
             // @todo use cache for BMP and GIF
             $img = $this->_convert_gif_bmp_to_png($img, $type);
         case IMAGETYPE_PNG:
             if ($debug_png) {
                 print '!!!png!!!';
             }
             $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h);
             break;
         default:
             if ($debug_png) {
                 print '!!!unknown!!!';
             }
     }
 }
开发者ID:skyosev,项目名称:OpenCart-Overclocked,代码行数:33,代码来源:cpdf_adapter.cls.php

示例2: image

 function image($img_url, $img_type, $x, $y, $w, $h)
 {
     switch ($img_type) {
         case "jpeg":
         case "jpg":
             $this->_pdf->addJpegFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
             break;
         case "png":
             $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
             break;
         default:
             break;
     }
     return;
 }
开发者ID:andrewroth,项目名称:c4c_intranet,代码行数:15,代码来源:cpdf_adapter.cls.php

示例3: image

 function image($img, $x, $y, $w, $h, $resolution = "normal")
 {
     list($width, $height, $type) = $this->getimagesize($img);
     switch ($type) {
         case IMAGETYPE_JPEG:
             $this->canvas->addJpegFromFile($img, $x, $y - $h, $w, $h);
             break;
         case IMAGETYPE_GIF:
         case IMAGETYPE_BMP:
             // @todo use cache for BMP and GIF
             $img = $this->_convert_gif_bmp_to_png($img, $type);
         case IMAGETYPE_PNG:
             $this->canvas->addPngFromFile($img, $x, $y - $h, $w, $h);
             break;
         default:
     }
 }
开发者ID:abdulghanni,项目名称:gsm,代码行数:17,代码来源:SurfaceCpdf.php

示例4: image

 function image($img_url, $img_type, $x, $y, $w, $h)
 {
     $img_type = mb_strtolower($img_type);
     switch ($img_type) {
         case "jpeg":
         case "jpg":
             $this->_pdf->addJpegFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
             break;
         case "png":
             $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
             break;
         case "gif":
             // Convert gifs to pngs
             $img_url = $this->_convert_gif_to_png($img_url);
             $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
             break;
         default:
             break;
     }
     return;
 }
开发者ID:SkMamtajuddin,项目名称:bamboo-invoice,代码行数:21,代码来源:cpdf_adapter.cls.php

示例5: image

 function image($img, $x, $y, $w, $h, $resolution = "normal")
 {
     list($width, $height, $type) = Helpers::dompdf_getimagesize($img, $this->get_dompdf()->getHttpContext());
     $debug_png = $this->_dompdf->getOptions()->getDebugPng();
     if ($debug_png) {
         print "[image:{$img}|{$width}|{$height}|{$type}]";
     }
     switch ($type) {
         case "jpeg":
             if ($debug_png) {
                 print '!!!jpg!!!';
             }
             $this->_pdf->addJpegFromFile($img, $x, $this->y($y) - $h, $w, $h);
             break;
         case "gif":
         case "bmp":
             if ($debug_png) {
                 print '!!!bmp or gif!!!';
             }
             // @todo use cache for BMP and GIF
             $img = $this->_convert_gif_bmp_to_png($img, $type);
         case "png":
             if ($debug_png) {
                 print '!!!png!!!';
             }
             $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h);
             break;
         case "svg":
             if ($debug_png) {
                 print '!!!SVG!!!';
             }
             $this->_pdf->addSvgFromFile($img, $x, $this->y($y) - $h, $w, $h);
             break;
         default:
             if ($debug_png) {
                 print '!!!unknown!!!';
             }
     }
 }
开发者ID:BrunoDeBarros,项目名称:dompdf,代码行数:39,代码来源:CPDF.php

示例6: image

 function image($img_url, $img_type, $x, $y, $w, $h)
 {
     //debugpng
     if (DEBUGPNG) {
         print '[image:' . $img_url . '|' . $img_type . ']';
     }
     $img_type = mb_strtolower($img_type);
     switch ($img_type) {
         case "jpeg":
         case "jpg":
             //debugpng
             if (DEBUGPNG) {
                 print '!!!jpg!!!';
             }
             $this->_pdf->addJpegFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
             break;
         case "png":
             //debugpng
             if (DEBUGPNG) {
                 print '!!!png!!!';
             }
             $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
             break;
         case "gif":
             // Convert gifs to pngs
             //DEBUG_IMG_TEMP
             //if (0) {
             if (method_exists($this->_pdf, "addImagePng")) {
                 //debugpng
                 if (DEBUGPNG) {
                     print '!!!gif addImagePng!!!';
                 }
                 //If optimization to direct png creation from gd object is available,
                 //don't create temp file, but place gd object directly into the pdf
                 if (method_exists($this->_pdf, "image_iscached") && $this->_pdf->image_iscached($img_url)) {
                     //If same image has occured already before, no need to load because
                     //duplicate will anyway be eliminated.
                     $img = null;
                 } else {
                     $img = @imagecreatefromgif($img_url);
                     if (!$img) {
                         return;
                     }
                     imageinterlace($img, 0);
                 }
                 $this->_pdf->addImagePng($img_url, $x, $this->y($y) - $h, $w, $h, $img);
             } else {
                 //debugpng
                 if (DEBUGPNG) {
                     print '!!!gif addPngFromFile!!!';
                 }
                 $img_url = $this->_convert_gif_to_png($img_url);
                 $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
             }
             break;
         default:
             //debugpng
             if (DEBUGPNG) {
                 print '!!!unknown!!!';
             }
             break;
     }
     return;
 }
开发者ID:rifaiaja,项目名称:orpsystem,代码行数:64,代码来源:cpdf_adapter.cls.php

示例7: while

         /*rule off for total */
         $pdf->line($Page_Width - $Right_Margin - 222, $YPos - 2 * $line_height, $Page_Width - $Right_Margin, $YPos - 2 * $line_height);
         /*vertical to separate totals from comments and ROMALPA */
         $pdf->line($Page_Width - $Right_Margin - 222, $YPos + $line_height, $Page_Width - $Right_Margin - 222, $Bottom_Margin);
         $YPos += 10;
         if ($InvOrCredit == 'Invoice') {
             $LeftOvers = $pdf->addTextWrap($Page_Width - $Right_Margin - 220, $Bottom_Margin + 5, 144, $FontSize, _('TOTAL INVOICE'));
             $FontSize = 8;
             $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos - 18, 280, $FontSize, $_SESSION['RomalpaClause']);
             while (mb_strlen($LeftOvers) > 0 and $YPos > $Bottom_Margin) {
                 $YPos -= 10;
                 $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos - 18, 280, $FontSize, $LeftOvers);
             }
             /* Add Images for Visa / Mastercard / Paypal */
             if (file_exists('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg')) {
                 $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg', $Page_Width / 2 - 60, $YPos - 15, 0, 20);
             }
             // Print Bank acount details if available and default for invoices is selected
             $pdf->addText($Left_Margin, $YPos + 22 - $line_height * 3, $FontSize, $DefaultBankAccountCode . '  ' . $DefaultBankAccountNumber);
             $FontSize = 10;
         } else {
             $LeftOvers = $pdf->addTextWrap($Page_Width - $Right_Margin - 220, $Bottom_Margin + 5, 144, $FontSize, _('TOTAL CREDIT'));
         }
         $LeftOvers = $pdf->addTextWrap($Page_Width - $Left_Margin - 72, $Bottom_Margin + 5, 72, $FontSize, $DisplayTotal, 'right');
     }
     /* end of check to see that there was an invoice record to print */
     $FromTransNo++;
 }
 /* end loop to print invoices */
 /* Put the transaction number back as would have been incremented by one after last pass */
 $FromTransNo--;
开发者ID:sjhelios,项目名称:trikemindo,代码行数:31,代码来源:PrintCustTransPortrait.php

示例8: Cezpdf

    #$pdf->setPreferences( "FitWindow", true);
    #$pdf->setPreferences( "CenterWindow",true);
    #$pdf->setPreferences( "NonFullScreenPageMode",True); // UseNone, UseOutlines, UseThumbs
    $unten = 50;
    $links = 20;
    $oben = 820;
    $pdf->addText($links, $oben, 11, 'links oben');
    $pdf->addText($links, $unten, 11, 'links unten');
    $pdf->addText(500, $oben, 11, 'rechts oben');
    $pdf->addText(500, $unten, 11, 'rechts unten');
    $row = $oben;
    for ($i = 1; $i <= 10; $i++) {
        $row = $row - 10;
        $pdf->addText($links, $row, 11, $i . ' drunter');
    }
    $pdf->addJpegFromFile($pathvars["fileroot"] . "/images/net/vdmvd/otto.jpg", 70.86, 420.94, 100);
    $pdf->rectangle($links, $unten, 540, 780);
    /*
    $pdf->newPage();
    $pdf->addText(0,830,'10pt','links oben');
    $pdf->addText(540,830,10,'rechts oben');
    $pdf->addText(0,5,10,'links unten');
    $pdf->addText(540,5,10,'rechts unten');
    */
    $pdf->stream();
} else {
    include_once $pathvars["libraries"] . "xtra.pdf.php";
    include_once $pathvars["libraries"] . "xtra.ezpdf.php";
    $pdf = new Cezpdf();
    $pdf->selectFont('./fonts/Helvetica.afm');
    $pdf->openHere("Fit");
开发者ID:BackupTheBerlios,项目名称:ewebuki-svn,代码行数:31,代码来源:listendruck-testing.inc.php

示例9: image

    function image($img, $x, $y, $w, $h, $resolution = "normal")
    {
        list($width, $height, $type) = dompdf_getimagesize($img);

        //debugpng
        if (DEBUGPNG) print "[image:$img|$width|$height|$type]";

        switch ($type) {
            case IMAGETYPE_JPEG:
                if (DEBUGPNG) print '!!!jpg!!!';
                $this->_pdf->addJpegFromFile($img, $x, $this->y($y) - $h, $w, $h);
                break;

            case IMAGETYPE_GIF:
            case IMAGETYPE_BMP:
                if (DEBUGPNG) print '!!!bmp or gif!!!';
                // @todo use cache for BMP and GIF
                $img = $this->_convert_gif_bmp_to_png($img, $type);

            case IMAGETYPE_PNG:
                if (DEBUGPNG) print '!!!png!!!';

                $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h);
                break;

            default:
                if (DEBUGPNG) print '!!!unknown!!!';
        }
    }
开发者ID:rmuyinda,项目名称:dms-1,代码行数:29,代码来源:cpdf_adapter.cls.php


注:本文中的Cpdf::addJpegFromFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。