Based on your description it seems that you want to support streaming external content which is different from embedded multimedia annotations (which is covered in the given article).
This is not supported by PDF spec, however nothing prevents you from customizing link annotation and extending your app to support this use case scenario.
Since you created annotation of type ‘e_Link’ and actions of Type ‘e_URI’ you could also add some custom entries in the annotation or action dictionary… For example:
pdftron.PDF.Action act = pdftron.PDF.Action.CreateURI(doc.GetSDFDoc());
pdftron.PDF.Annots.Link link = pdftron.PDF.Annots.Link.Create(doc.GetSDFDoc(), new Rect(85, 458, 503, 502), act);
pdftron.SDF.Obj dict = link.GetSDFObj();
dict.PutBool(“My multimedia annot”, true);
dict.PutName(“MyString”, “foo:bar, some parameter for streaming… if required etc”);
…
When a user taps on a link annotation you can identify the annotation that is clicked (tapped) on. This is done in the tools library which is provided in the source code form with a license purchase or using pdfview.GetAnnotaAt(x,y). You can identify your multimedia annotation by querying for the custom tag:
Annot a = …
pdftron.SDF.Obj my_tag = a.GetSDFObj().FindObj("My multimedia annot ");
if (my_tag != null && my_tag.GetBool()) {
string my_params = a.GetSDFObj().FindObj(“MyString”).GetName();
… use custom parameters and URL from associated action to stream remote data.
}
For streaming & playing remote multimedia you would use platform APIs which are available on both Android and iOS.
On Friday, March 30, 2012 9:53:48 AM UTC-7, Tino wrote:
Good day,
I am currently trialing out the PDFTron library for Android, with a
view to purchasing the licence once it meets our organisation’s needs.
I am trying to stream Youtube videos as well as other externally-
hosted video and audio clips. I have created PDFs with all these
annotations of type ‘e_Link’ and actions of Type ‘e_URI’. My question
is, is it possible to embed a video/audio clip that is not on the
device using the URL? If so, can you please point me to the right
direction. I also need to know if it is possible to add click handlers
to annotations so that if I click on an annotation, I can trigger a
new Activity or View.
I have tried an example that I saw on the internet about embedding
flash videos (http://groups.google.com/group/pdfnet-sdk/msg/
be4edb9ca95ccf99), but I am getting a RuntimeException which I cannot
understand. I am getting this exception message: ‘re-throw on
exception class missing constructor’. It doesn’t say much about the
root of the error and there is no stack trace. The error is thrown
once my code hits the ‘FileSpec fs = FileSpec.create(doc, mediaFile,
true);’ line.
Your help is greatly appreciated.
Regards,
Tinotenda Mundangepfupfu