Create hyperlink to video from itext for android

1

Good morning.

Developing an app and using the itext library for android, I need to show the path of some videos in the generated pdf document, and when clicking on them, open the video player and play them.

They are videos stored locally.

At the moment in the pdf I can only show the route, but logically when you click on it, it does not reproduce anything from the pdf.

This is my piece of code concerning the problem:

      Font f6=new Font(Font.FontFamily.TIMES_ROMAN,15.0f, Font.BOLDITALIC|Font.UNDERLINE);
      Paragraph p6=new Paragraph("VIDEOS DE LA REUNIÓN:",f6);
      document.add(p6);
      document.add(new Paragraph(" "));


      for (File video:videos){


          document.add(new Paragraph(video.getAbsolutePath()));
          document.add(new Paragraph(" "));




      }

Can you think of an idea?

    
asked by Sergio Cv 15.11.2016 в 12:56
source

1 answer

0

You must create a Anchor and this is added to your document:

Anchor mylink = new Anchor("Mis Videos!");
mylink.setReference("http://www.mydomain.coo/myVideo.mp4");

you can add it within paragraph

Paragraph paragraph = new Paragraph();
paragraph.add(new Phrase("VIDEOS DE LA REUNIÓN:"));
paragraph.add(mylink);
    
answered by 15.11.2016 в 19:00