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

Samples from Users
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

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

Fytek - PDF Converter


; ======= Winbatch: OLE Script to Test Fytek PDF DLL ===================== ;
;  http://www.fytek.com.
;  1. Checks to see if Fytek Control is registered                         ;
;  2. Converst 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 %infile% ")
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


SAMPLE.HTML

<FCOLOR=.2,.2,1><FONT=5,20><X=50><ALIGN=C><FONT><FCOLOR=0,0,0><BR><BR>
<X=0>There are several other useful In-line commands you can use.<BR><BR>
<P>
Height and width In the SRC (source) are required and are the pixel size of the image at 72 dpi.
The HEIGHT=x% and WIDTH=y% are used To scale the image.
Using 50 will shrink the size By 50%. 200 will double the size of the image, etc.<BR><BR>
\<X=percent\> For aligning COLUMNS In a table.<BR>
\<ALIGN=x\> For setting the Left, Right, or Center alignment For a given table cell.<BR>
\<PAGE\> For inserting a new page.<BR>
<BR>
You can set up a table format By using the \<X=percent\> command.
The value is the percent of the current line width To use For the table.
Use the \<ALIGN=x\> command To set the alignment ON individual cells of the table.
Here is an example:<BR><BR>
<FONT=5,12><BGCOLOR=.8,1,.8><U>Name<X=15>Address<X=45><ALIGN=C>Active<X=60><ALIGN=R>Sales<X=65><ALIGN=C>Status</U><FONT><BGCOLOR=1,1,1><BR>
ABC Corp<X=15>555 South Street<X=45><ALIGN=C>YES<X=60><ALIGN=R>100.00<BR>
Test Name<X=15>123 Main Street<X=45><ALIGN=C><FCOLOR=1,0,0>NO<FCOLOR=0,0,0><X=60><ALIGN=R>21,500.00<BR>
XYZ Company<X=15>12500 N. Market Blvd<X=45><ALIGN=C>YES<X=60><ALIGN=R>4,500.00<X=65><ALIGN=C><BR><BR>
You can insert page breaks By using the \<PAGE\> command.
Simply place the command In your text To force a new page.
For example, the following line will begin ON the Next page.
<PAGE>
This text is at the top of page 2.
<P>
For more PDF tools, visit us at <A HREF="http://www.fytek.com">HTTP://www.fytek.com</A>.

Article ID:   W17218
File Created: 2007:07:03:14:28:52
Last Updated: 2007:07:03:14:28:52