I need to programmatically convert pdf files to XML to be able to extract data and insert into a database.
I have researched and seen many examples.
My environment is: I am developing using localhost, I have Java 13.0.1 installed , I have set the java bin path in environment variable (rebooted afterwards). I have both inetpub and wampserver installed (listening on different ports) and have successfully compiled java classes (beginners examples) on my computer.
I found this coding (listed below) at: https://stackoverflow.com/questions/16936013/java-code-for-pdf-to-xml-conversion.
I am not very skilled at Java. I compiled the class at the cmd line: javac c:\wamp\www\PDFConvert\ConvertPDFToXML.java and receive the errors (36 of them!). The errors are concern with the first 3 lines after the public class declaration - static StreamResult streamResult; static TransformerHandler handler; static AttributesImpl atts;
The errors are "cannot find static streamResult steamResult" ; "cannot find static streamResult TransformerHandler " ;"cannot find static streamResult AttributesImpl " for each time the above 3 appeared in the coding.
SO I decided to add the following code to the top of the coding:
That just resulted in producing same type of errors for those lines.
I have attached a screenshot of the errors.
Could someone be as so kind as to help and educate me in what I am doing wrong ?? I don't know what I am doing wrong.
Below is the complete coding - including what I inserted (first 3 lines).
Open in new window