ImageInformation3D

Represents image's information of an 3D image in the document.

public class ImageInformation3D
Public Class ImageInformation3D

Inheritance: ObjectImageInformation3D

Licensing Info

This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

The following example shows accessing the 3D image information from a PDF document.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
     
Module MyModule
     		
    Sub Main()
     		
        ' Create a PdfdDocument object using the source pdf document
        Dim MyPdfDocument As PdfDocument = New PdfDocument(inputFilePath)
     	
        ' Get the 3D information from the pdfDocument
        Dim MyImageInfoList() As ImageInformation3D = MyPdfDocument.Get3DImages()
        Dim i As Int32
        For i = 0 To imageInfoList.Length - 1

            ' Set the Extracted3DImageData to Get3DImage() method from the MyImageInfoList
        	Dim MyExtracted3DImageData As Extracted3DImageData = MyImageInfoList(i).Get3DImage()

            ' Get the Width
        	Dim width As Int32 = MyImageInfoList(i).Width

            ' Get the Height
        	Dim height As Int32 = MyImageInfoList(i).Height

            ' Get the BitsPerComponent
        	Dim bitPerPixel As Int32 = MyImageInfoList(i).BitsPerComponent

            ' Get the PixelFormat
        	Dim pixFormat As PixelFormat = MyImageInfoList(i).PixelFormat

            ' Gets true if the image info list has transperency
        	Dim trans As Boolean = MyImageInfoList(i).HasTransperency

        	Dim extension As String = ".u3d"
        	If (MyExtracted3DImageData.ImageType3D = Extracted3DImageType.U3D) Then
            	extension = ".u3d"
        	Else
            	extension = ".prc"
        	End If

        	MyImageInfoList(i).Get3DImage(("MyImage" + (i + 1).ToString() + extension), False)

            ' Set the ExtractedImageData to GetPosterImage() method from the MyImageInfoList
        	Dim extractedImageData As ExtractedImageData = MyImageInfoList(i).GetPosterImage()
        	Dim baseData() As Byte

            Dim baseExtension As String = ""
            If (extractedImageData.ImageType = ExtractedImageType.Jpeg) Then
                baseExtension = ".jpg"
            Else
                baseExtension = ".png"
            End If
            baseData = extractedImageData.Data
            Dim outputPath1 As String = ("BaseImage" + (i + 1).ToString() + baseExtension)

            'Save the output
            File.WriteAllBytes(outputPath1, baseData)
        Next

     		
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

public class Example
{
    public static void CreatePDF(string outputPath, string inputFilePath)
    {
        // Create a PdfdDocument object using the source pdf document
        PdfDocument pdfDocument = new PdfDocument(inputFilePath);

        // Get the 3D information from the pdfDocument
        ImageInformation3D[] imageInfoList = pdfDocument.Get3DImages();

        for (int i = 0; i < imageInfoList.Length; i++)
          {        
                // Set the Extracted3DImageData to Get3DImage() method from the imageInfoList
                Extracted3DImageData extracted3DImageData = imageInfoList[i].Get3DImage();

                // Get the Width
                int width = imageInfoList[i].Width;

                // Get the Height
                int height = imageInfoList[i].Height;

                //Get the BitsPerComponent
                int bitPerPixel = imageInfoList[i].BitsPerComponent;

                // Get the PixelFormat
                PixelFormat pixFormat = imageInfoList[i].PixelFormat;

                // Gets true if the image info list has transperency
                bool trans = imageInfoList[i].HasTransperency;

                string extension = ".u3d";
                if (extracted3DImageData.ImageType3D == Extracted3DImageType.U3D)
                    extension = ".u3d";
                else
                    extension = ".prc";

                imageInfoList[i].Get3DImage(("MyImage" + (i + 1) + extension), false);

                // Set the ExtractedImageData to GetPosterImage() method from the imageInfoList
                ExtractedImageData extractedImageData = imageInfoList[i].GetPosterImage();
                byte[] baseData = null;
                string baseExtension = "";
                if (extractedImageData.ImageType == ExtractedImageType.Jpeg)
                    baseExtension = ".jpg";
                else
                    baseExtension = ".png";
                baseData = extractedImageData.Data;
                string outputPath1 = ("BaseImage" + (i + 1) + baseExtension);

                // Save the output
                File.WriteAllBytes(outputPath1, baseData);
          }
    }
}

Properties

BitsPerComponentGets Bits Per Component number for a pixel of the image.
HasTransperencyGets boolean representing alpha channels presence in the image.
HeightGets height of the image.
PixelFormatGets PixelFormat of the image, As PixelFormat object.
WidthGets width of the image.

Methods

Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
Get3DImage()Returns the Extracted3DImageData object for the image extracted.
Get3DImage(String, [Optional] Boolean)Draws the 3D image at the given file path.
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetPosterImage()Returns the ExtractedImageType object for the image extracted.
GetPosterImage(String)Draws the image of type jpg or png at the given file path.
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.Merger

In this topic