RTF-Doc-PDF Converter

31 views
Skip to first unread message

15herr...@gmail.com

unread,
Oct 15, 2020, 9:02:48 AM10/15/20
to Rosi Delphi Components
Hello,

I use the RTF-Report to generate some Reports and it works well.
Now I want to convert these generated RTF-Reports to PDF documents with your converter wirth ShellExecute.
By starting the command the converter starts without problem, but when I define the parameters, they works not correct.

Code to create report:

               Rep_RTF.ReportFile   := DB_Pfad + 'Projektliste_akt.rtf';
               Rep_RTF.OutputFile   := Projekte_Pfad + '\Projektliste.rtf';
               PListe               := True;
               DefVariables(Rep_RTF.Variables);
               Rep_RTF.Execute([tbl_GEB_Proj]);

Code to start Converter:

          Parameter := 'dir=' + Projekte_Pfad + '\' + ' file=' + Rep_RTF.OutputFile + ' out-pdf';

         Result:  Parameter 'dir=E:\Programmierung\Projekte\GEBUS-Objektverwaltung SQL\Projekte\ file=E:\Programmierung\Projekte\GEBUS-Objektverwaltung SQL\Projekte\Projektliste.rtf out-pdf'

          ErrCode := ShellExecute(Application.Handle, 'open',
                     PWideChar(Prog_Pfad + 'RTF_Doc_PDF.exe'), PWideChar(Parameter), nil, SW_NORMAL);

Result Converter:

I suspect, that the 'blank' caracter in the string ist ignored in the parameter string, but this is a 'must have', because I cannot tell the users that he must write all directories without blank caracters.

With excitement I expct your solution. 

Regards
Uli

Tomas Rosinsky

unread,
Oct 20, 2020, 3:45:07 PM10/20/20
to Rosi Delphi Components
Hello Uli, 
space character is used as a parameter separator by default. You have to use double quotes char " at the beginning an end of the each command parameter to avoid this issue.
I hope it helps.
Tomas


Reply all
Reply to author
Forward
0 new messages