Create a new FullFileSpecificationElement.




FullFileSpecificationElement(Atom atom, IndirectObject host)
FullFileSpecificationElement(IndirectObject obj)
FullFileSpecificationElement(Element relation, CreationOptions options)

[Visual Basic]
FullFileSpecificationElement(atom As Atom, host As IndirectObject)
FullFileSpecificationElement(obj As IndirectObject)
FullFileSpecificationElement(relation As Element, options As CreationOptions)



Name Description
atom The Atom to be assigned to this Element.
host An IndirectObject. This can be any IndirectObject from the Soup but ideally should be one closely associated with the Atom.
obj The IndirectObject to be assigned to this Element.
relation An Element. This can be any Element in the Soup but ideally should be one closely associated with this Element.
options Options related to creation. For example this allows you to determine whether the Element should be created using an IndirectObject rather than just an Atom. If not provided a default set of options is used.




Create a new FullFileSpecificationElement.

The different constructors allow different ways of creating an Element. Some are used for wrapping existing Atoms or IndirectObjects and others are for creating new ones.

The constructor taking a relation Element creates a new object in the document - it is typically the constructor you will want to use. Do not specify creation options unless you have very specific needs.

However for your first Element - one you can use as a relation for the others - you will need to wrap an existing IndirectObject inside an Element. For this you might use code of the following form "CatalogElement root = new CatalogElement(doc.ObjectSoup.Catalog)".

The parameterless constructor allows you to create an empty Element. By empty we mean it has no contents - no Atom within it. So before use an Atom must be Assigned or Created. In practice it is easiest to do this using one of the other constructors.

The atom and host constructor is used to wrap an existing Atom. It creates an Element and then Assigns the Atom to it. The result is a specialized Element which can be used to examine or modify the contents of the Atom.

The CreationOptions enumeration may take the following values:

  • Default - Default creation options for this particular type of Element.
  • Indirect - Create Element containing an IndirectObject.
  • Direct - Create Element containing an Atom.




This code snippet is taken from Annotations.cs line 1584 in the Annotations example project.

bool isUrl = filePathOrUrl.StartsWith("http://", StringComparison.OrdinalIgnoreCase)
  || filePathOrUrl.StartsWith("https://", StringComparison.OrdinalIgnoreCase)
  || filePathOrUrl.StartsWith("rtmp://", StringComparison.OrdinalIgnoreCase);
if (contentType == null) {
  int end = -1;
  if (isUrl)
    end = filePathOrUrl.IndexOfAny(new char[] { '?', '#' });
  if (end < 0)
    end = filePathOrUrl.Length;
  contentType = GetContentType(filePathOrUrl, end);
  if (contentType == null)
    throw new NotSupportedException("Movie content type is not supported.");

ScreenAnnotationElement annot = new ScreenAnnotationElement(AnnotationElement.Object);
annot.EntrySubtype = "Screen";
annot.EntryRect = new RectangleElement(ArrayAtom.FromXRect(new XRect(rect)), annot.Host);

FullFileSpecificationElement fileSpec = new FullFileSpecificationElement(annot);
fileSpec.EntryType = "Filespec";
if (isUrl) {
  fileSpec.EntryFS = "URL";
  fileSpec.EntryF = filePathOrUrl;
else {
  FileInfo fileInfo = new FileInfo(filePathOrUrl);
  fileSpec.EntryF = fileInfo.Name;
  fileSpec.EntryUF = fileInfo.Name;
  fileSpec.EntryEF = new EmbeddedFileSetElement(annot);
  fileSpec.EntryEF.EntryF = EmbedFileStream(fileInfo);

MediaClipDataElement mediaClip = new MediaClipDataElement(annot, CreationOptions.Indirect);
mediaClip.EntryS = "MCD";
mediaClip.EntryP = new MediaPermissionsElement(annot);
mediaClip.EntryP.EntryTF = "TEMPACCESS";
mediaClip.EntryCT = contentType;
mediaClip.EntryD = fileSpec;

MediaRenditionElement rendition = new MediaRenditionElement(annot, CreationOptions.Indirect);
rendition.EntryS = "MR";
rendition.EntryC = mediaClip;

RenditionActionElement pageVisibleAction = new RenditionActionElement(annot, CreationOptions.Indirect);
pageVisibleAction.EntryS = "Rendition";
pageVisibleAction.EntryOP = 4;
pageVisibleAction.EntryAN = annot;
pageVisibleAction.EntryR = rendition;

annot.EntryAA = new AnnotationAdditionalActionsElement(annot);
annot.EntryAA.EntryPV = pageVisibleAction;
AnnotationElement = annot;

Dim isUrl As Boolean = filePathOrUrl.StartsWith("http://", StringComparison.OrdinalIgnoreCase) OrElse filePathOrUrl.StartsWith("https://", StringComparison.OrdinalIgnoreCase) OrElse filePathOrUrl.StartsWith("rtmp://", StringComparison.OrdinalIgnoreCase)
If contentType Is Nothing Then
  Dim [end] As Integer = -1
  If isUrl Then
    [end] = filePathOrUrl.IndexOfAny(New Char() { "?"c, "#"c })
  End If
  If [end] < 0 Then
    [end] = filePathOrUrl.Length
  End If
  contentType = GetContentType(filePathOrUrl, [end])
  If contentType Is Nothing Then
    Throw New NotSupportedException("Movie content type is not supported.")
  End If
End If

Dim annot As New ScreenAnnotationElement(AnnotationElement.Object)
annot.EntrySubtype = "Screen"
annot.EntryRect = New RectangleElement(ArrayAtom.FromXRect(New XRect(rect)), annot.Host)

Dim fileSpec As New FullFileSpecificationElement(annot)
fileSpec.EntryType = "Filespec"
If isUrl Then
  fileSpec.EntryFS = "URL"
  fileSpec.EntryF = filePathOrUrl
  Dim fileInfo As New FileInfo(filePathOrUrl)
  fileSpec.EntryF = fileInfo.Name
  fileSpec.EntryUF = fileInfo.Name
  fileSpec.EntryEF = New EmbeddedFileSetElement(annot)
  fileSpec.EntryEF.EntryF = EmbedFileStream(fileInfo)
End If

Dim mediaClip As New MediaClipDataElement(annot, CreationOptions.Indirect)
mediaClip.EntryS = "MCD"
mediaClip.EntryP = New MediaPermissionsElement(annot)
mediaClip.EntryP.EntryTF = "TEMPACCESS"
mediaClip.EntryCT = contentType
mediaClip.EntryD = fileSpec

Dim rendition As New MediaRenditionElement(annot, CreationOptions.Indirect)
rendition.EntryS = "MR"
rendition.EntryC = mediaClip

Dim pageVisibleAction As New RenditionActionElement(annot, CreationOptions.Indirect)
pageVisibleAction.EntryS = "Rendition"
pageVisibleAction.EntryOP = 4
pageVisibleAction.EntryAN = annot
pageVisibleAction.EntryR = rendition

annot.EntryAA = New AnnotationAdditionalActionsElement(annot)
annot.EntryAA.EntryPV = pageVisibleAction
AnnotationElement = annot