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


PHP Cpdf::addPngFromFile方法代码示例

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


在下文中一共展示了Cpdf::addPngFromFile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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::addPngFromFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。