I am working with project in which I am handling PDF file in order to verify the valies generated in report but, when I opened it on chrome as well as in adobe pdfviewer it feels little off: pic:
As you can see in both of the mediums the column after "Alaram Value" i.e "Low Limit" isn't visible very well. So I decided to view it in java using PDFBox.Using PDFBox in java I view it in java there too the output was shady
Here too if you can see the value after "Alarm Value " i.e "Low Value" isn't rendered aptly P.S: Console O/P is of the same page as shown in the above screenshots. So is there anyway to handle this scenario and also is there any way to validate the rendered pdf/ validate the downloaded pdf is corrent or not
Java Code:
File file = new File(System.getProperty("user.dir") + "//Download//" + "random" + ".pdf");
if (file.exists()) {
System.out.println("Its"+true );
PDDocument doc = PDDocument.load(file);
PDFTextStripper pdfStripper = new PDFTextStripper();
pdfStripper.setStartPage(1);
pdfStripper.setEndPage(1);
int count = doc.getNumberOfPages();
PDDocumentInformation pdd = doc.getDocumentInformation();
System.out.println("tile"+pdfStripper.getText(doc));
System.out.println(count);
doc.close();
}
POM.xml:
<!-- https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.27</version>
</dependency>
</dependencies>
Please help me if you can