-
Notifications
You must be signed in to change notification settings - Fork 0
How to modify the parser backend (Java) or update the iText version
To do this, you need Eclipse.
To edit the parser...
Step 1: Clone the repository. Specifically, you need the PdfInspector and iText folders.
Step 2: Open Eclipse.
Step 3: Create a New > Java Project.
Step 4: Uncheck "Use Default Location" and browse for the iText folder.
Step 5: Complete the import by clicking Next or Finish.
Step 6: Repeat steps 3-5 for the PdfInspector folder.
Step 7: Modify the Parser (PdfInspector) as you see fit.
Step 8: Create a Run Configuration (by just pressing the "Run" button) for PdfInspector > src > pdfainspector > PdfAInspector.java.
Step 9: Ensure that there are no arguments and that everything compiles correctly. You can check the settings by clicking on the green "Run" arrow's dropdown menu and selecting "Run Configurations"
Step 10: Open the File > Export dialog and select Java > Runnable JAR File. Click Next.
Step 11: As the Launch Configuration, select the Run Configuration you created in Step 8.
Step 12: As the Export Destination, browse the PdfInspector folder for lib/pdfainspector.jar. This file should already exist. We are going to overwrite it, so select it.
Step 13: Click Finish, and allow it to overwrite the existing file. Assuming your code compiles, it should be able to create the JAR (though it may say there were Warnings. You can ignore this - there's only really an issue if there are errors.)
This JAR file is what is called by the web interface to parse an uploaded PDF. If it works, you can go ahead and commit it.
If you want to update the iText version...
Step 1: Go through steps 1-6 above. I guess technically you may be able to ignore 3-5, but I'm not sure.
Step 2: Download the JAR containing the new version of iText you want to use. You can get these from http://itextpdf.com.
Step 3: Place the JAR wherever you see fit. I suggest in the PdfInspector/lib folder.
Step 4: Somehow make Eclipse recognize this JAR file. If you put it in the PdfInspector/lib folder, you can just right-click on the folder in Eclipse and select "Refresh".
Step 5: Right-click on the PdfInspector Eclipse project. As in the topmost parent folder that reads PdfInspector. Select "Properties".
Step 6: Navigate to "Java Build Path" in the sidebar, and the "Projects" tab in the main window. Remove itext-5.2.1.
Step 7: Go to the "Libraries" tab and Add the JAR file you just downloaded using the Add JARs command.
Step 8: Click OK. Recompile the main PdfInspector JAR as in steps 8-13 above. It should work if you properly linked the new iText JAR.
Step 9: You can remove the iText-5.2.1 folder at this point if the JAR worked. Then you can commit your changes.
Step 10: Modify this guide. Tell future users to go to the "Libraries" tab in step 6 rather than the "Projects" tab, and tell them to remove the old iText JAR (the one that you installed). You can also change the parts about the iText folder in steps 1 and 9.