Hi,
We are using Open Office UNO for pdf conversion. I want to check the size of the pdf file.
I need to compare the size of 2 pdfs. How can I do??
Please suggest. Thanks in Advance.
Printable View
Hi,
We are using Open Office UNO for pdf conversion. I want to check the size of the pdf file.
I need to compare the size of 2 pdfs. How can I do??
Please suggest. Thanks in Advance.
Thank You Jos,
I did one mistake(forgot to mention the extension). Its working using file.length().
Its giving 1kb less for each pdf. I can able to resolve the issue now.
Hi Jos, Please find the code snippet I used to get the size of the file.
test.pdf is originally 9kb. It gives the size as 8kb.Code:File file = new File("C:/test.pdf");
long filesize = file.length();
System.out.println("1:::" +filesize);
long filesizeInKB = filesize / 1024;
System.out.println("Size of File is: " + filesizeInKB + " KB");
same for all files.
I need to compare pdf files. So it won't be a problem for me.
Thanks
Ever heard of truncation in integer division?
db