Hello experts.
In old NAV I had a code which was used to convert PDF to XML using external app PDFX.exe and it looked something like this:
WshMode := 1;
WaitForEndOfCommand := TRUE;
CommandL := 'C:\PDFX.exe' + 'pdftoxml' + ' ' + FileNameOriginal + ' ' + 'C:\Test.pdf' + 'TestFile.xml';
IF ISCLEAR(WshShell) THEN
CREATE(WshShell);
ReturnCode := WshShell.Run(Command,WshMode,WaitForEndOfCommand);
However, now I cannot use Automation anymore so does anyone know how can I convert this PDF file?
I know I can access PDF using HYPERLINK('C:\Test.pdf') but how to go from there? Maybe some other solution?
THANKS IN ADVANCE!!!
0
Answers
https://forum.mibuso.com/discussion/62682/nav-2013-shell-is-not-working/p1
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Hey ara3n. I tried this already but when I run it, nothing happens. I'm going with something like this:
ProcInfo := ProcInfo.ProcessStartInfo;
ProcInfo.FileName := 'C:\WINDOWS\system32\notepad.exe';
ProcInfo.Arguments := 'c:\test.txt';
ProcInfo.UseShellExecute := FALSE;
ProcInfo.RedirectStandardOutput := TRUE;
ProcInfo.WindowStyle := 1; // Hidden
ProcInfo.CreateNoWindow := TRUE;
WShell:= WShell.Start(ProcInfo);
WShell.WaitForExit;
If it means anything, I'm running this code on my demo database locally on my computer.
Little update on the issue:
It does export the XML file but in .vec format and there is no data from my pdf document just something lie this code:
<VECTORIALIMAGES><CLIP sid="p1_s1" x="0" y="0" width="595.32" height="841.92" idClipZone="p1_c1"><GROUP sid="p1_s2" closed="true"><M x="0" y="841.92"/><L x="595.32" y="841.92"/><L x="595.32" y="0"/><L x="0" y="0"/><L x="0" y="841.92" etc etc etc
I realized that my externall app PDFX takes parameters as shown in the image. How can I pass some of these through code shown above? Thanks!