사용방법은 밑에.. 

  string ls_tmp,ls_tmp1,ls_file_name
  long   ll_cnt,ll_tmp,li_pos
 
 
  ls_tmp = PrintGetPrinters() /* PC에 설치된 프린터명들 가져오기 */
//  ls_PrintGetPrinter = PrintGetPrinter () /* 현재프린터명 */
  ls_tmp1 = "SWF Printer"   /*<-- PDF로 출력가능한 프린터명 */

  ll_cnt = Pos(ls_tmp, ls_tmp1)
  IF ll_cnt > 0 THEN
  ls_tmp = Mid(ls_tmp, ll_cnt)
  ll_tmp = Pos(ls_tmp, "~n")
  IF ll_tmp > 0 THEN
   ls_tmp = Left(ls_tmp, ll_tmp - 1)
  END IF
  
  li_pos = PrintSetPrinter(ls_tmp)
  dw_2.Modify('DataWindow.Printer = "' + ls_tmp1 + '" ')
 
 
  ls_file_name = String(Today(), "yyyymmdd_hh_mm")  
  ls_file_name = "D:\Powerbuilder Tip\Test\PDF\"+ ls_file_name + ".PDF" /* 저장될 파일명*/
  
 
 // RegistrySet("HKEY_CURRENT_USER\Software\Bytescout\SWF Printer\","Silent", RegULong!,1)  /*-> 다른이름으로 저장창 안띄우기*/
  RegistrySet("HKEY_CURRENT_USER\Software\Bytescout\SWF Printer\","OutputFilename", RegString!,ls_file_name) /*-> 출력될 파일이름 지정*/
 
   
  ELSE
  // gf_status_msg('SWF Printer가 설치되지 않았습니다. ~nSWF Printer를 설치하세요!')
   Messagebox('SWF Printer설치요망','SWF Printer가 설치되지 않았습니다. ~nSWF Printer를 설치하세요!')
   return
  
   //IF Messagebox("알림","PDF변환에 필요한 프로그램이 설치되어있지 않습니다.~r~n설치가 완료되면 다시 출력버튼을 눌러 주시기 바랍니다.~r~n설치하시겠습니까?",Question!,YesNo!,1) = 1 THEN
   //   //ghost script를 download한다. (http://www.ghostscript.com/doc/AFPL/index.htm)
   //
   //  //FTP가 구축되어 있으면 특정 디렉토리로 파일을 다운받도록 한다.
   //
   //  //그런다음 그 디렉토리를 열어서 사용자가 설치하도록 한다.
   //
   //   Messagebox('설치방법 안내', DOC 파일을 출력하셔서 참고하시기 바랍니다.')
   //   run("explorer.exe "+is_Directory)   
  END IF

dw_2.Print()

Posted by 민서정
l