• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP px2mm函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中px2mm函数的典型用法代码示例。如果您正苦于以下问题:PHP px2mm函数的具体用法?PHP px2mm怎么用?PHP px2mm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: OpenTag

 function OpenTag($tag, $attr)
 {
     //Opening tag
     switch ($tag) {
         case 'STRONG':
             $this->SetStyle('B', true);
             break;
         case 'EM':
             $this->SetStyle('I', true);
             break;
         case 'B':
         case 'I':
         case 'U':
             $this->SetStyle($tag, true);
             break;
         case 'A':
             $this->HREF = $attr['HREF'];
             break;
         case 'IMG':
             if (isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) {
                 if (!isset($attr['WIDTH'])) {
                     $attr['WIDTH'] = 0;
                 }
                 if (!isset($attr['HEIGHT'])) {
                     $attr['HEIGHT'] = 0;
                 }
                 $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT']));
             }
             break;
         case 'TR':
         case 'BLOCKQUOTE':
         case 'BR':
             $this->Ln(5);
             break;
         case 'P':
             $this->Ln(10);
             break;
         case 'FONT':
             if (isset($attr['COLOR']) && $attr['COLOR'] != '') {
                 $coul = hex2dec($attr['COLOR']);
                 $this->SetTextColor($coul['R'], $coul['V'], $coul['B']);
                 $this->issetcolor = true;
             }
             if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) {
                 $this->SetFont(strtolower($attr['FACE']));
                 $this->issetfont = true;
             }
             break;
     }
 }
开发者ID:prashantsinalkar,项目名称:cfd_d7_custom_module,代码行数:50,代码来源:html2pdf.php


示例2: OpenTag

 function OpenTag($tag, $attr)
 {
     //Opening tag
     switch ($tag) {
         case 'SUP':
             if (!empty($attr['SUP'])) {
                 //Set current font to 6pt
                 $this->SetFont('', '', 6);
                 //Start 125cm plus width of cell to the right of left margin
                 //Superscript "1"
                 $this->Cell(2, 2, $attr['SUP'], 0, 0, 'L');
             }
             break;
         case 'TABLE':
             // TABLE-BEGIN
             if (!empty($attr['BORDER'])) {
                 $this->tableborder = $attr['BORDER'];
             } else {
                 $this->tableborder = 0;
             }
             break;
         case 'TR':
             //TR-BEGIN
             break;
         case 'TD':
             // TD-BEGIN
             if (!empty($attr['WIDTH'])) {
                 $this->tdwidth = $attr['WIDTH'] / 4;
             } else {
                 $this->tdwidth = 40;
             }
             // Set to your own width if you need bigger fixed cells
             if (!empty($attr['HEIGHT'])) {
                 $this->tdheight = $attr['HEIGHT'] / 6;
             } else {
                 $this->tdheight = 6;
             }
             // Set to your own height if you need bigger fixed cells
             if (!empty($attr['ALIGN'])) {
                 $align = $attr['ALIGN'];
                 if ($align == 'LEFT') {
                     $this->tdalign = 'L';
                 }
                 if ($align == 'CENTER') {
                     $this->tdalign = 'C';
                 }
                 if ($align == 'RIGHT') {
                     $this->tdalign = 'R';
                 }
             } else {
                 $this->tdalign = 'L';
             }
             // Set to your own
             if (!empty($attr['BGCOLOR'])) {
                 $coul = hex2dec($attr['BGCOLOR']);
                 $this->SetFillColor($coul['R'], $coul['G'], $coul['B']);
                 $this->tdbgcolor = true;
             }
             $this->tdbegin = true;
             break;
         case 'HR':
             if (!empty($attr['WIDTH'])) {
                 $Width = $attr['WIDTH'];
             } else {
                 $Width = $this->w - $this->lMargin - $this->rMargin;
             }
             $x = $this->GetX();
             $y = $this->GetY();
             $this->SetLineWidth(0.2);
             $this->Line($x, $y, $x + $Width, $y);
             $this->SetLineWidth(0.2);
             $this->Ln(1);
             break;
         case 'STRONG':
             $this->SetStyle('B', true);
             break;
         case 'EM':
             $this->SetStyle('I', true);
             break;
         case 'B':
         case 'I':
         case 'U':
             $this->SetStyle($tag, true);
             break;
         case 'A':
             $this->HREF = $attr['HREF'];
             break;
         case 'IMG':
             if (isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) {
                 if (!isset($attr['WIDTH'])) {
                     $attr['WIDTH'] = 0;
                 }
                 if (!isset($attr['HEIGHT'])) {
                     $attr['HEIGHT'] = 0;
                 }
                 $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT']));
             }
             break;
         case 'BLOCKQUOTE':
         case 'BR':
//.........这里部分代码省略.........
开发者ID:jkulam,项目名称:myMadixREP,代码行数:101,代码来源:mc_table.php


示例3: OpenTag

 function OpenTag($tag, $attr)
 {
     //Opening tag
     switch ($tag) {
         case 'STRONG':
         case 'B':
             if ($this->bi) {
                 $this->SetStyle('B', true);
             } else {
                 $this->SetStyle('U', true);
             }
             break;
         case 'H1':
             $this->Ln(5);
             $this->SetTextColor(150, 0, 0);
             $this->SetFontSize(22);
             break;
         case 'H2':
             $this->Ln(5);
             $this->SetFontSize(18);
             $this->SetStyle('U', true);
             break;
         case 'H3':
             $this->Ln(5);
             $this->SetFontSize(16);
             $this->SetStyle('U', true);
             break;
         case 'H4':
             $this->Ln(5);
             $this->SetTextColor(102, 0, 0);
             $this->SetFontSize(14);
             if ($this->bi) {
                 $this->SetStyle('B', true);
             }
             break;
         case 'PRE':
             $this->SetFont('Courier', '', 11);
             $this->SetFontSize(11);
             $this->SetStyle('B', false);
             $this->SetStyle('I', false);
             $this->PRE = true;
             break;
         case 'RED':
             $this->SetTextColor(255, 0, 0);
             break;
         case 'BLOCKQUOTE':
             $this->mySetTextColor(100, 0, 45);
             $this->Ln(3);
             break;
         case 'BLUE':
             $this->SetTextColor(0, 0, 255);
             break;
         case 'I':
         case 'EM':
             if ($this->bi) {
                 $this->SetStyle('I', true);
             }
             break;
         case 'U':
             $this->SetStyle('U', true);
             break;
         case 'A':
             $this->HREF = $attr['HREF'];
             break;
         case 'IMG':
             if (isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) {
                 if (!isset($attr['WIDTH'])) {
                     $attr['WIDTH'] = 0;
                 }
                 if (!isset($attr['HEIGHT'])) {
                     $attr['HEIGHT'] = 0;
                 }
                 $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT']));
                 $this->Ln(3);
             }
             break;
         case 'LI':
             $this->Ln(2);
             $this->SetTextColor(190, 0, 0);
             $this->Write(5, '     » ');
             $this->mySetTextColor(-1);
             break;
         case 'TR':
             $this->Ln(7);
             $this->PutLine();
             break;
         case 'BR':
             $this->Ln(4);
             break;
         case 'P':
             $this->Ln(10);
             $this->SetLeftMargin(60);
             break;
         case 'HR':
             $this->PutLine();
             break;
         case 'FONT':
             if (isset($attr['COLOR']) && $attr['COLOR'] != '') {
                 $coul = hex2dec($attr['COLOR']);
                 $this->mySetTextColor($coul['R'], $coul['G'], $coul['B']);
//.........这里部分代码省略.........
开发者ID:JozefAB,项目名称:neoacu,代码行数:101,代码来源:fpdf.php


示例4: OpenTag

 function OpenTag($tag, $attr)
 {
     // Opening tag
     switch ($tag) {
         case 'STRONG':
             $this->SetStyle('B', true);
             break;
         case 'EM':
             $this->SetStyle('I', true);
             break;
         case 'UL':
             break;
         case 'LI':
             $this->SetFont('Arial', '', 9);
             $this->Ln(1);
             $this->Write(4, "o   ");
             $this->SetLeftMargin($this->lMargin + 5);
             break;
         case 'B':
         case 'I':
         case 'U':
             $this->SetStyle($tag, true);
             break;
         case 'A':
             $this->HREF = $attr['HREF'];
             break;
         case 'IMG':
             if (isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) {
                 if (!isset($attr['WIDTH'])) {
                     $attr['WIDTH'] = 0;
                 }
                 if (!isset($attr['HEIGHT'])) {
                     $attr['HEIGHT'] = 0;
                 }
                 $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT']));
             }
             break;
         case 'TR':
         case 'BLOCKQUOTE':
         case 'BR':
             $this->Ln(5);
             break;
         case 'H1':
             $this->Ln(5);
             $this->SetFont('Arial', 'B', 20);
             break;
         case 'H2':
             $this->Ln(5);
             $this->SetFont('Arial', 'B', 18);
             break;
         case 'H3':
             $this->Ln(5);
             $this->SetFont('Arial', 'B', 16);
             break;
         case 'H4':
             $this->Ln(5);
             $this->SetFont('Arial', 'B', 14);
             break;
         case 'H5':
             $this->Ln(5);
             $this->SetFont('Arial', 'B', 12);
             break;
         case 'H6':
             $this->Ln(5);
             $this->SetFont('Arial', 'B', 10);
             break;
         case 'H7':
             $this->Ln(5);
             $this->SetFont('Arial', 'B', 9);
             break;
         case 'P':
             $this->SetFont('Arial', '', 9);
             $this->Ln(3);
             break;
         case 'FONT':
             if (isset($attr['COLOR']) && $attr['COLOR'] != '') {
                 $coul = hex2dec($attr['COLOR']);
                 $this->SetTextColor($coul['R'], $coul['V'], $coul['B']);
                 $this->issetcolor = true;
             }
             if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) {
                 $this->SetFont(strtolower($attr['FACE']));
                 $this->issetfont = true;
             }
             break;
     }
 }
开发者ID:prodigyworks,项目名称:FA,代码行数:87,代码来源:pdfreport.php


示例5: PutImage

 function PutImage($url, $scale)
 {
     if ($scale < 0) {
         $scale = 0;
     }
     //$scale<=0: put NO image inside the pdf!
     if ($scale > 0) {
         $xsflag = 0;
         $ysflag = 0;
         $yhflag = 0;
         $xscale = 1;
         $yscale = 1;
         //get image info
         $oposy = $this->GetY();
         $url = str_replace(XOOPS_URL, XOOPS_ROOT_PATH, $url);
         $iminfo = @getimagesize($url);
         $iw = $scale * px2mm($iminfo[0]);
         $ih = $scale * px2mm($iminfo[1]);
         $iw = $iw ? $iw : 1;
         $ih = $ih ? $ih : 1;
         $nw = $iw;
         $nh = $ih;
         //resizing in x-direction
         $xsflag = 0;
         if ($iw > 150) {
             $xscale = 150 / $iw;
             $yscale = $xscale;
             $nw = $xscale * $iw;
             $nh = $xscale * $ih;
             $xsflag = 1;
         }
         //now eventually resizing in y-direction
         $ysflag = 0;
         if ($oposy + $nh > 250) {
             $yscale = (250 - $oposy) / $ih;
             $nw = $yscale * $iw;
             $nh = $yscale * $ih;
             $ysflag = 1;
         }
         //uups, if the scaling factor of resized image is < 0.33
         //remark: without(!) the global factor $scale!
         //that's hard -> on the next page please...
         $yhflag = 0;
         if ($yscale < 0.33 and ($xsflag == 1 or $ysflag == 1)) {
             $nw = $xscale * $iw;
             $nh = $xscale * $ih;
             $ysflag == 0;
             $xsflag == 1;
             $yhflag = 1;
         }
         if ($yhflag == 1) {
             $this->AddPage();
         }
         $oposy = $this->GetY();
         $this->Image($url, $this->GetX(), $this->GetY(), $nw, $nh);
         $this->SetY($oposy + $nh);
         if ($yhflag == 0 and $ysflag == 1) {
             $this->AddPage();
         }
     }
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:61,代码来源:makepdf_class.php


示例6: OpenTag

 function OpenTag($tag, $attr)
 {
     //Balise ouvrante
     switch ($tag) {
         case 'STRONG':
             $this->SetStyle('B', true);
             break;
         case 'EM':
             $this->SetStyle('I', true);
             break;
         case 'B':
         case 'I':
         case 'U':
             $this->SetStyle($tag, true);
             break;
         case 'A':
             $this->HREF = $attr['HREF'];
             break;
         case 'IMG':
             if (isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) {
                 if (!isset($attr['WIDTH'])) {
                     $attr['WIDTH'] = 0;
                 }
                 if (!isset($attr['HEIGHT'])) {
                     $attr['HEIGHT'] = 0;
                 }
                 $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT']));
             }
             break;
         case 'TH':
             $this->TH = 'TH';
             //	        	$this->lMargin += 5;
             //	        	$this->SetXY(5, $this->tMargin);
             break;
             //	        	$this->Cell(50,6,$e,1,1,'L');
             //	        	break;
         //	        	$this->Cell(50,6,$e,1,1,'L');
         //	        	break;
         case 'TD':
             $this->TD = 'TD';
             break;
         case 'TR':
             //	        	$y = $this->getY();
             //	        	$this->setY($y+5);
             //	        	$this->setX(10);
             $this->Ln(5);
             //	        	$this->SetXY($this->lMargin, $this->tMargin);
             break;
         case 'BLOCKQUOTE':
         case 'BR':
             $this->Ln(5);
             break;
         case 'P':
             $this->Ln(10);
             break;
         case 'FONT':
             if (isset($attr['COLOR']) && $attr['COLOR'] != '') {
                 $coul = hex2dec($attr['COLOR']);
                 $this->SetTextColor($coul['R'], $coul['V'], $coul['B']);
                 $this->issetcolor = true;
             }
             if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) {
                 $this->SetFont(strtolower($attr['FACE']));
                 $this->issetfont = true;
             }
             break;
     }
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:68,代码来源:pdf_html.class.php


示例7: OpenTag

 function OpenTag($tag, $attr)
 {
     //Opening tag
     switch ($tag) {
         case 'STRONG':
             $this->SetStyle('B', true);
             break;
         case 'EM':
             $this->SetStyle('I', true);
             break;
         case 'B':
         case 'I':
         case 'U':
             $this->SetStyle($tag, true);
             break;
         case 'A':
             $this->HREF = $attr['HREF'];
             break;
         case 'IMG':
             if (isset($attr['SRC']) and (isset($attr['WIDTH']) or isset($attr['HEIGHT']))) {
                 if (!isset($attr['WIDTH'])) {
                     $attr['WIDTH'] = 0;
                 }
                 if (!isset($attr['HEIGHT'])) {
                     $attr['HEIGHT'] = 0;
                 }
                 $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT']));
             }
             break;
         case 'TR':
         case 'BLOCKQUOTE':
         case 'BR':
             $this->Ln(5);
             break;
         case 'P':
             $this->Ln(10);
             break;
         case 'FONT':
             if (isset($attr['COLOR']) and $attr['COLOR'] != '') {
                 $coul = hex2dec($attr['COLOR']);
                 $this->SetTextColor($coul['R'], $coul['G'], $coul['B']);
                 $this->issetcolor = true;
             }
             if (isset($attr['FACE']) and in_array(strtolower($attr['FACE']), $this->fontlist)) {
                 $this->SetFont(strtolower($attr['FACE']));
                 $this->issetfont = true;
             }
             break;
         case 'HR':
             if (isset($attr['WIDTH']) && $attr['WIDTH'] != '') {
                 $Width = $attr['WIDTH'];
             } else {
                 $Width = $this->w - $this->lMargin - $this->rMargin;
             }
             $x = $this->GetX();
             $y = $this->GetY();
             $this->SetDrawColor(200, 200, 200);
             $this->SetLineWidth(0.5);
             $this->Line($x + 5, $y + 5, $x + $Width, $y + 5);
             $this->SetDrawColor(0, 0, 0);
             $this->Ln(8);
             break;
         case 'H2':
             $this->SetFont('Arial', 'B', 18);
             break;
     }
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:67,代码来源:html2pdf.php


示例8: OpenTag


//.........这里部分代码省略.........
         case 'TH':
         case 'TD':
             // TD-BEGIN
             $this->iTD++;
             /*if( !empty($attr['WIDTH']) ) $this->tdwidth=($attr['WIDTH']/4);
             		else $this->setTDdim( 'WIDTH' );
             		if( !empty($attr['HEIGHT']) ) $this->tdheight=($attr['HEIGHT']/6);
             		else $this->setTDdim( 'HEIGHT' );*/
             $this->setTDdim('WIDTH');
             $this->setTDdim('HEIGHT');
             if (!empty($attr['ALIGN'])) {
                 $align = $attr['ALIGN'];
                 if ($align == 'LEFT') {
                     $this->tdalign = 'L';
                 }
                 if ($align == 'CENTER') {
                     $this->tdalign = 'C';
                 }
                 if ($align == 'RIGHT') {
                     $this->tdalign = 'R';
                 }
             } else {
                 $this->tdalign = 'L';
             }
             // Set to your own
             if (!empty($attr['BGCOLOR'])) {
                 $coul = hex2dec($attr['BGCOLOR']);
                 $this->SetFillColor($coul['R'], $coul['G'], $coul['B']);
                 $this->tdbgcolor = true;
             }
             $this->tdbegin = true;
             break;
         case 'HR':
             if (!empty($attr['WIDTH'])) {
                 //$axt=1;
                 $Width = $attr['WIDTH'];
             } else {
                 $Width = $this->w - $this->lMargin - $this->rMargin;
             }
             $x = $this->GetX();
             $y = $this->GetY();
             $this->SetLineWidth(0.2);
             $this->Line($x, $y, $x + $Width, $y);
             $this->SetLineWidth(0.2);
             $this->Ln(1);
             break;
         case 'STRONG':
             $this->SetStyle('B', true);
             break;
         case 'EM':
             $this->SetStyle('I', true);
             break;
         case 'B':
         case 'I':
         case 'U':
             $this->SetStyle($tag, true);
             break;
         case 'A':
             $this->HREF = $attr['HREF'];
             break;
         case 'IMG':
             if (isset($attr['SRC'])) {
                 if (!isset($attr['WIDTH'])) {
                     if ($this->firstPic == 1) {
                         $attr['WIDTH'] = 540;
                         $this->firstPic = 0;
                     } else {
                         $attr['WIDTH'] = 0;
                     }
                 }
                 if (!isset($attr['HEIGHT'])) {
                     $attr['HEIGHT'] = 0;
                 }
                 $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT']));
             }
             break;
         case 'BLOCKQUOTE':
         case 'BR':
             $this->Ln(5);
             break;
         case 'P':
             $this->Ln(10);
             break;
         case 'FONT':
             if (isset($attr['COLOR']) && $attr['COLOR'] != '') {
                 $coul = hex2dec($attr['COLOR']);
                 $this->SetTextColor($coul['R'], $coul['G'], $coul['B']);
                 $this->issetcolor = true;
             }
             if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) {
                 $this->SetFont(strtolower($attr['FACE']));
                 $this->issetfont = true;
             }
             if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist) && isset($attr['SIZE']) && $attr['SIZE'] != '') {
                 $this->SetFont(strtolower($attr['FACE']), '', $attr['SIZE']);
                 $this->issetfont = true;
             }
             break;
     }
 }
开发者ID:angstmann82,项目名称:flybook,代码行数:101,代码来源:html_table_parser.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP px2pt函数代码示例发布时间:2022-05-15
下一篇:
PHP pwg_query函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap