Closed sankalprao closed 3 years ago
Hmm, I can still reproduce the warning only when both files are really not present. 🤔
Does your code run on Windows or Linux? Because under Linux "Downloads\\Original.pdf"
does not denote the file Original.pdf
in folder Downloads
.
Have you tried "Downloads/Original.pdf"
? It should work on both platforms.
Internally the given paths are accessed with Files.newInputStream(Paths.get(...))
What happens if you put these on the beginning of your main method?
try (InputStream is1 = Files.newInputStream(Paths.get("Downloads\\Original.pdf"))) {
try (InputStream is2 = Files.newInputStream(Paths.get("Downloads\\Altered.pdf"))) {
System.out.println("both files exist");
}
}
Please try: Files.exists(Paths.get("your file here")). If this gives your false, then your file is not found. Also make sure your relative file path actually resolves to what you expect. Are you sure you start off in the "right" location? You could also try Paths.get("your file here").toAbsolutePath().toString() to find out, what Java resolves as a file.
Hi @rweisleder @finsterwalder ,
I was trying to pass the path of file as "Downloads\\Filename.pdf" and getting the error. I was able to successfully compare files when i passed the path of file as "C:\\Users\\sankalp.rao\\Downloads\\Filename.pdf". My apologies. I think as your rightly said, it was not able to find the file and thus that error.
I have closed this issue now. Thanks for your response. Appreciate it.
Cheers, Sankalp Rao
You're welcome!
Hi,
I'm getting the following message "WARN de.redsix.pdfcompare.PdfComparator - No files found to compare Tried Expected" even the PDF files were present in the path specified. Please make the call to writeTo method when trying to reproduce the issue. A similar issue (https://github.com/red6/pdfcompare/issues/36) report was closed with the comments unable to reproduce.
*Following is my piece of code to compare two sample PDF's:
` package com.cucumbercraft.framework.pdfcomparison;
import de.redsix.pdfcompare.CompareResult; import de.redsix.pdfcompare.PdfComparator;
import java.io.IOException;
public class PdfCompare { public static void main(String[] args) throws IOException {
}``
Following is the dependencies added to POM.xml
de.redsix pdfcompare 1.1.58