<< Click to Display Table of Contents >> Window procedure (with PDF previewer) |
!!! Generated from procedure template - Source
MainSrcWin PROCEDURE ! Declare Procedure
Window WINDOW('Caption'),AT(,,533,351),FONT('Microsoft Sans Serif',8),CENTER,GRAY,SYSTEM
REGION,AT(14,14,495,309),USE(?rgnHtml)
END
pdfMaker CLASS(TPDFMake)
Load PROCEDURE(STRING pHtmlFile), DERIVED
Run PROCEDURE()
END
pdfViewer EasyHtmlEditor
CODE
OPEN(Window)
!- init viewer
pdfViewer.InitControl(Window, ?rgnHtml)
pdfViewer.ReadOnly(TRUE)
pdfViewer.ToolbarVisible(FALSE)
!- load script
pdfMaker.Load('.\PdfMake\EasyPDFMaker.html')
ACCEPT
IF EVENT() = EVENT:OpenWindow
!- create pdf
pdfMaker.Run()
END
END
pdfViewer.KillControl()
!- pdfMaker methods
pdfMaker.Load PROCEDURE(STRING pHtmlFile)
CODE
SELF.SetViewer(pdfViewer, -1, -1)
PARENT.Load(pHtmlFile)
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)