Source procedure

<< Click to Display Table of Contents >>

Navigation:  EasyPDFMaker documentation > Getting started > Step by Step > Working with PDF file > Conceptual examples >

Source procedure

Previous pageReturn to chapter overviewNext page

!!! Generated from procedure template - Source

MainSrc             PROCEDURE                             ! Declare Procedure

pdfMaker               CLASS(TPDFMake)

Run                       PROCEDURE()

TakePDFFile               PROCEDURE(STRING pFile), DERIVED, PROTECTED, STRING, PROC

                      END

 

 CODE

 !- load script

 pdfMaker.Load('.\PdfMake\EasyPDFMaker.html')

 

 !- create pdf

 pdfMaker.Run()

 

 !- pdfMaker methods

pdfMaker.Run                 PROCEDURE()

dd                             TDocDefinition

CODE

 !- Build DocDefinition object

 dd.BeginContent()

 dd.AddText('Hello world!')

 dd.EndContent()

 

 !- set pdf file name

 SELF.pdfFile = 'test.pdf'

 

 !- Invoke "fnGetPDF" script, passing DocDefinition object as an argument

 PARENT.Run('fnGetPDF', dd)

 

pdfMaker.TakePDFFile         PROCEDURE(STRING pFile)

loc:errMsg                     ANY

CODE

 !- open 'PDF' associated program

 ezh::ShellExec(pFile)

 RETURN PARENT.TakePDFFile(pFile)