You cannot see this page without javascript.

웹 미리보기

아래아 한글 조회 수 2721 추천 수 0 2014.06.12 00:09:47

<%

 

user_file = request("user_file")        '파일명

 

 

%><html>

<head>

<title>hwp보기</title>

<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">

 

<script >

 

// 툴바 customize

 

function InitToolBarJS()

 

{

 

   HwpControl.HwpCtrl.SetToolBar(0, "FilePreview, Print, Separator, Undo, Redo, Separator, Cut, Copy, Paste,"

 

   +"Separator, ParaNumberBullet, MultiColumn, SpellingCheck, HwpDic, Separator, PictureInsertDialog, MacroPlay1");

 

 

 

 

   HwpControl.HwpCtrl.SetToolBar(1, "DrawObjCreatorLine, DrawObjCreatorRectangle, DrawObjCreatorEllipse,"

 

   +"DrawObjCreatorArc, DrawObjCreatorPolygon, DrawObjCreatorCurve, DrawObjCreator, DrawObjTemplateLoad,"

 

   +"Separator, ShapeObjSelect, ShapeObjGroup, ShapeObjUngroup, Separator, ShapeObjBringToFront,"

 

   +"ShapeObjSendToBack, ShapeObjDialog, ShapeObjAttrDialog");

 

 

 

 

   HwpControl.HwpCtrl.SetToolBar(2, "StyleCombo, CharShapeLanguage, CharShapeTypeFace, CharShapeHeight,"

 

   +"CharShapeBold, CharShapeItalic, CharShapeUnderline, ParagraphShapeAlignJustify, ParagraphShapeAlignLeft,"

 

   +"ParagraphShapeAlignCenter, ParagraphShapeAlignRight, Separator, ParaShapeLineSpacing,"

 

   +"ParagraphShapeDecreaseLeftMargin, ParagraphShapeIncreaseLeftMargin");

 

   HwpControl.HwpCtrl.ShowToolBar(true);

 

}

 

 

 

</script>

<SCRIPT language=JavaScript>

<!--

 

 

 

 

 

 

 

 

                

 

 

//문서를 한글컨트롤에 전송/////////////////////////////////////////////////////////////////////////////////

function doc_view()

{

    var str_value;

    var str_low;

    var str_dotlocation;

    var str_ext;

 

    str_value = document.sign.user_file.value;

    

    str_low         = str_value.toLowerCase(str_value);

    str_dotlocation = str_low.lastIndexOf(".");

    str_ext         = str_low.substring(str_dotlocation+1);

 

    if(str_ext!="hwp" && str_ext!="")

    {

        alert("문서를 다시 선택하세요!!");

        location.class='MIME' href='app_submit.php';

        return;

    }           

 

    OnStart();          

    return;

}

 

//hwp Ctrl 설정/////////////////////////////////////////////////////////////////////////////////////////

var BasePath;

var pos;

var flag        = 0;

var MinVersion  = 0x05050100;

 

function OnStart(){

 

    var pHwpCtrl = sign.HwpCtrl;

    

    if(pHwpCtrl.getAttribute("Version") == null) //Hwp Ctrl 설치 체크

    {

        alert(  "한글 2002 컨트롤이 설치되지 않아 폼관리메뉴로 이동합니다.nn"

              + "한글 2002 이상 설치 및 패치를 하셨는지 확인하십시오.nnnn"

              + "※전자결재 시스템은 Internet Explorer6.0, 한글2002 이상에서 최적화 되어있습니다.");

        location.class='MIME' href='/form_manage.php';

    }

    

    CurVersion = pHwpCtrl.getAttribute("Version"); //Hwp Ctrl 버전 추출

 

    if(CurVersion < MinVersion) //Hwp Ctrl 버전 체크

    {       

        //현재 버젼: 0x" + CurVersion.toString(16)

        //권장 버젼: 0x" + MinVersion.toString(16)

        alert(  "한글 2002 컨트롤이 설치되지 않아 폼관리메뉴로 이동합니다.nn"

              + "한글 2002 이상 설치 및 패치를 하셨는지 확인하십시오.nnnn"

              + "※전자결재 시스템은 Internet Explorer6.0, 한글2002 이상에서 최적화 되어있습니다.");

        location.class='MIME' href='/form_manage.php';

    }

 

    BasePath = ""; //BasePath 초기화

 

    if(!sign.HwpCtrl.Open(BasePath + document.sign.user_file.value)) //선택한 Hwp file OPEN

    {

        alert("선택한 문서가 존재하지 않습니다. 문서를 다시 선택하세요!!");

        return;

    }

 

    //한글문서내용얻기함수 Call

    //document.sign.doc_str.value="";

    GetTextAll();

    

}

 

//한글문서 내용 얻기

function InitScan(){

 

    sign.HwpCtrl.InitScan(0xff, 0x77, 0, 0, 0, 0);

 

}

 

function GetText(){

 

    var TextSet;

    var ret;

    var retmsg;

    var txt;

    var tmpstr;

 

 

    TextSet = sign.HwpCtrl.CreateSet("GetText");

    txt = "";

    ret = sign.HwpCtrl.GetTextBySet(TextSet);

 

    //공백처리  

    tmpstr=Space_All(txt);

 

    if(tmpstr==''){

    //  alert('here');      

    }

    

 

    switch(ret)

    {

        case 0:

            retmsg = "텍스트정보 없음";

        break;

        case 1:

            flag=0;

            retmsg = "리스트의 끝";

        break;

        case 2:

            retmsg = "일반 텍스트";

            txt = TextSet.Item("Text");

        break;

        case 3:

            retmsg = "다음 문단";

            txt = TextSet.Item("Text");

        break;

        case 4:

            retmsg = "제어문자 내부로 들어감";

            txt = "";

        break;

        case 5:

            retmsg = "제어 문자를 빠져 나옴";

            txt = "";

        break;

        case 101:

            retmsg = "초기화 안됨. (InitScan() 실패 또는 InitScan()를 실행하지 않은 경우.)";

        break;

        case 102:

            retmsg = "텍스트 변환 실패";

        break;

    }

 

    //alert(txt);

 

    if(txt.indexOf('*')>=0){

        flag=1;

        txt = txt.slice(txt.indexOf('*')+1, txt.length);

    }

 

    if(flag==1){

        //document.sign.doc_str.value += txt;

        //document.sign.doc_str.doScroll("scrollbarPageDown");

    }

 

    return ret;

 

}

 

function Space_All(str)

{

  var index, len

           

  while(true)

  {

   index = str.indexOf(" ")

   // 공백이 없으면 종료합니다.

   if (index == -1) break

   // 문자열 길이를 구합니다.

   len = str.length

   // 공백을 잘라냅니다.

   str = str.substring(0, index) + str.substring((index+1),len)

  }

   

  return str;

}

 

 

function ReleaseScan(){

    sign.HwpCtrl.ReleaseScan();

}

 

function GetTextAll(){

    InitScan();

    while (GetText() !=1){

 

    }

    ReleaseScan();

}

 

//선택한 hwp 문서 보기///////////////////////////////////////////////////////////////////////////////////

 

 

function TextCounter(theField,maxSize) {

 

    var e = maxSize;

    var k = e / 2;

 

    var nStrSize = StringSize(theField.value);

 

    if ( nStrSize > maxSize ) {

        alert("최대 입력값 한글" + k + "자, 영문" + e + "자를 넘었습니다.rn현재 "+nStrSize+"자");

        theField.focus();

        return false;

    }else{

        return true;

    }

}

 

function StringSize (s) {

    var i;

    var len = 0;

    for ( i=0 ; i<s.length; i++) {

        if ( s.charCodeAt(i) > 255 ) {

            //len ++;

            len += 2;

        } else {

            len ++;

        }

    }

    return len;

}

 

 

 

 

  

 

//-->

</SCRIPT>

</head>

 

<body bgcolor="#FFFFFF" text="#000000" onload="doc_view();" leftmargin="0" topmargin="0"  >

<table width="100%" border="1" cellspacing="0" cellpadding="0" height="100%"><FORM name=sign ><tr>

      <td> <object id=HwpCtrl style="LEFT: 0px; TOP: 0px"   height=900 width=100%  align=center   classid=CLSID:BD9C32DE-3155-4691-8972-097D53B10052>

          <param name="TOOLBAR_MENU" value="TRUE">

          <param name="SHOW_TOOLBAR" value="TRUE">

        </object>

                <input type=hidden value="" name="doc_str">

        <input name=user_file        type=hidden      value="http://###.###.com/down/<%=user_file%>"   >

      </td>

  </tr>

</form>

</table>

</body>

</html>

엮인글 :
List of Articles
번호 제목 글쓴이 날짜 조회 수
369 APM mariadb download origin address LynX 2019-06-19 1994
368 APM What one can and should optimize LynX 2019-06-03 1419
367 CentOS mariadb install LynX 2019-05-31 1183
366 CentOS init mode change LynX 2019-05-30 1291
365 APM ext zip install LynX 2019-02-19 1615
364 APM ext ImageMagick install LynX 2019-02-19 513
363 3D Printer Pronterface(PrintRun) install file LynX 2018-09-13 753
362 CentOS Grub UUID change LynX 2018-08-08 870
361 Linux letsencrypt wildcard LynX 2018-07-26 798
360 Printer cura usb connection LynX 2018-07-06 666
359 CentOS cli 무선랜 LynX 2018-06-07 448
358 APM 윈도우에 APM 페키지 설치 file LynX 2018-05-04 594
357 APM MySQLTuner 설치 LynX 2018-04-27 545
356 CentOS CentOS7 커널 업데이트 LynX 2018-04-23 702
355 HTML Tag CSS 여러가지 모양 만들기 LynX 2018-02-08 772
354 Linux wkhtmltopdf wkhtmltoimage install LynX 2018-01-31 602
353 APM LZ4_LIBS Not Found (CentOS7, MariaDB 10.1.29) LynX 2018-01-03 485
352 APM mysql ./configure LynX 2017-12-15 805
351 APM PHP-7.2.0 LynX 2017-12-12 3157
350 Linux libiconv LynX 2017-12-08 558

XE Login