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.
Roughly speaking, you implement your ToolManager and Tool and call
PDFViewCtrl.setToolManager() when PDFViewCtrl is set up. This way,
PDFViewCtrl will send various events to your Tool. For your purpose, you
might want to use Tool.onSingleTapConfirmed() interface, in which you call
PDFViewCtrl.getAnnotationAt() to find the annotation where it is clicked. If
a custom annotation is clicked, you can start streaming the content. Note
that PDFViewCtrl is derived from android.view.ViewGroup, therefore you can
call PDFViewCtrl.addView() to add a widget for displaying a video.
It is worth mentioning that the SDK contains a library tools.jar, which is
an add-on of the bare bone PDFViewCtrl. It is based on the two interfaces
mentioned above and implements various GUI features such as text search,
text selection, annotation handling, form filing, etc. It is used by the
PDFViewCtrlDemo with the following two lines
pdftron.PDF.Tools.ToolManager tm = new
pdftron.PDF.Tools.ToolManager();
mPDFView.setToolManager(tm);
in PDFViewCtrlDemo.java. The source code of tools.jar is available to
licensed customers for full customization, but you are free to implement
your own.
Hi,
Regards,
Tino
--
You received this message because you are subscribed to the "PDFTron PDFNet
SDK" group. To post to this group, send email to sup...@pdftron.com
To unsubscribe from this group, send email to
pdfnet-sdk-...@googlegroups.com. For more information, please visit
us at http://www.pdftron.com
pdfnet-sdk-unsubscribe@googlegroups.com. For more information, please visit
us at http://www.pdftron.com