|
<< Click to Display Table of Contents >> Navigation: »No topics above this level« .docx, .rtf .pdf Interfaces - www.4GL.fr |
Text contained in an .rtf or Word-compatible file can be extracted and used by vpxPrint
Implemented by the vpxRTF.dll DLL and interfaced with {xprint.i}. This DLL must be deployed if these functions are used.
Two methods:
1.Transmission of an RTF sequence as a character string:
2.Converting a .rtf, doc, .docx or pdf file:
.rtf files are converted natively, other files are converted using MSWord, which must therefore be accessible.
Since loading Word generates significant overhead, it is preferable to perform this conversion at the beginning of the session so as not to use it for each document.
Performance test:
{xprint.i}
DEF VAR A AS CHAR NO-UNDO. DEF VAR B AS CHAR NO-UNDO. DEF VAR T AS INT NO-UNDO. DEF VAR T2 AS INT NO-UNDO.
ETIME(TRUE). A = RTFText("C:\demo\Test.docx"). T = ETIME.
ETIME(TRUE). B = RTFText("C:\demo\Test.rtf"). T2 = ETIME.
DEF STREAM RTF.
OUTPUT STREAM RTF TO "c:/temp/RTFText.xpr".
PUT STREAM RTF CONTROL "<preview><units=mm>" "<R1><C5><#1>" "<AT=290><C+60><FRAME#1><ALIGN=BASE>" "<USE#1><JUSTIFY>" A /* Word */ "</USE>"
"<R10><AT=,170><fgcolor=red><FConsolas><P12><B>.docx: " T 'ms</B>'
"<R38><C15><#1>" "<AT=290><C+60><FRAME#1><ALIGN=BASE>" "<USE#1><JUSTIFY>" B /* RTF */ "</USE>" "<R42><C2><B><fgcolor=red><FConsolas><P12>.rtf: " T2 'ms</B>' .
OUTPUT STREAM RTF CLOSE. RUN printFile("c:/temp/RTFText.xpr").
|