找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 6250|回复: 12

[radius] 预付卡.打印 中文服务名称乱码

[复制链接]
发表于 2013-4-7 16:29:30 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
QQ截图20130407041819.png
看了下radiusmanager\system_cfg.php
129  define("srvname_font_type", "Arial");
发现整个LINUX没有ARIAL这个字体.
也尝试安装其他字体 修改后发现找不到字体...
求解决PDF中文的乱码
另外  整个Radius Manage 的源码是加密的...  

补充内容 (2013-4-27 06:32):
详情见http://bbs.routerclub.com/forum. ... 1&fromuid=60415
routeros
发表于 2013-4-9 23:18:42 | 显示全部楼层
您用的那个版本的rm呢?

点评

4.04,3.9 都有这样的问题  发表于 2013-4-11 03:51
routeros
回复

使用道具 举报

发表于 2013-4-10 10:47:49 | 显示全部楼层

,

本帖最后由 兰彻 于 2013-4-10 11:24 编辑

我也遇到这样的问题的,尝试当官网下载新的语言包,结果没有用,应该还是字体问题,不过你卡片设计的不错,你可以在卡片上直接设计中文,自动生产的卡片就不要服务名这个函数了。你把用户名和密码都改成中文了。不要服务名就是了,解密倒是很简单的事情,网上工具一把,我已经解密了,但是解密的文件可以读,但是运行不了,应该还有些什么验证机制。毕竟是商业化的东西,如何用户·比较多,还是支持下正版,到官方要技术支持。

点评

DeZender_DeIoncuber解密不行啊 没有完全解密.我看了下解密的代码 判断条件那边都是空的.只能说是解密失败.不能完全解密.  发表于 2013-4-30 18:42
好想法...也希望你能提供下解密后的源码.我主要是看下他用的是那个PDF类.然后去添加响应的PDF字体类就可以了.  发表于 2013-4-11 03:54
routeros
回复

使用道具 举报

发表于 2013-4-11 20:33:29 | 显示全部楼层

DeZender_DeIoncuber,用这个工具就可以解密了,解出来的可以读,但是学艺不精,看不懂。期待大哥搞出来,和大家分享一下
routeros
回复

使用道具 举报

发表于 2013-4-12 13:04:33 | 显示全部楼层
<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

class fpdf
{

    public function fpdf( $orientation = "P", $unit = "mm", $format = "A4" )
    {
        $this->_dochecks( );
        $this->page = 0;
        $this->n = 2;
        $this->buffer = "";
        $this->pages = array( );
        $this->PageSizes = array( );
        $this->state = 0;
        $this->fonts = array( );
        $this->FontFiles = array( );
        $this->diffs = array( );
        $this->images = array( );
        $this->links = array( );
        $this->InHeader = false;
        $this->InFooter = false;
        $this->lasth = 0;
        $this->FontFamily = "";
        $this->FontStyle = "";
        $this->FontSizePt = 12;
        $this->underline = false;
        $this->DrawColor = "0 G";
        $this->FillColor = "0 g";
        $this->TextColor = "0 g";
        $this->ColorFlag = false;
        $this->ws = 0;
        $this->CoreFonts = array( "courier" => "Courier", "courierB" => "Courier-Bold", "courierI" => "Courier-Oblique", "courierBI" => "Courier-BoldOblique", "helvetica" => "Helvetica", "helveticaB" => "Helvetica-Bold", "helveticaI" => "Helvetica-Oblique", "helveticaBI" => "Helvetica-BoldOblique", "times" => "Times-Roman", "timesB" => "Times-Bold", "timesI" => "Times-Italic", "timesBI" => "Times-BoldItalic", "symbol" => "Symbol", "zapfdingbats" => "ZapfDingbats" );
        if ( $unit == "pt" )
        {
            $this->k = 1;
        }
        else if ( $unit == "mm" )
        {
            $this->k = 72 / 25.4;
        }
        else if ( $unit == "cm" )
        {
            $this->k = 72 / 2.54;
        }
        else if ( $unit == "in" )
        {
            $this->k = 72;
        }
        else
        {
            $this->Error( "Incorrect unit: ".$unit );
        }
        $this->PageFormats = array(
            "a3" => array( 841.89, 1190.55 ),
            "a4" => array( 595.28, 841.89 ),
            "a5" => array( 420.94, 595.28 ),
            "letter" => array( 612, 792 ),
            "legal" => array( 612, 1008 )
        );
        if ( ( $format ) )
        {
            $format = $this->_getpageformat( $format );
        }
        $this->DefPageFormat = $format;
        $this->CurPageFormat = $format;
        $orientation = ( $orientation );
        if ( $orientation == "p" || $orientation == "portrait" )
        {
            $this->DefOrientation = "P";
            $this->w = $this->DefPageFormat[0];
            $this->h = $this->DefPageFormat[1];
        }
        else if ( $orientation == "l" || $orientation == "landscape" )
        {
            $this->DefOrientation = "L";
            $this->w = $this->DefPageFormat[1];
            $this->h = $this->DefPageFormat[0];
        }
        else
        {
            $this->Error( "Incorrect orientation: ".$orientation );
        }
        $this->CurOrientation = $this->DefOrientation;
        $this->wPt = $this->w * $this->k;
        $this->hPt = $this->h * $this->k;
        $margin = 28.35 / $this->k;
        $this->SetMargins( $margin, $margin );
        $this->cMargin = $margin / 10;
        $this->LineWidth = 0.567 / $this->k;
        $this->SetAutoPageBreak( true, 2 * $margin );
        $this->SetDisplayMode( "fullwidth" );
        $this->SetCompression( true );
        $this->PDFVersion = "1.3";
    }

    public function setmargins( $left, $top, $right = null )
    {
        $this->lMargin = $left;
        $this->tMargin = $top;
        if ( $right === null )
        {
            $right = $left;
        }
        $this->rMargin = $right;
    }

    public function setleftmargin( $margin )
    {
        $this->lMargin = $margin;
        if ( 0 < $this->page && $this->x < $margin )
        {
            $this->x = $margin;
        }
    }

    public function settopmargin( $margin )
    {
        $this->tMargin = $margin;
    }

    public function setrightmargin( $margin )
    {
        $this->rMargin = $margin;
    }

    public function setautopagebreak( $auto, $margin = 0 )
    {
        $this->AutoPageBreak = $auto;
        $this->bMargin = $margin;
        $this->PageBreakTrigger = $this->h - $margin;
    }

    public function setdisplaymode( $zoom, $layout = "continuous" )
    {
        if ( $zoom == "fullpage" || $zoom == "fullwidth" || $zoom == "real" || $zoom == "default" || !( $zoom ) )
        {
            $this->ZoomMode = $zoom;
        }
        else
        {
            $this->Error( "Incorrect zoom display mode: ".$zoom );
        }
        if ( $layout == "single" || $layout == "continuous" || $layout == "two" || $layout == "default" )
        {
            $this->LayoutMode = $layout;
        }
        else
        {
            $this->Error( "Incorrect layout display mode: ".$layout );
        }
    }

    public function setcompression( $compress )
    {
        if ( ( "gzcompress" ) )
        {
            $this->compress = $compress;
        }
        else
        {
            $this->compress = false;
        }
    }

    public function settitle( $title, $isUTF8 = false )
    {
        if ( $isUTF8 )
        {
            $title = $this->_UTF8toUTF16( $title );
        }
        $this->title = $title;
    }

    public function setsubject( $subject, $isUTF8 = false )
    {
        if ( $isUTF8 )
        {
            $subject = $this->_UTF8toUTF16( $subject );
        }
        $this->subject = $subject;
    }

    public function setauthor( $author, $isUTF8 = false )
    {
        if ( $isUTF8 )
        {
            $author = $this->_UTF8toUTF16( $author );
        }
        $this->author = $author;
    }

    public function setkeywords( $keywords, $isUTF8 = false )
    {
        if ( $isUTF8 )
        {
            $keywords = $this->_UTF8toUTF16( $keywords );
        }
        $this->keywords = $keywords;
    }

    public function setcreator( $creator, $isUTF8 = false )
    {
        if ( $isUTF8 )
        {
            $creator = $this->_UTF8toUTF16( $creator );
        }
        $this->creator = $creator;
    }

    public function aliasnbpages( $alias = "{nb}" )
    {
        $this->AliasNbPages = $alias;
    }

    public function error( $msg )
    {
        exit( "<b>FPDF error:</b> ".$msg );
    }

    public function open( )
    {
        $this->state = 1;
    }

    public function close( )
    {
        if ( $this->state == 3 )
        {
            return;
        }
        if ( $this->page == 0 )
        {
            $this->AddPage( );
        }
        $this->InFooter = true;
        $this->Footer( );
        $this->InFooter = false;
        $this->_endpage( );
        $this->_enddoc( );
    }

    public function addpage( $orientation = "", $format = "" )
    {
        if ( $this->state == 0 )
        {
            $this->Open( );
        }
        $family = $this->FontFamily;
        $style = $this->FontStyle.( $this->underline ? "U" : "" );
        $size = $this->FontSizePt;
        $lw = $this->LineWidth;
        $dc = $this->DrawColor;
        $fc = $this->FillColor;
        $tc = $this->TextColor;
        $cf = $this->ColorFlag;
        if ( 0 < $this->page )
        {
            $this->InFooter = true;
            $this->Footer( );
            $this->InFooter = false;
            $this->_endpage( );
        }
        $this->_beginpage( $orientation, $format );
        $this->_out( "2 J" );
        $this->LineWidth = $lw;
        $this->_out( ( "%.2F w", $lw * $this->k ) );
        if ( $family )
        {
            $this->SetFont( $family, $style, $size );
        }
        $this->DrawColor = $dc;
        if ( $dc != "0 G" )
        {
            $this->_out( $dc );
        }
        $this->FillColor = $fc;
        if ( $fc != "0 g" )
        {
            $this->_out( $fc );
        }
        $this->TextColor = $tc;
        $this->ColorFlag = $cf;
        $this->InHeader = true;
        $this->Header( );
        $this->InHeader = false;
        if ( $this->LineWidth != $lw )
        {
            $this->LineWidth = $lw;
            $this->_out( ( "%.2F w", $lw * $this->k ) );
        }
        if ( $family )
        {
            $this->SetFont( $family, $style, $size );
        }
        if ( $this->DrawColor != $dc )
        {
            $this->DrawColor = $dc;
            $this->_out( $dc );
        }
        if ( $this->FillColor != $fc )
        {
            $this->FillColor = $fc;
            $this->_out( $fc );
        }
        $this->TextColor = $tc;
        $this->ColorFlag = $cf;
    }

    public function header( )
    {
    }

    public function footer( )
    {
    }

    public function pageno( )
    {
        return $this->page;
    }

    public function setdrawcolor( $r, $g = null, $b = null )
    {
        if ( $r == 0 && $g == 0 && $b == 0 || $g === null )
        {
            $this->DrawColor = ( "%.3F G", $r / 255 );
        }
        else
        {
            $this->DrawColor = ( "%.3F %.3F %.3F RG", $r / 255, $g / 255, $b / 255 );
        }
        if ( 0 < $this->page )
        {
            $this->_out( $this->DrawColor );
        }
    }

    public function setfillcolor( $r, $g = null, $b = null )
    {
        if ( $r == 0 && $g == 0 && $b == 0 || $g === null )
        {
            $this->FillColor = ( "%.3F g", $r / 255 );
        }
        else
        {
            $this->FillColor = ( "%.3F %.3F %.3F rg", $r / 255, $g / 255, $b / 255 );
        }
        $this->ColorFlag = $this->FillColor != $this->TextColor;
        if ( 0 < $this->page )
        {
            $this->_out( $this->FillColor );
        }
    }

    public function settextcolor( $r, $g = null, $b = null )
    {
        if ( $r == 0 && $g == 0 && $b == 0 || $g === null )
        {
            $this->TextColor = ( "%.3F g", $r / 255 );
        }
        else
        {
            $this->TextColor = ( "%.3F %.3F %.3F rg", $r / 255, $g / 255, $b / 255 );
        }
        $this->ColorFlag = $this->FillColor != $this->TextColor;
    }

    public function getstringwidth( $s )
    {
        $s = ( string )$s;
        $cw =& $this->CurrentFont['cw'];
        $w = 0;
        $l = ( $s );
        $i = 0;
        while ( $i < $l )
        {
            $w += $cw[$s[$i]];
            ++$i;
        }
        return $w * $this->FontSize / 1000;
    }

    public function setlinewidth( $width )
    {
        $this->LineWidth = $width;
        if ( 0 < $this->page )
        {
            $this->_out( ( "%.2F w", $width * $this->k ) );
        }
    }

    public function line( $x1, $y1, $x2, $y2 )
    {
        $this->_out( ( "%.2F %.2F m %.2F %.2F l S", $x1 * $this->k, ( $this->h - $y1 ) * $this->k, $x2 * $this->k, ( $this->h - $y2 ) * $this->k ) );
    }

    public function rect( $x, $y, $w, $h, $style = "" )
    {
        if ( $style == "F" )
        {
            $op = "f";
        }
        else if ( $style == "FD" || $style == "DF" )
        {
            $op = "B";
        }
        else
        {
            $op = "S";
        }
        $this->_out( ( "%.2F %.2F %.2F %.2F re %s", $x * $this->k, ( $this->h - $y ) * $this->k, $w * $this->k, 0 - $h * $this->k, $op ) );
    }

    public function addfont( $family, $style = "", $file = "" )
    {
        $family = ( $family );
        if ( $file == "" )
        {
            $file = ( " ", "", $family ).( $style ).".php";
        }
        if ( $family == "arial" )
        {
            $family = "helvetica";
        }
        $style = ( $style );
        if ( $style == "IB" )
        {
            $style = "BI";
        }
        $fontkey = $family.$style;
        if ( isset( $this->fonts[$fontkey] ) )
        {
            return;
        }
        include( $this->_getfontpath( ).$file );
        if ( !isset( "name" ) )
        {
            $this->Error( "Could not include font definition file" );
        }
        $i = ( $this->fonts ) + 1;
        $this->fonts[$fontkey] = array(
            "i" => $i,
            "type" => $type,
            "name" => $name,
            "desc" => $desc,
            "up" => $up,
            "ut" => $ut,
            "cw" => $cw,
            "enc" => $enc,
            "file" => $file
        );
        if ( $diff )
        {
            $d = 0;
            $nb = ( $this->diffs );
            $i = 1;
            while ( $i <= $nb )
            {
                if ( $this->diffs[$i] == $diff )
                {
                    $d = $i;
                    break;
                }
                ++$i;
            }
            if ( $d == 0 )
            {
                $d = $nb + 1;
                $this->diffs[$d] = $diff;
            }
            $this->fonts[$fontkey]['diff'] = $d;
        }
        if ( $file )
        {
            if ( $type == "TrueType" )
            {
                $this->FontFiles[$file] = array(
                    "length1" => $originalsize
                );
            }
            else
            {
                $this->FontFiles[$file] = array(
                    "length1" => $size1,
                    "length2" => $size2
                );
            }
        }
    }

    public function setfont( $family, $style = "", $size = 0 )
    {
        global $fpdf_charwidths;
        $family = ( $family );
        if ( $family == "" )
        {
            $family = $this->FontFamily;
        }
        if ( $family == "arial" )
        {
            $family = "helvetica";
        }
        else if ( $family == "symbol" || $family == "zapfdingbats" )
        {
            $style = "";
        }
        $style = ( $style );
        if ( ( $style, "U" ) !== false )
        {
            $this->underline = true;
            $style = ( "U", "", $style );
        }
        else
        {
            $this->underline = false;
        }
        if ( $style == "IB" )
        {
            $style = "BI";
        }
        if ( $size == 0 )
        {
            $size = $this->FontSizePt;
        }
        if ( $this->FontFamily == $family && $this->FontStyle == $style && $this->FontSizePt == $size )
        {
            return;
        }
        $fontkey = $family.$style;
        if ( !isset( $this->fonts[$fontkey] ) )
        {
            if ( isset( $this->CoreFonts[$fontkey] ) )
            {
                if ( !isset( $fpdf_charwidths[$fontkey] ) )
                {
                    $file = $family;
                    if ( $family == "times" || $family == "helvetica" )
                    {
                        $file .= ( $style );
                    }
                    include( $this->_getfontpath( ).$file.".php" );
                    if ( !isset( $fpdf_charwidths[$fontkey] ) )
                    {
                        $this->Error( "Could not include font metric file" );
                    }
                }
                $i = ( $this->fonts ) + 1;
                $name = $this->CoreFonts[$fontkey];
                $cw = $fpdf_charwidths[$fontkey];
                $this->fonts[$fontkey] = array(
                    "i" => $i,
                    "type" => "core",
                    "name" => $name,
                    "up" => 0 - 100,
                    "ut" => 50,
                    "cw" => $cw
                );
            }
            else
            {
                $this->Error( "Undefined font: ".$family." ".$style );
            }
        }
        $this->FontFamily = $family;
        $this->FontStyle = $style;
        $this->FontSizePt = $size;
        $this->FontSize = $size / $this->k;
        $this->CurrentFont =& $this->fonts[$fontkey];
        if ( 0 < $this->page )
        {
            $this->_out( ( "BT /F%d %.2F Tf ET", $this->CurrentFont['i'], $this->FontSizePt ) );
        }
    }

    public function setfontsize( $size )
    {
        if ( $this->FontSizePt == $size )
        {
            return;
        }
        $this->FontSizePt = $size;
        $this->FontSize = $size / $this->k;
        if ( 0 < $this->page )
        {
            $this->_out( ( "BT /F%d %.2F Tf ET", $this->CurrentFont['i'], $this->FontSizePt ) );
        }
    }

    public function addlink( )
    {
        $n = ( $this->links ) + 1;
        $this->links[$n] = array( 0, 0 );
        return $n;
    }

    public function setlink( $link, $y = 0, $page = -1 )
    {
        if ( $y == 0 - 1 )
        {
            $y = $this->y;
        }
        if ( $page == 0 - 1 )
        {
            $page = $this->page;
        }
        $this->links[$link] = array(
            $page,
            $y
        );
    }

    public function link( $x, $y, $w, $h, $link )
    {
        $this->PageLinks[$this->page][] = array(
            $x * $this->k,
            $this->hPt - $y * $this->k,
            $w * $this->k,
            $h * $this->k,
            $link
        );
    }

    public function text( $x, $y, $txt )
    {
        $s = ( "BT %.2F %.2F Td (%s) Tj ET", $x * $this->k, ( $this->h - $y ) * $this->k, $this->_escape( $txt ) );
        if ( $this->underline && $txt != "" )
        {
            $s .= " ".$this->_dounderline( $x, $y, $txt );
        }
        if ( $this->ColorFlag )
        {
            $s = "q ".$this->TextColor." ".$s." Q";
        }
        $this->_out( $s );
    }

    public function acceptpagebreak( )
    {
        return $this->AutoPageBreak;
    }

    public function cell( $w, $h = 0, $txt = "", $border = 0, $ln = 0, $align = "", $fill = false, $link = "" )
    {
        $k = $this->k;
        if ( $this->PageBreakTrigger < $this->y + $h && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak( ) )
        {
            $x = $this->x;
            $ws = $this->ws;
            if ( 0 < $ws )
            {
                $this->ws = 0;
                $this->_out( "0 Tw" );
            }
            $this->AddPage( $this->CurOrientation, $this->CurPageFormat );
            $this->x = $x;
            if ( 0 < $ws )
            {
                $this->ws = $ws;
                $this->_out( ( "%.3F Tw", $ws * $k ) );
            }
        }
        if ( $w == 0 )
        {
            $w = $this->w - $this->rMargin - $this->x;
        }
        $s = "";
        if ( $fill || $border == 1 )
        {
            if ( $fill )
            {
                $op = $border == 1 ? "B" : "f";
            }
            else
            {
                $op = "S";
            }
            $s = ( "%.2F %.2F %.2F %.2F re %s ", $this->x * $k, ( $this->h - $this->y ) * $k, $w * $k, 0 - $h * $k, $op );
        }
        if ( ( $border ) )
        {
            $x = $this->x;
            $y = $this->y;
            if ( ( $border, "L" ) !== false )
            {
                $s .= ( "%.2F %.2F m %.2F %.2F l S ", $x * $k, ( $this->h - $y ) * $k, $x * $k, ( $this->h - ( $y + $h ) ) * $k );
            }
            if ( ( $border, "T" ) !== false )
            {
                $s .= ( "%.2F %.2F m %.2F %.2F l S ", $x * $k, ( $this->h - $y ) * $k, ( $x + $w ) * $k, ( $this->h - $y ) * $k );
            }
            if ( ( $border, "R" ) !== false )
            {
                $s .= ( "%.2F %.2F m %.2F %.2F l S ", ( $x + $w ) * $k, ( $this->h - $y ) * $k, ( $x + $w ) * $k, ( $this->h - ( $y + $h ) ) * $k );
            }
            if ( ( $border, "B" ) !== false )
            {
                $s .= ( "%.2F %.2F m %.2F %.2F l S ", $x * $k, ( $this->h - ( $y + $h ) ) * $k, ( $x + $w ) * $k, ( $this->h - ( $y + $h ) ) * $k );
            }
        }
        if ( $txt !== "" )
        {
            if ( $align == "R" )
            {
                $dx = $w - $this->cMargin - $this->GetStringWidth( $txt );
            }
            else if ( $align == "C" )
            {
                $dx = ( $w - $this->GetStringWidth( $txt ) ) / 2;
            }
            else
            {
                $dx = $this->cMargin;
            }
            if ( $this->ColorFlag )
            {
                $s .= "q ".$this->TextColor." ";
            }
            $txt2 = ( ")", "\\)", ( "(", "\\(", ( "\\", "\\\\", $txt ) ) );
            $s .= ( "BT %.2F %.2F Td (%s) Tj ET", ( $this->x + $dx ) * $k, ( $this->h - ( $this->y + 0.5 * $h + 0.3 * $this->FontSize ) ) * $k, $txt2 );
            if ( $this->underline )
            {
                $s .= " ".$this->_dounderline( $this->x + $dx, $this->y + 0.5 * $h + 0.3 * $this->FontSize, $txt );
            }
            if ( $this->ColorFlag )
            {
                $s .= " Q";
            }
            if ( $link )
            {
                $this->Link( $this->x + $dx, $this->y + 0.5 * $h - 0.5 * $this->FontSize, $this->GetStringWidth( $txt ), $this->FontSize, $link );
            }
        }
        if ( $s )
        {
            $this->_out( $s );
        }
        $this->lasth = $h;
        if ( 0 < $ln )
        {
            $this->y += $h;
            if ( $ln == 1 )
            {
                $this->x = $this->lMargin;
            }
        }
        else
        {
            $this->x += $w;
        }
    }

    public function multicell( $w, $h, $txt, $border = 0, $align = "J", $fill = false )
    {
        $cw =& $this->CurrentFont['cw'];
        if ( $w == 0 )
        {
            $w = $this->w - $this->rMargin - $this->x;
        }
        $wmax = ( $w - 2 * $this->cMargin ) * 1000 / $this->FontSize;
        $s = ( "\r", "", $txt );
        $nb = ( $s );
        if ( 0 < $nb && $s[$nb - 1] == "\n" )
        {
            --$nb;
        }
        $b = 0;
        if ( $border )
        {
            if ( $border == 1 )
            {
                $border = "LTRB";
                $b = "LRT";
                $b2 = "LR";
            }
            else
            {
                $b2 = "";
                if ( ( $border, "L" ) !== false )
                {
                    $b2 .= "L";
                }
                if ( ( $border, "R" ) !== false )
                {
                    $b2 .= "R";
                }
                $b = ( $border, "T" ) !== false ? $b2."T" : $b2;
            }
        }
        $sep = 0 - 1;
        $i = 0;
        $j = 0;
        $l = 0;
        $ns = 0;
        $nl = 1;
        while ( $i < $nb )
        {
            $c = $s[$i];
            if ( $c == "\n" )
            {
                if ( 0 < $this->ws )
                {
                    $this->ws = 0;
                    $this->_out( "0 Tw" );
                }
                $this->Cell( $w, $h, ( $s, $j, $i - $j ), $b, 2, $align, $fill );
                ++$i;
                $sep = 0 - 1;
                $j = $i;
                $l = 0;
                $ns = 0;
                ++$nl;
                if ( $border && $nl == 2 )
                {
                    $b = $b2;
                }
                continue;
            }
            if ( $c == " " )
            {
                $sep = $i;
                $ls = $l;
                ++$ns;
            }
            $l += $cw[$c];
            if ( $wmax < $l )
            {
                if ( $sep == 0 - 1 )
                {
                    if ( $i == $j )
                    {
                        ++$i;
                    }
                    if ( 0 < $this->ws )
                    {
                        $this->ws = 0;
                        $this->_out( "0 Tw" );
                    }
                    $this->Cell( $w, $h, ( $s, $j, $i - $j ), $b, 2, $align, $fill );
                }
                else
                {
                    if ( $align == "J" )
                    {
                        $this->ws = 1 < $ns ? ( $wmax - $ls ) / 1000 * $this->FontSize / ( $ns - 1 ) : 0;
                        $this->_out( ( "%.3F Tw", $this->ws * $this->k ) );
                    }
                    $this->Cell( $w, $h, ( $s, $j, $sep - $j ), $b, 2, $align, $fill );
                    $i = $sep + 1;
                }
                $sep = 0 - 1;
                $j = $i;
                $l = 0;
                $ns = 0;
                ++$nl;
                if ( $border && $nl == 2 )
                {
                    $b = $b2;
                }
            }
            else
            {
                ++$i;
            }
        }
        if ( 0 < $this->ws )
        {
            $this->ws = 0;
            $this->_out( "0 Tw" );
        }
        if ( $border && ( $border, "B" ) !== false )
        {
            $b .= "B";
        }
        $this->Cell( $w, $h, ( $s, $j, $i - $j ), $b, 2, $align, $fill );
        $this->x = $this->lMargin;
    }

    public function write( $h, $txt, $link = "" )
    {
        $cw =& $this->CurrentFont['cw'];
        $w = $this->w - $this->rMargin - $this->x;
        $wmax = ( $w - 2 * $this->cMargin ) * 1000 / $this->FontSize;
        $s = ( "\r", "", $txt );
        $nb = ( $s );
        $sep = 0 - 1;
        $i = 0;
        $j = 0;
        $l = 0;
        $nl = 1;
        while ( $i < $nb )
        {
            $c = $s[$i];
            if ( $c == "\n" )
            {
                $this->Cell( $w, $h, ( $s, $j, $i - $j ), 0, 2, "", 0, $link );
                ++$i;
                $sep = 0 - 1;
                $j = $i;
                $l = 0;
                if ( $nl == 1 )
                {
                    $this->x = $this->lMargin;
                    $w = $this->w - $this->rMargin - $this->x;
                    $wmax = ( $w - 2 * $this->cMargin ) * 1000 / $this->FontSize;
                }
                ++$nl;
                continue;
            }
            if ( $c == " " )
            {
                $sep = $i;
            }
            $l += $cw[$c];
            if ( $wmax < $l )
            {
                if ( $sep == 0 - 1 )
                {
                    if ( $this->lMargin < $this->x )
                    {
                        $this->x = $this->lMargin;
                        $this->y += $h;
                        $w = $this->w - $this->rMargin - $this->x;
                        $wmax = ( $w - 2 * $this->cMargin ) * 1000 / $this->FontSize;
                        ++$i;
                        ++$nl;
                        continue;
                    }
                    if ( $i == $j )
                    {
                        ++$i;
                    }
                    $this->Cell( $w, $h, ( $s, $j, $i - $j ), 0, 2, "", 0, $link );
                }
                else
                {
                    $this->Cell( $w, $h, ( $s, $j, $sep - $j ), 0, 2, "", 0, $link );
                    $i = $sep + 1;
                }
                $sep = 0 - 1;
                $j = $i;
                $l = 0;
                if ( $nl == 1 )
                {
                    $this->x = $this->lMargin;
                    $w = $this->w - $this->rMargin - $this->x;
                    $wmax = ( $w - 2 * $this->cMargin ) * 1000 / $this->FontSize;
                }
                ++$nl;
            }
            else
            {
                ++$i;
            }
        }
        if ( $i != $j )
        {
            $this->Cell( $l / 1000 * $this->FontSize, $h, ( $s, $j ), 0, 0, "", 0, $link );
        }
    }

    public function ln( $h = null )
    {
        $this->x = $this->lMargin;
        if ( $h === null )
        {
            $this->y += $this->lasth;
        }
        else
        {
            $this->y += $h;
        }
    }

    public function image( $file, $x = null, $y = null, $w = 0, $h = 0, $type = "", $link = "" )
    {
        if ( !isset( $this->images[$file] ) )
        {
            if ( $type == "" )
            {
                $pos = ( $file, "." );
                if ( !$pos )
                {
                    $this->Error( "Image file has no extension and no type was specified: ".$file );
                }
                $type = ( $file, $pos + 1 );
            }
            $type = ( $type );
            if ( $type == "jpeg" )
            {
                $type = "jpg";
            }
            $mtd = "_parse".$type;
            if ( !( $this, $mtd ) )
            {
                $this->Error( "Unsupported image type: ".$type );
            }
            $info = $this->$mtd( $file );
            $info['i'] = ( $this->images ) + 1;
            $this->images[$file] = $info;
        }
        else
        {
            $info = $this->images[$file];
        }
        if ( $w == 0 && $h == 0 )
        {
            $w = $info['w'] / $this->k;
            $h = $info['h'] / $this->k;
        }
        else if ( $w == 0 )
        {
            $w = $h * $info['w'] / $info['h'];
        }
        else if ( $h == 0 )
        {
            $h = $w * $info['h'] / $info['w'];
        }
        if ( $y === null )
        {
            if ( $this->PageBreakTrigger < $this->y + $h && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak( ) )
            {
                $x2 = $this->x;
                $this->AddPage( $this->CurOrientation, $this->CurPageFormat );
                $this->x = $x2;
            }
            $y = $this->y;
            $this->y += $h;
        }
        if ( $x === null )
        {
            $x = $this->x;
        }
        $this->_out( ( "q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q", $w * $this->k, $h * $this->k, $x * $this->k, ( $this->h - ( $y + $h ) ) * $this->k, $info['i'] ) );
        if ( $link )
        {
            $this->Link( $x, $y, $w, $h, $link );
        }
    }

    public function getx( )
    {
        return $this->x;
    }

    public function setx( $x )
    {
        if ( 0 <= $x )
        {
            $this->x = $x;
        }
        else
        {
            $this->x = $this->w + $x;
        }
    }

    public function gety( )
    {
        return $this->y;
    }

    public function sety( $y )
    {
        $this->x = $this->lMargin;
        if ( 0 <= $y )
        {
            $this->y = $y;
        }
        else
        {
            $this->y = $this->h + $y;
        }
    }

    public function setxy( $x, $y )
    {
        $this->SetY( $y );
        $this->SetX( $x );
    }

    public function output( $name = "", $dest = "" )
    {
        if ( $this->state < 3 )
        {
            $this->Close( );
        }
        $dest = ( $dest );
        if ( $dest == "" )
        {
            if ( $name == "" )
            {
                $name = "doc.pdf";
                $dest = "I";
            }
            else
            {
                $dest = "F";
            }
        }
        switch ( $dest )
        {
        case "I" :
            if ( ( ) )
            {
                $this->Error( "Some data has already been output, can't send PDF file" );
            }
            if ( ( ) != "cli" )
            {
                ( "Content-Type: application/pdf" );
                if ( ( ) )
                {
                    $this->Error( "Some data has already been output, can't send PDF file" );
                }
                ( "Content-Length: ".( $this->buffer ) );
                ( "Content-Disposition: inline; filename=\"".$name."\"" );
                ( "Cache-Control: private, max-age=0, must-revalidate" );
                ( "Pragma: public" );
                ( "zlib.output_compression", "0" );
            }
            echo $this->buffer;
            break;
        case "D" :
            if ( ( ) )
            {
                $this->Error( "Some data has already been output, can't send PDF file" );
            }
            ( "Content-Type: application/x-download" );
            if ( ( ) )
            {
                $this->Error( "Some data has already been output, can't send PDF file" );
            }
            ( "Content-Length: ".( $this->buffer ) );
            ( "Content-Disposition: attachment; filename=\"".$name."\"" );
            ( "Cache-Control: private, max-age=0, must-revalidate" );
            ( "Pragma: public" );
            ( "zlib.output_compression", "0" );
            echo $this->buffer;
            break;
        case "F" :
            $f = ( $name, "wb" );
            if ( !$f )
            {
                $this->Error( "Unable to create output file: ".$name );
            }
            ( $f, $this->buffer, ( $this->buffer ) );
            ( $f );
            break;
        case "S" :
            return $this->buffer;
        default :
            $this->Error( "Incorrect output destination: ".$dest );
        }
        return "";
    }

    public function _dochecks( )
    {
        if ( ( "%.1F", 1 ) != "1.0" )
        {
            $this->Error( "This version of PHP is not supported" );
        }
        if ( ( "mbstring.func_overload" ) & 2 )
        {
            $this->Error( "mbstring overloading must be disabled" );
        }
        if ( ( ) )
        {
            @( 0 );
        }
    }

    public function _getpageformat( $format )
    {
        $format = ( $format );
        if ( !isset( $this->PageFormats[$format] ) )
        {
            $this->Error( "Unknown page format: ".$format );
        }
        $a = $this->PageFormats[$format];
        return array(
            $a[0] / $this->k,
            $a[1] / $this->k
        );
    }

    public function _getfontpath( )
    {
        if ( !( "FPDF_FONTPATH" ) && ( ( "I:\\jiemi\\bin\\rm\\file.php" )."/font" ) )
        {
            ( "FPDF_FONTPATH", ( "I:\\jiemi\\bin\\rm\\file.php" )."/font/" );
        }
        return ( "FPDF_FONTPATH" ) ? FPDF_FONTPATH : "";
    }

    public function _beginpage( $orientation, $format )
    {
        ++$this->page;
        $this->pages[$this->page] = "";
        $this->state = 2;
        $this->x = $this->lMargin;
        $this->y = $this->tMargin;
        $this->FontFamily = "";
        if ( $orientation == "" )
        {
            $orientation = $this->DefOrientation;
        }
        else
        {
            $orientation = ( $orientation[0] );
        }
        if ( $format == "" )
        {
            $format = $this->DefPageFormat;
        }
        else if ( ( $format ) )
        {
            $format = $this->_getpageformat( $format );
        }
        if ( $orientation != $this->CurOrientation || $format[0] != $this->CurPageFormat[0] || $format[1] != $this->CurPageFormat[1] )
        {
            if ( $orientation == "P" )
            {
                $this->w = $format[0];
                $this->h = $format[1];
            }
            else
            {
                $this->w = $format[1];
                $this->h = $format[0];
            }
            $this->wPt = $this->w * $this->k;
            $this->hPt = $this->h * $this->k;
            $this->PageBreakTrigger = $this->h - $this->bMargin;
            $this->CurOrientation = $orientation;
            $this->CurPageFormat = $format;
        }
        if ( $orientation != $this->DefOrientation || $format[0] != $this->DefPageFormat[0] || $format[1] != $this->DefPageFormat[1] )
        {
            $this->PageSizes[$this->page] = array(
                $this->wPt,
                $this->hPt
            );
        }
    }

    public function _endpage( )
    {
        $this->state = 1;
    }

    public function _escape( $s )
    {
        $s = ( "\\", "\\\\", $s );
        $s = ( "(", "\\(", $s );
        $s = ( ")", "\\)", $s );
        $s = ( "\r", "\\r", $s );
        return $s;
    }

    public function _textstring( $s )
    {
        return "(".$this->_escape( $s ).")";
    }

    public function _utf8toutf16( $s )
    {
        $res = "?";
        $nb = ( $s );
        $i = 0;
        while ( $i < $nb )
        {
            $c1 = ( $s[$i++] );
            if ( 224 <= $c1 )
            {
                $c2 = ( $s[$i++] );
                $c3 = ( $s[$i++] );

[exception occured]

================================
Exception code[ C0000005 ]
Compiler[ 00284258 ]
Executor[ 002846E0 ]
OpArray[ 004C9370 ]
File< main >
Class< fpdf >
Function< _utf8toutf16 >
Stack[ 0057F950 ]
Step[ 7 ]
Offset[ 53 ]
LastOffset[ 112 ]
    53  ADD                          [-]   0[0] $Tmp_42 - $Tmp_38 - $Tmp_41
================================
?>

点评

求一份 解密后的 admin.php,user.php 文件我看代码 有望 几天内解决这毛病 主要看调用... 如果你有时间的话 帮忙全部解密掉是最好的 嘿嘿 急需 admin.php user.php  发表于 2013-4-22 11:28
routeros
回复

使用道具 举报

发表于 2013-4-12 13:13:27 | 显示全部楼层
生成pdf估计是用现成的类,在网上找找代码相似的进行替换就OK了。
比如它里面就是用现成的phpmail类,我做的自动安装版就是找源码替换的。
routeros
回复

使用道具 举报

 楼主| 发表于 2013-4-12 15:30:38 | 显示全部楼层
本帖最后由 lsmir2 于 2013-4-12 15:55 编辑

class fpdf
嘿嘿,研究中
参见http://www.owe-love.com/myspace/?action=show&id=247
routeros
回复

使用道具 举报

发表于 2013-4-12 15:39:30 | 显示全部楼层
我都是自己导出数据,然后用word做。一次做200个,5分钟搞定。
routeros
回复

使用道具 举报

 楼主| 发表于 2013-4-13 15:07:32 | 显示全部楼层
8楼亮了...
routeros
回复

使用道具 举报

 楼主| 发表于 2013-4-18 23:38:18 | 显示全部楼层

麻烦  代码删掉 传个文件上来吧 楼层不好看...谢谢
如果可以的话 麻烦帮忙把所有.PHP文件解码 打包上传下..我真不知道怎么给rm的PHP文件解密
关于FPDF添加字体的需要翻墙 上www.fpdf.org
http://translate.google.com.tw/t ... df.org/&act=url
这个连接是  用google翻译FPDF的文档

补充内容 (2013-4-19 18:39):
就是看代码啊.. -.-!  我想写一个  热点登录后直接登录RM user.php那个部分

点评

仅供演示参考实际代码兵部完整可用  发表于 2013-4-19 07:33
routeros
回复

使用道具 举报

发表于 2013-4-19 23:31:31 | 显示全部楼层
http://zhilun.blogbus.com/logs/46808163.html
简简单单让FPDF对中文以及Unicode支持

点评

还有http://www.hubing.info/ 翻墙都打不开 -.-!  发表于 2013-4-22 09:36
RM加密了....  发表于 2013-4-20 16:29
routeros
回复

使用道具 举报

 楼主| 发表于 2013-4-23 01:29:04 | 显示全部楼层
fpdf.zip (518.03 KB, 下载次数: 6)
01.jpg
02.jpg
03.jpg
routeros
回复

使用道具 举报

发表于 2013-5-4 17:56:45 来自手机 | 显示全部楼层
这个可以有
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-5-8 07:22 , Processed in 0.092832 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表