PreviousNext
Help > Programming with LAUNCHER Office > LNCCMD commands > Commands list > PDFFTXT command
PDFFTXT command

Allows to create a PDF from a text file.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('PDFFRTXT')

CHGVAR

VAR(&PARM1) VALUE('
Text="Complete path of the text file"
;Dest="Complete path of the PDF file"

[;FontSize=Font size]

[;LineSpacing=Line height]
[;LeftMargin=Left margin]

[;RightMargin=Right margin]

[;TopMargin=Top margin]

[;BottomMargin=Bottom margin]

[;Orientation=0|1|2]

[;PageSize="The page size to use"]

[;StandardFont="Name of the standard font"]

[;TrueTypeFont="Name of TrueType font"]
')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)

 

 

Parameters

 

 

Parameters

 

Parm1
ou
Parm2

Text: Full path of the text file to be converted to PDF.

 

Dest: Full path to the PDF file to be created.

 

FontSize: Font size used in the PDF. If this parameter is not specified, then the font size will be 10.

 

LineSpacing: Line height factor.
Line height = Font size x Size factor.
The size factor must be specified. If this parameter is not specified, then the factor will be 1.05.

 

LeftMargin: Left margin of the PDF. Specify in PDF points (1 point = 1/72 inch). If this parameter is not specified, the margin will be 40 PDF points.

 

RightMargin: Right margin of the PDF. Specify in PDF points (1 point = 1/72 inch). If this parameter is not specified, the margin will be 40 PDF points.

 

TopMargin: Top margin of the PDF. Specify in PDF points (1 point = 1/72 inch). If this parameter is not specified, the margin will be 40 PDF points.

 

BottomMargin: Bottom margin of the PDF. Specify in PDF points (1 point = 1/72 inch). If this parameter is not specified, the margin will be 40 PDF points.

 

Orientation: PDF orientation. This setting can take the following values:
0: the orientation is chosen automatically based on the content of the text document. Default value.
1: portrait
2: landscape

 

PageSize: PDF page size. This setting can take the following values: LETTER (default), LEGAL, A0, A1, A2, A3, A4, A5, A6.

StandardFont: Font to use for the PDF. Either this parameter or the TrueTypeFont parameter is specified, but not both. This parameter can take the following values::
Courier
Courier – Bold
Courier – Oblique
Courier – BoldOblique
Helvetica (par défaut)
Helvetica – Bold
Helvetica – Oblique
Helvetica – BoldOblique
Symbol
Times – Bold
Times – Roman
Times – Italic
Times – BoldItalic
ZapfDingbats

TrueTypeFont: If the Windows PC/Server does not have the specified standard font, the PDF reader will use a different font for the PDF.
To ensure identical display on all machines, the PDF can embed a TrueType font directly by setting this parameter. TrueType fonts are often .ttf files. Either this parameter or the StandardFont parameter must be set, but not both. The full path to the TrueType font must be specified..

 

 

Example

 

PGM                                                                                                            

LNCOPEN                                                 

                                                        

LNCCMD     CMD(PDFFRTXT) +                              

             PARM1('Text="C:\A\TEST.txt";Dest=+

             "C:\A\\res2.pdf";StandardFont="Cou+

             rier";FontSize=16;PageSize="A4"') 

 

LNCCMD     CMD(PDFFRTXT) +                              

             PARM1('Text="C:\A\TEST.txt";Dest=+

             "C:\A\res3.pdf";TrueTypeFont="C:\+

             Windows\Fonts\Candara.ttf";FontSize=16')  

                       

LNCCLOSE                                                

ENDPGM