WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

PDF Conversion

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Fytek - Converts Sample txt file (in HTML format) To PDF File

Keywords: 	 Fytek - Converts Sample txt file (in HTML format) To PDF File 

; ======= Winbatch: OLE Script to Test Fytek PDF DLL ===================== ;
;  1. Checks to see if Fytek Control is registered                         ;
;  2. Converts Sample txt file (in HTML format) To PDF File                ;
;                                                                          ;
;  Please e-mail suggestions and or improvements to:                       ;
;  Stan Littlefield  ( stanl@btitelecom.net )    May 05, 2001            ;
; ======================================================================== ;


If RegExistKey(@RegClasses,"build.Fytek.PDF") == @FALSE
   message("Error:Cannot Continue","Fytek Control Not Installed.")
   exit
Endif


:start
infile = AskFileName("Select Text File",".\","Text/HTML Files|*.txt|","*.txt",1)
If infile == ""
   exit
Endif

BoxOpen("Converting Text To PDF.....","Opening %ibfile% ")
outfile  = StrReplace(StrUpper(infile),".TXT",".PDF")

PDF = ObjectOpen("build.Fytek.PDF")


IF FileExist(outfile) == @TRUE
  FileDelete(outfile)
Endif


PDF.setInFile  (infile)
PDF.setOutFile (outfile)

retval = PDF.buildFytekPDF()

ObjectClose(PDF)

BoxShut()

If retval == @FALSE
   message("PDF Creation Error","File %outfile% not Created")
Endif

exit

:cancel
Goto Start

To download the zip file:
fytek.zip

Article ID:   W15670
File Created: 2017:08:29:11:58:48
Last Updated: 2017:08:29:11:58:48