Convert PDF to XML: external app, shell alternative, anything else?

Tiwaz
Member Posts: 98
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!!!
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
-
this link should help on how to run your exe.
https://forum.mibuso.com/discussion/62682/nav-2013-shell-is-not-working/p1
0 -
this link should help on how to run your exe.
https://forum.mibuso.com/discussion/62682/nav-2013-shell-is-not-working/p1
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.0 -
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!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions