Class Pdf3DCrossSectionCollection
Represents the collection of Pdf3DCrossSection objects.
Inheritance
System.Object
Pdf3DCrossSectionCollection
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class Pdf3DCrossSectionCollection : List<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();
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()
Declaration
public Pdf3DCrossSectionCollection()
Properties
Item[Int32]
Gets or sets the Pdf3DCrossSection at the specified index.
Declaration
public Pdf3DCrossSection this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
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.
Declaration
public int Add(Pdf3DCrossSection value)
Parameters
Type | Name | Description |
---|---|---|
Pdf3DCrossSection | value | The 3D cross section to be added. |
Returns
Type | Description |
---|---|
System.Int32 | 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.
Declaration
public bool Contains(Pdf3DCrossSection value)
Parameters
Type | Name | Description |
---|---|---|
Pdf3DCrossSection | value |
Returns
Type | Description |
---|---|
System.Boolean | if it contains the specified value, set to |
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.
Declaration
public int IndexOf(Pdf3DCrossSection value)
Parameters
Type | Name | Description |
---|---|---|
Pdf3DCrossSection | value | The Pdf3DCrossSection. |
Returns
Type |
---|
System.Int32 |
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(Int32, Pdf3DCrossSection)
Inserts the cross section at specified index.
Declaration
public void Insert(int index, Pdf3DCrossSection value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
Pdf3DCrossSection | value | 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.
Declaration
public void Remove(Pdf3DCrossSection value)
Parameters
Type | Name | Description |
---|---|---|
Pdf3DCrossSection | value | 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)