How to read HyperLinks from pdf file??

hi developer's,
I am in PDF processing... I am having doubt in that Processing.
How to read Hyperlinks from PDF file?
I can able to set the hyperlink.. But i cant able to get the hyperlinks..
The following example program will set the hyperlink to the PDF file using lowagie API..
import com.lowagie.text.Anchor;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.html.HtmlWriter;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfWriter;
public class Argu1 {
     public static void main(String[] args) {
          Document document = new Document();
          try {
               PdfWriter pdf = PdfWriter.getInstance(document,
                         new FileOutputStream("PageLink.pdf"));
PdfReader pdf_read=new                
               document.open();
               document.add(new Paragraph("Hi Everbody....!"));
               Anchor pdfRef = new Anchor("Click Me");
               pdfRef.setReference("www.java2s.com");
               Anchor rtfRef = new Anchor("Touch Me");
               rtfRef.setReference("www.sun.com");
               System.out.println(rtfRef.reference());
               document.add(pdfRef);
               document.add(Chunk.NEWLINE);
               document.add(rtfRef);
          } catch (DocumentException de) {
               System.err.println(de.getMessage());
          } catch (IOException ioe) {
               System.err.println(ioe.getMessage());
          document.close();
Help me how to read the Hyperlinks from the PDF file using java ...
Thanks in advance,
With Regards,
J.Imran

Instead of cross-posting unformatted code you could have taken a look at the API, because there you might have come across a method named getLinks...Even though it's not documented, I really suspect that it will return the Hyperlinks on a given page.

Similar Messages

  • How to read Hyperlinks in pdf???

    hi developer's,
    I am in PDF processing... I am having doubt in that Processing.
    How to read Hyperlinks from PDF file?
    I can able to set the hyperlink.. But i cant able to get the hyperlinks..
    The following example program will set the hyperlink to the PDF file using lowagie API..
    import com.lowagie.text.Anchor;
    import com.lowagie.text.Chunk;
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.Paragraph;
    import com.lowagie.text.html.HtmlWriter;
    import com.lowagie.text.pdf.PdfReader;
    import com.lowagie.text.pdf.PdfWriter;
    public class Argu1 {
         public static void main(String[] args) {
              Document document = new Document();
              try {
                   PdfWriter pdf = PdfWriter.getInstance(document,
                             new FileOutputStream("PageLink.pdf"));
    PdfReader pdf_read=new                
                   document.open();
                   document.add(new Paragraph("Hi Everbody....!"));
                   Anchor pdfRef = new Anchor("Click Me");
                   pdfRef.setReference("www.java2s.com");
                   Anchor rtfRef = new Anchor("Touch Me");
                   rtfRef.setReference("www.sun.com");
                   System.out.println(rtfRef.reference());
                   document.add(pdfRef);
                   document.add(Chunk.NEWLINE);
                   document.add(rtfRef);
              } catch (DocumentException de) {
                   System.err.println(de.getMessage());
              } catch (IOException ioe) {
                   System.err.println(ioe.getMessage());
              document.close();
    Help me how to read the Hyperlinks from the PDF file using java ...
    Thanks in advance,
    With Regards,
    J.Imran

    Instead of cross-posting unformatted code you could have taken a look at the API, because there you might have come across a method named getLinks...Even though it's not documented, I really suspect that it will return the Hyperlinks on a given page.

  • How to read data from a file that was formatted by excel?

    Hi everyone, I'm familiar with java.io and the ability to read from files, can anyone tell me how to read data from a file that was formatted by excel? Or at least give me some web references so that I can learn about it?

    http://jakarta.apache.org/poi/hssf/index.html
    HSSF stands for Horrible Spreadsheet Format, but it still works!

  • How to open hyperlink of PDF file uploaded at SharePoint(hosted at Office365) in 'Adobe Acrobat' for annotation and comments.

    Hi,
    I've a hyperlink of PDF file which is uploaded under SharePoint Document library(hosted at Office365 E1) on my custom '../SitePages/Approver.aspx'. Once user click on that hyperlink it should ask me to "Check-Out & Open' pdf file directly from sharePoint document library then it should automatically gets opened into 'Adobe Acrobat' where user will do some annotation/ comments in that pdf file & again 'Check-In' back his changes to SharePoint Document library.
    Following article will explain how I want to Check-In & Check-Out  pdf files from SharePoint document library once i click hyperlink on my '../SitePages/Approver.aspx' page.
    acrobatusers.com/tutorials/how-to-work-with-sharepoint-and-office-365
    Please let me know how to achieve this functionality using office 365.
    Your assistance would be greatly appreciated as this is top-priority requirement for us.
    Yours sincerely,
    Mahesh Sherkar
    [signature deleted by host]

    For instance, the forms.conf file:
    # Virtual path mapping for Forms Java jar and class files (codebase)
    AliasMatch ^/forms/java/(..*) "D:\Oradev/forms/java/$1"
    # Virtual path for JInitiator downloadable executable and download page
    AliasMatch ^/forms/jinitiator/(..*) "D:\Oradev/jinit/$1"
    # Virtual path for runform.htm (used to run a form for testing purposes)
    AliasMatch ^/forms/html/(..*) "d:\oradev/tools/web/html/$1"
    # Virtual Path for icons
    AliasMatch ^/forms/icons/(..*) "d:\icons/$1"
    ...you can move your files in one of the existing physical directories - e.g: d:/icons - and call them with the following:
    Web.show_Document('/forms/icons/document.pdf','_blank');But you can also add your own virtual/physical directory:
    # Virtual Path for documents
    AliasMatch ^/forms/documents/(..*) "d:\documents/$1"
    ...with the following code:
    Web.show_Document('/forms/documents/document.pdf','_blank');Francois

  • How to read data from a file in OSB

    hi guys,
    Recently, I've got a problem with reading file from specific location. I've actually followed this post OSB 11g - Read or Poll File in OSB - Oracle Fusion Middleware Blog, and then
    I know how to read a file. However, it does not as expected. Because, I've found no way to read data from the file. Therefore, no chance to manipulate the data like assigning to a variable, or extracting ....
    Hence, is there any way to read data from file by using proxy service in OSB ??? No Java code ???
    by the way, supposed that there is no way to read data from a file in OSB. So, What purposes will the way in the post above be used for?
    Many thanks in advance

    http://jakarta.apache.org/poi/hssf/index.html
    HSSF stands for Horrible Spreadsheet Format, but it still works!

  • How to Read data From Excel File in Labview 8.5?

    We can read it from xls file, but it is encrypted..... we need exact data...

    i have attached that excel file...i want to extract the full data from that file..how i can read it...when i read by using "Read from spreadsheet file" function, data was in encrypted form....so please send me the correct way...
    Attachments:
    stn_auto.xls ‏40 KB

  • How to read tags from pdf to print in different printers (PCL or PS)

    Hello from Spain.. I would apreciate some help who to read tags from pdf to discriminate PDF Production tag for send print PDF to printer job using driver PCL or PS. I get trubles when print PDFs files made by PDFcreator (Ghostscript, intermediate PDF from PS) in PCL job printer. I need to eval tags from PDF for send command line os javascript inside Adobe Acrobat to print in the correct job printer: PCL or PS...
    Thanks.

    As noted you cannot access the "Tag" of a PDF but you can access the meta data of a PDF and one of the items recorded in the meta data is the "producer". This meta data tag is supposed contain the name of the program that produced the PDF. One can access this through the "info" property or the "metadata" property of the doc object.
    var cProducer = this.info.Producer; // get the producer application for this PDF;
    console.show();
    console.clear();
    console.println("This PDF was created by " + cProducer);
    Be aware that the user can easily modify the Producer information with Acrobat, JavaScript, or other application after the PDF has been created.

  • How can I read content from PDF file stored in Oracle 9i XMLDB

    Hi Friends:
    Now I have met one question that I don`t know how to read some String , for example "Hello", from the PDF file stored in the Oracle 9i XMLDB, I have stored that PDF file into the XMLDB now, any suggestions are appriciated . Thank you in advance.

    You may be able to do something with Oracle Text. The following shows how to get an HTML rendiditon of a binary document. I think you can also get plain text instead of HTML
    set echo on
    spool xfilesUtilties.log
    connect sys/&1 as sysdba
    grant ctxapp to &2
    connect &2/&3
    begin
      ctxsys.ctx_ddl.create_policy(policy_name=>'XFILES_HTML_GENERATION', filter=>'ctxsys.auto_filter');
    end;
    create or replace package xfiles_internal_11010
    authid definer
    as
      function renderAsHTML(sourceDoc BLOB) return CLOB;
    end;
    show errors
    create or replace package body xfiles_internal_11010
    as
    function renderAsHTML(sourceDoc BLOB)
    return CLOB
    as
      html_content CLOB;
    begin
      dbms_lob.createTemporary(html_content,true,DBMS_LOB.SESSION);
      ctx_doc.policy_filter(policy_name => 'XFILES_HTML_GENERATION',
                            document => sourceDoc,
                            restab => html_content,
                            plaintext => false);
      return html_content;
    end;
    end;
    show errors
    create or replace package xfiles_utilities_11010
    authid current_user
    as
      HOME_FOLDER   constant varchar2(700) := xdb_constants.HOME_FOLDER;
      PUBLIC_FOLDER constant varchar2(700) := xdb_constants.PUBLIC_FOLDER;
      function renderAsHTML(sourceFile VARCHAR2) return CLOB;
      function transformToHTML(xmldoc XMLType, xslPath VARCHAR2) return CLOB;
    end;
    show errors
    create or replace package body xfiles_utilities_11010
    as
    function renderAsHTML(sourceFile VARCHAR2)
    return CLOB
    as
    begin
      return xfiles_internal_11010.renderAsHTML(xdburitype(sourceFile).getBLOB());
    end;
    function transformToHTML(xmldoc XMLType, xslPath VARCHAR2)
    return CLOB
    as
      html clob;
    begin
      select xmldoc.transform(xdburitype(xslPath).getXML()).getClobVal()
        into HTML
        from dual;
      return html;
    end;
    end;
    show errors
    grant execute on xfiles_utilities_11010 to public
    create or replace public synonym xfiles_utilities for xfiles_utilities_11010
    quitMessage was edited by:
    mdrake

  • How to read data from PDF and HTML  file

    I have got solution to read text form .txt file but did'nt get code for PDF and HTML.
    I dont want to convert PDF to txt.
    Please help me ...

    ah crap i could have guessed there would be a crosspost only the forum in where the crosspost is made is abit funny
    To OP: DO NOT CROSSPOST
    http://forum.java.sun.com/thread.jspa?threadID=5267875&tstart=0

  • How to read text from PDF and HTML

    I have got solution to read text form .txt file but did'nt get code for PDF and HTML.
    I dont want to convert PDF to txt.
    Please help me ...

    reading from a file is always the same. using the same strategy used for a .txt will allow you to read a .pdf file.
    Offcourse in itself it will be useless becuase pdf files have a special internal structure.
    html files are identical to txt files.
    What are you trying to accomplisch with the files you are reading ?

  • How to read and write PDF files

    I need to read pdf file and get information about its pagenumbers and format and permission allowed ...........
    then i want to ghange some of this attribute ....................
    how can do this ....................and what's API i have to use.......................

    http://www.pdfbox.org/
    regards

  • HELP!!!!   How to read data from a file at time to time?

    i store temporary string data in a file(the data changes always), and i need to read the data in the file from time to time, so how can i read from the file like every 5 seconds?

    Please i need your help mr. noahw. i have a timer called timer1 inside that timer i am starting a thread to read the data in a file to me, then i have another timer timer 2 in which it takes the data already read from timer 1 and draws them on a GUI. the problem with me is that, i am unable to set a correct time for each of the two timers such that, every time timer one executes that is a new data is generated i need to draw only one figure coreesponding to those data, then when a new set of data is read i need to draw another figure based on the new data read, please help me with this becasue i need it urgently, this is my email, [email protected], and i can offer this reply as many points as you want if this helps you to help me, i am counting on you.

  • How to read data from a file

    I have a file that looks like this with out the *'s
    lastName firstName number
    lastName firstName number2
    lastName firstName number3
    lastname = (string) an actual last name like smith same for first name
    number = an actual number (int) like 90 or 120
    I need to read the number from this file and store it in an array. I have some code that I started, but im not sure what to do next. Please help!
    //int searchId;
         int fileData;
         vector <int> employeeIds;
         //cout<<"Enter Employee ID: ";
         //cin>>searchId;
         ifstream dataFile("Small-Database.txt");
         dataFile >> fileData;
         while(!dataFile.eof())
               //this is where i need help, how can i read in a number. i tried using the getLine() function but it did not help
              //employeeIds.push_back(fileData);
              //dataFile >> fileData;
         dataFile.close();Thank you for any help in advance

    The >> operator reads a value corresponding to the target type. For example, to read an integer value, read it into an int variable (or long or long long, depending on the integer range).
    The >> operator skips white space (blanks, tabs, newlines) and then reads characters corresponding to the target type: digits for an integer value, for example. It stops at the first character that cannot be in the representation of the type. If no characters are read, the stream goes into an error state, and further I/O requests are ignored until you clear the stream state.
    You can read each group of data like this:
    std::string first, last;
    int number;
    dataFile >> first >> last >> number;If the data doesn't have the right characteristics, the stream will go into an error state, which you can detect by testing the stream directly:
    if( dataFile ) ...Using EOF as the loop control is not a good idea, since if there is an error, the loop will never terminate. You can do something like this:
    while( dataFile ) {
        std::string first, last;
        int number;
        dataFile >> first >> last >> number;
        if( dataFile ) {
            // ... add first, last, number to the data structure
    } Reading past EOF puts the stream in an error state, so checking the stream state before saving the data and in the loop control will do the trick.
    You can use a char array instead of a string for the names, but then you have to add extra testing to be sure you don't overflow the array, and deal with the extra characters you don't read. Strings will expand as needed. The string is declared as a local variable in the loop, so it gets re-initialized each time through; you don't need to write code to reset it.
    My example loop is not robust in the face of errors. Stream I/O works fine when you know the input data is well-formed. It is not suited to input that can be wrong, such as data typed from the terminal, because it is not easy to validate the input and recover from errors.

  • How to read data from txt file respectively

    Hi,
    I am triying to form an equation between two known points. I want to do this with the attached VI, the most critical point is that I will read the x1, y1, x2 and y2 coordinates from the same .txt file. They will be written in a .txt file and I will send them to the appropriate channel (x1, y1, x2 and y2) respectively. How can I get data in a rule from a .txt file?
    Could anyone please help me with this issue,
    Best regards. 
    Attachments:
    read from txt file.vi ‏8 KB

    Dear RavensFan,
    Thank you very much for your helps, I am bit new to labview so I usually can not find the appropriate functions easily. And a new problem has rised in my application. I should write the A, B and C numbers in the respective series to the file 2.txt. I am able to write them in a straight forward case but I want to write the next triples (A B C) in the next row. Like this;
    A1 B1 C1
    A2 B2 C2
    A3 B3 C3
    So how can I put new line constant and space constant to my VI? 
    Waiting for your valuable helps,
    Best regards,
    Attachments:
    read_from_txt_fileMOD.vi ‏18 KB

  • How to Read data from excel file without converting a excel file into .csv or any other format

    Hello,
    Can somebody suggest me how to read from an excel file (consisting of 10 work sheets) to an array?
    Thanks,
    She

    You have to be careful when using the spreadsheet-files vi's.  They are located in the Functions Palette under File IO, you will find "Write To / Read From Spreadsheet File.vi"s. 
    Here is what the Context Help says about the vi function:
    "Reads a specified number of lines or rows from a numeric text file beginning at a specified character offset and converts the data to a 2D, single-precision array of numbers. You optionally can transpose the array. The VI opens the file before reading from it and closes it afterwards. You can use this VI to read a spreadsheet file saved in text format. This VI calls the Spreadsheet String to Array function to convert the data. "
    This is quick & easy when the spreadsheet is all the same format.  You can set the format to string as well.  HOWEVER...  you do have to convert the Excel spreadsheet to text before using it.
    I haven't experimented with the Active-X, but it may look as the way to go if you have combination text / numeric values in the spreadsheet.
    If you did convert it to text, then you can use array functions as well and treating the file as an array of strings (see very brief example attached).  The example is to illustrate a point only  
    JLV
    Attachments:
    starting point for spreadsheet.vi ‏28 KB

Maybe you are looking for

  • Itunes 7.0 downloaded but won't install

    I was able to download itunes 7.0 but not able to open it. My powerpoint program gives me a not valid powerpoint program message. Any suggestions?

  • Mirror iPad to apple tv

    How do I mirror iPad to apple tv

  • Suggestions on video converter for MacBook?

    Hi all, Was wondering if I might pick the brains of the other mac users out there...I'm trying to find out what the best software is for video file conversion between formats - most notably video files to DVD format, for Mac. From what I can see, iSk

  • ClassLoader only loads root directory class???

    I tried to load an external class in Java application, but I found out I can only put the external class in root directory C:\ Otherwise, it will throw class not found exception. any ideas??? ClassLoader loader = new PluginClassLoader(Integer.parseIn

  • JSP coding conventions document?

    All, I'm teaching a spring 2004 courses on JSP at Park University and I'd like to have a coding conventions document. I have one for my Java, HTML, and C++ courses and they're very helpful. In doing a Google search, I found this Sun article: http://j