PptxPageTextRegionMetadata Class
Represents a metadata node that stores text region of PPTX page.
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();
}
}
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