VintaSoft Imaging .NET SDK 15.2: Documentation for .NET developer
Vintasoft.Imaging.Metadata Namespace / PptxPageTextRegionMetadata Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
PptxPageTextRegionMetadata Class
In This Topic
Represents a metadata node that stores text region of PPTX page.
Object Model
MetadataNode MetadataNodeList PptxPageTextRegionMetadata
Syntax
'Declaration

Public Class PptxPageTextRegionMetadata
   Inherits OpenXmlPageTextRegionMetadata

public class PptxPageTextRegionMetadata : OpenXmlPageTextRegionMetadata

Example

Here is an example that shows how to extract text for all pages of PPTX document from the metadata tree:


''' <summary>
''' Extracts text of PPTX page from metadata tree.
''' </summary>
''' <param name="pptxFilename">A name of PPTX file.</param>
Public Shared Sub ExtractPptxPageTextFromMetadataTree(pptxFilename As String)
    ' create image collection
    Using images As New Vintasoft.Imaging.ImageCollection()
        ' add PPTX document to the image collection
        images.Add(pptxFilename)

        ' for each image in collection
        For i As Integer = 0 To images.Count - 1
            ' get image
            Dim image As Vintasoft.Imaging.VintasoftImage = images(i)

            ' get PptxPageTextRegionMetadata object from the metadata tree of image
            Dim pptxPageTextRegionMetadata As Vintasoft.Imaging.Metadata.PptxPageTextRegionMetadata = image.Metadata.MetadataTree.FindChildNode(Of Vintasoft.Imaging.Metadata.PptxPageTextRegionMetadata)()
            ' if PptxPageTextRegionMetadata object is found
            If pptxPageTextRegionMetadata IsNot Nothing Then
                ' get the text region from the PptxPageTextRegionMetadata object
                Dim textregion As Vintasoft.Imaging.Text.TextRegion = pptxPageTextRegionMetadata.GetTextRegion()
                ' if text region is found
                If textregion IsNot Nothing Then
                    ' show information about text region
                    System.Console.WriteLine(String.Format("Page {0}, Text={1}", i, textregion.TextContent))
                End If
            End If
        Next

        images.ClearAndDisposeItems()
    End Using
End Sub


/// <summary>
/// Extracts text of PPTX page from metadata tree.
/// </summary>
/// <param name="pptxFilename">A name of PPTX file.</param>
public static void ExtractPptxPageTextFromMetadataTree(string pptxFilename)
{
    // create image collection
    using (Vintasoft.Imaging.ImageCollection images = new Vintasoft.Imaging.ImageCollection())
    {
        // add PPTX document to the image collection
        images.Add(pptxFilename);

        // for each image in collection
        for (int i = 0; i < images.Count; i++)
        {
            // get image
            Vintasoft.Imaging.VintasoftImage image = images[i];

            // get PptxPageTextRegionMetadata object from the metadata tree of image
            Vintasoft.Imaging.Metadata.PptxPageTextRegionMetadata pptxPageTextRegionMetadata =
                image.Metadata.MetadataTree.FindChildNode<Vintasoft.Imaging.Metadata.PptxPageTextRegionMetadata>();
            // if PptxPageTextRegionMetadata object is found
            if (pptxPageTextRegionMetadata != null)
            {
                // get the text region from the PptxPageTextRegionMetadata object
                Vintasoft.Imaging.Text.TextRegion textregion = pptxPageTextRegionMetadata.GetTextRegion();
                // if text region is found
                if (textregion != null)
                {
                    // show information about text region
                    System.Console.WriteLine(string.Format("Page {0}, Text={1}", i, textregion.TextContent));
                }
            }
        }

        images.ClearAndDisposeItems();
    }
}

Inheritance Hierarchy

System.Object
   Vintasoft.Imaging.Metadata.MetadataNode
      Vintasoft.Imaging.Metadata.PageContentMetadata
         Vintasoft.Imaging.Metadata.TextRegionMetadata
            Vintasoft.Imaging.Metadata.OpenXmlPageTextRegionMetadata
               Vintasoft.Imaging.Metadata.PptxPageTextRegionMetadata

Requirements

Target Platforms: .NET 11; .NET 10; .NET 9; .NET 8; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also