Results 1 to 7 of 7
  1. #1
    swati1028 is offline Member
    Join Date
    Jul 2014
    Posts
    4
    Rep Power
    0

    Default PDFBox related question

    Hi ,

    I want to get the time elapsed while opening a pdf file . I am not able to find a way to do it using PDFBox, Is there any way using which I can create a PDDocument in my java program and use some API to launch the PDF file and measure the time elapsed in opening it.

    Thanks.
    Swati

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,784
    Blog Entries
    7
    Rep Power
    21

    Default Re: PDFBox related question

    Something like this?

    Java Code:
    long start= System.currentTimeMillis();
    // open your pdf document here
    long duration= System,currentTimeMillis()-start;
    kind regards,

    Jos (<--- Einstein)
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    swati1028 is offline Member
    Join Date
    Jul 2014
    Posts
    4
    Rep Power
    0

    Default Re: PDFBox related question

    Hi Jos,

    Thanks for that , but I was trying to seek what API could be used to open the PDF document through my java code.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,784
    Blog Entries
    7
    Rep Power
    21

    Default Re: PDFBox related question

    Quote Originally Posted by swati1028 View Post
    Hi Jos,

    Thanks for that , but I was trying to seek what API could be used to open the PDF document through my java code.
    That was not your question: you asked how much time it took to open a pdf document, suggesting that you already knew how to open the document. Read the API documentation of PDFBox for that.

    kind regards,

    Jos

    edit: or else see what the Desktop class can do for you.
    Last edited by JosAH; 07-27-2014 at 06:27 PM.
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    swati1028 is offline Member
    Join Date
    Jul 2014
    Posts
    4
    Rep Power
    0

    Default Re: PDFBox related question

    Okay , yeah I wrote my query in quite an unclear way . I read documentation for PDFBox documentation but couldn't find the API for open the doc.
    Yeah , Desktop class looks quite useful , will try with it .

    Thanks

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,784
    Blog Entries
    7
    Rep Power
    21

    Default Re: PDFBox related question

    I googled for the API documentation and the PDFPagePanel would be the approach I would take (I know nothing about PDFBox).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    swati1028 is offline Member
    Join Date
    Jul 2014
    Posts
    4
    Rep Power
    0

    Default Re: PDFBox related question

    Yeah , PDFPagePanel could be used , however it is for displaying a particular set of pages , I am currently experimenting if the display of all pages using pagepanel and displaying the entire PDF file using desktop class would be equivalent or not ( ignoring the extra time involved for using Desktop apart from fetching the pages) in the context I am trying to use this.

    Thanks

Similar Threads

  1. String related java question
    By Katnopic in forum New To Java
    Replies: 3
    Last Post: 09-07-2012, 03:31 PM
  2. Replies: 8
    Last Post: 08-11-2012, 08:18 PM
  3. Replies: 1
    Last Post: 04-27-2012, 08:14 AM
  4. Question related to JSTL attributes
    By neerajrathi2 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 01-31-2012, 08:32 PM
  5. Question related to htmlParser
    By java_org_bsb in forum New To Java
    Replies: 1
    Last Post: 02-01-2009, 03:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •