Am 13.11.2015 um 21:06 schrieb Sridhar So:
Thanks for reply, I tested with latest SNAPSHOT builds
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/preflight-app/2.0.0-SNAPSHOT/
  ------> build 1823
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/2.0.0-SNAPSHOT/
  ---------> build 1800 and 1801
  Font cache rebuild is not happening every time and it is able to use from local 
store, however build 1800 & 1801 requires Admin privilage.

Re admin priviledge, what OS and version are you using? What is the error message?

  Compared to PDFBox version 1.8.10, 2.0.0 SNAPSHOT builds performance is slow  
 ( 1.8.10 about 13 seconds, but 2.0.0 SNAPSHOT 1800, 1801 takes 30 seconds. )

  Measured the time difference between 1.8.10 and 2.0.0 SNAPSHOT builds with 
following code
  Getting 13 to 19 seconds in 1.8.10, whereas in 2.0.0SNAPSHOT builds 22 to 36 
seconds
long t1 = System.currentTimeMillis() ;
                        pdDocument = PDDocument.load(is);       
                        long t2 =  System.currentTimeMillis()  ;
                        PrinterJob job = PrinterJob.getPrinterJob();
                    job.setPageable(new PDFPageable(pdDocument));  //  Version 
2.0.0 SNAPSHOT builds
                        //job.setPageable(new PDPageable(pdDocument)); //  
Version 1.8.10
                    job.print();        
                        long t3 =  System.currentTimeMillis()  ;
                        //printWithPaper(pdDocument, "A4") ;
                        System.out.println ( " PDDocument load time = "  +
                                String.valueOf(t2 - t1) + " Printing Time =  " 
+ String.valueOf(t3-t2 ) +
                                " Total time = " + String.valueOf( (t3 - t1)/1000.0 ) + 
" seconds "  ) ;

Do we have
Performance fix available in 2.0.0 SNAPSHOTS, if so please give full path and 
which build?
Is there a fix available where  Admin privelage is not required?
Thanks a lot for your reply in advance.

No / No. However for the admin problem, there's a java environment variable that can be used. Here's how the place is chosen:

   private File getDiskCacheFile()
    {
        String path = System.getProperty("pdfbox.fontcache");
        if (path == null)
        {
            path = System.getProperty("user.home");
            if (path == null)
            {
                path = System.getProperty("java.io.tmpdir");
            }
        }
        return new File(path, ".pdfbox.cache");
    }

Maybe that will also solve the performance problem. (Although the fonts are only taken the first time)

Tilman

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to