Skip to content

Commit

Permalink
Use batch files to resolve conflict between pdf2xml & pdfalto dlls.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aazhar committed Apr 26, 2019
1 parent 2285253 commit fe8c8b8
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ public static DocumentSource fromPdf(File pdfFile, int startPage, int endPage,
private String getPdfToXmlCommand(boolean withImage, boolean withAnnotations, boolean withOutline) {
StringBuilder pdfToXml = new StringBuilder();
pdfToXml.append(GrobidProperties.getPdfToXMLPath().getAbsolutePath());
pdfToXml.append(
GrobidProperties.isContextExecutionServer() ? File.separator + "pdfalto_server" : File.separator + "pdfalto");
// bat files sets the path env variable for cygwin dll
if (SystemUtils.IS_OS_WINDOWS) {
pdfToXml.append(
GrobidProperties.isContextExecutionServer() ? File.separator + "pdfalto_server.bat" : File.separator + "pdfalto.bat");
} else
pdfToXml.append(
GrobidProperties.isContextExecutionServer() ? File.separator + "pdfalto_server" : File.separator + "pdfalto");

pdfToXml.append(" -blocks -noImageInline -fullFontName ");

if (!withImage) {
Expand Down
2 changes: 2 additions & 0 deletions grobid-home/pdf2xml/win-32/pdfalto.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SET PATH=%PATH%;%~dp0pdfalto_dlls
%~dp0pdfalto.exe %*
Binary file not shown.
2 changes: 2 additions & 0 deletions grobid-home/pdf2xml/win-32/pdfalto_server.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SET PATH=%PATH%;%~dp0pdfalto_dlls
%~dp0pdfalto_server.exe %*
2 changes: 2 additions & 0 deletions grobid-home/pdf2xml/win-64/pdfalto.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SET PATH=%PATH%;%~dp0pdfalto_dlls
%~dp0pdfalto.exe %*
Binary file not shown.
2 changes: 2 additions & 0 deletions grobid-home/pdf2xml/win-64/pdfalto_server.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SET PATH=%PATH%;%~dp0pdfalto_dlls
%~dp0pdfalto_server.exe %*

0 comments on commit fe8c8b8

Please sign in to comment.