Table of Contents

Class Pdf3DCrossSectionCollection

Namespace
Syncfusion.Pdf.Interactive
Assembly
Syncfusion.Pdf.Portable.dll

Represents the collection of Pdf3DCrossSection objects.

public class Pdf3DCrossSectionCollection : List<Pdf3DCrossSection>, IList<Pdf3DCrossSection>, ICollection<Pdf3DCrossSection>, IList, ICollection, IReadOnlyList<Pdf3DCrossSection>, IReadOnlyCollection<Pdf3DCrossSection>, IEnumerable<Pdf3DCrossSection>, IEnumerable
Inheritance
Pdf3DCrossSectionCollection
Implements
Inherited Members

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DView
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f };
//Create a new Pdf3DCrossSectionCollection.
Pdf3DCrossSectionCollection crossSectionCollection = view.CrossSections;
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DView
Dim view As New Pdf3DView()
'Create a new Pdf3DCrossSectionCollection.
Dim crossSectionCollection As Pdf3DCrossSectionCollection = view.CrossSections
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)

Constructors

Pdf3DCrossSectionCollection()

public Pdf3DCrossSectionCollection()

Properties

this[int]

Gets or sets the Pdf3DCrossSection at the specified index.

public Pdf3DCrossSection this[int index] { get; set; }

Parameters

index int

Property Value

Pdf3DCrossSection

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DView
Pdf3DView view = new Pdf3DView();
//Create a new Pdf3DCrossSectionCollection.
Pdf3DCrossSectionCollection crossSectionCollection = view.CrossSections;
Pdf3DCrossSection crosssection =view.CrossSections[0];
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DView
Dim view As New Pdf3DView()
'Create a new Pdf3DCrossSectionCollection.
Dim crossSectionCollection As Pdf3DCrossSectionCollection = view.CrossSections
Dim crosssection As Pdf3DCrossSection=view.CrossSections[0]
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)

Methods

Add(Pdf3DCrossSection)

Adds the specified value.

public int Add(Pdf3DCrossSection value)

Parameters

value Pdf3DCrossSection

The 3D cross section to be added.

Returns

int

The index value of the section to be added.

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
crossSection.Opacity = 100;
//Create a new Pdf3DView.
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f };
view.CrossSections.Add(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
crossSection.Opacity = 100
'Create a new Pdf3DView.
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f }
view.CrossSections.Add(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
See Also

Contains(Pdf3DCrossSection)

Determines whether the specified cross section is in collection.

public bool Contains(Pdf3DCrossSection value)

Parameters

value Pdf3DCrossSection

The Pdf3DCrossSection

Returns

bool

if it contains the specified value, set to true.

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle.
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
//Create a new Pdf3DView.
Pdf3DView view = new Pdf3DView();
bool isExist = view.CrossSections.Contains(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle.
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
'Create a new Pdf3DView.
Dim view As New Pdf3DView()
Dim isExist As Boolean = view.CrossSections.Contains(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
See Also

IndexOf(Pdf3DCrossSection)

Searches and finds the index of the specified cross section from the collection.

public int IndexOf(Pdf3DCrossSection value)

Parameters

value Pdf3DCrossSection

The Pdf3DCrossSection.

Returns

int

Examples

PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
//Create a new Pdf3DView
Pdf3DView view = new Pdf3DView();
//Add the cross section
view.CrossSections.Add(crossSection);
//Get the index of specified crossSection
int index = view.CrossSections.IndexOf(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
'Create a new Pdf3DView
Dim view As New Pdf3DView()
'Add the cross section
view.CrossSections.Add(crossSection)
'Get the index of specified crossSection
Dim index As Integer = view.CrossSections.IndexOf(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)

Insert(int, Pdf3DCrossSection)

Inserts the cross section at specified index.

public void Insert(int index, Pdf3DCrossSection value)

Parameters

index int

The index.

value Pdf3DCrossSection

The value.

Examples

PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
//Create a new Pdf3DView
Pdf3DView view = new Pdf3DView();
//Insert the cross section at specified index
view.CrossSections.Insert(0,crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
'Create a new Pdf3DView
Dim view As New Pdf3DView()
'Insert the cross section at specified index
view.CrossSections.Insert(0,crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)

Remove(Pdf3DCrossSection)

Removes the specified cross section form the collection.

public void Remove(Pdf3DCrossSection value)

Parameters

value Pdf3DCrossSection

The cross section to be removed.

Examples

PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
//Create a new Pdf3DView
Pdf3DView view = new Pdf3DView();
view.CrossSections.Add(crossSection);
//Remove the cross section
view.CrossSections.Remove(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
'Create a new Pdf3DView
Dim view As New Pdf3DView()
view.CrossSections.Add(crossSection)
'Remove the cross section
view.CrossSections.Remove(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)