Free Support Forum - groupdocs.com

Melashu


#1
Hello ...groubdoc viewers family...

i meet a problem when i want to view document information for the given file which selected from JFilechooser ...the file contains 16 page (the file is pdf file) but the program will generate only the first two page so i don't know where the error
//defaultDirectory is default system diractory


ViewerConfig config=new ViewerConfig();
config.setStoragePath(defaultDirectory);
// config.setTempFolderName(defaultDirectory+"\\Temp");
ViewerHtmlHandler handler=new ViewerHtmlHandler(config);
JFileChooser jc=new JFileChooser();
if(jc.showOpenDialog(null)==JFileChooser.APPROVE_OPTION){
DocumentInfoContainer container=handler.getDocumentInfo(jc.getSelectedFile().getAbsolutePath());
for(PageData pd:container.getPages()){
System.out.println("Page Number is "+pd.getNumber());
System.out.println("Pahe Name is "+pd.getName());
}

}

The out Put will be:

Page Number is 1
Pahe Name is null
Page Number is 2
Pahe Name is null

Best Wishes

#2

@meshu102,


.the file contains 16 page (the file is pdf file) but the program will generate only the first two page so i don’t know where the error
Do you see any evaluation/limitation tag/message on the generated documents? If yes, you are facing this because you are in evaluation mode (using API without license). See limitations of the API when it is used without license here. The good this is you can get a temporary license in order to avail/evaluate full functionalities of the API. Please request a temporary license here.

Best wishes


#4
This exception was generate for docx file but not for pdf file :

Jul 17, 2017 5:01:59 PM java.util.prefs.WindowsPreferences
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.


#6

@meshu102,


Can you please share the problematic file and also tell us which version of the API you integrated in your project?

Thanks

#7

@meshu102,


In addition to our previous reply, we’d recommend you to clone/download our official example project and run it in your preferred IDE. You can get further help from readme of the project. We’d like to hear your experience.

Best wishes