Class Pdf3DView
Represents a attributes to be applied to the virtual camera associated with a 3D annotation.
Inheritance
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class Pdf3DView : Object, IPdfWrapper
Remarks
This Pdf3DView class is used to represents the 3D view for Pdf3DAnnotation. Please refer the UG docuemntation link https://help.syncfusion.com/file-formats/pdf/working-with-annotations#d-annotation for more details.
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 Pdf3DRendermode
Pdf3DRendermode rendermode = new Pdf3DRendermode();
rendermode.Style = Pdf3DRenderStyle.Solid;
rendermode.AuxilaryColor = new PdfColor(Color.Green);
rendermode.FaceColor = new PdfColor(Color.Black);
PdfColor color = new PdfColor(Color.Silver);
//Create a new Pdf3DBackground
Pdf3DBackground background = new Pdf3DBackground();
background.ApplyToEntireAnnotation = true;
background.Color = color;
//Creates a new Pdf3DLighting
Pdf3DLighting lighting = new Pdf3DLighting();
lighting.Style = Pdf3DLightingStyle.CAD;
//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.Background = background;
view.LightingScheme = lighting;
view.RenderMode = rendermode;
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 Pdf3DRendermode
Dim rendermode As New Pdf3DRendermode()
rendermode.Style = Pdf3DRenderStyle.Solid
rendermode.AuxilaryColor = New PdfColor(Color.Green)
rendermode.FaceColor = New PdfColor(Color.Black)
Dim color As New PdfColor(Color.Silver)
'Create a new Pdf3DBackground
Dim background As New Pdf3DBackground()
background.ApplyToEntireAnnotation = True
background.Color = color
'Creates a new Pdf3DLighting
Dim lighting As New Pdf3DLighting()
lighting.Style = Pdf3DLightingStyle.CAD
'Create a new Pdf3DView
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.Background = background
view.LightingScheme = lighting
view.RenderMode = rendermode
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
Constructors
Pdf3DView()
Initializes a new instance of the Pdf3DView class.
Declaration
public Pdf3DView()
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 Pdf3DRendermode
Pdf3DRendermode rendermode = new Pdf3DRendermode();
rendermode.Style = Pdf3DRenderStyle.Solid;
rendermode.AuxilaryColor = new PdfColor(Color.Green);
rendermode.FaceColor = new PdfColor(Color.Black);
PdfColor color = new PdfColor(Color.Silver);
//Create a new Pdf3DBackground
Pdf3DBackground background = new Pdf3DBackground();
background.ApplyToEntireAnnotation = true;
background.Color = color;
//Creates a new Pdf3DLighting
Pdf3DLighting lighting = new Pdf3DLighting();
lighting.Style = Pdf3DLightingStyle.CAD;
//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.Background = background;
view.LightingScheme = lighting;
view.RenderMode = rendermode;
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 Pdf3DRendermode
Dim rendermode As New Pdf3DRendermode()
rendermode.Style = Pdf3DRenderStyle.Solid
rendermode.AuxilaryColor = New PdfColor(Color.Green)
rendermode.FaceColor = New PdfColor(Color.Black)
Dim color As New PdfColor(Color.Silver)
'Create a new Pdf3DBackground
Dim background As New Pdf3DBackground()
background.ApplyToEntireAnnotation = True
background.Color = color
'Creates a new Pdf3DLighting
Dim lighting As New Pdf3DLighting()
lighting.Style = Pdf3DLightingStyle.CAD
'Create a new Pdf3DView
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.Background = background
view.LightingScheme = lighting
view.RenderMode = rendermode
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
Properties
Background
Gets or sets the background for this view.
Declaration
public Pdf3DBackground Background { get; set; }
Property Value
Type |
---|
Pdf3DBackground |
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");
PdfColor color = new PdfColor(Color.Silver);
//Create a new Pdf3DBackground
Pdf3DBackground background = new Pdf3DBackground();
background.ApplyToEntireAnnotation = true;
background.Color = color;
//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.Background = background;
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")
Dim color As New PdfColor(Color.Silver)
'Create a new Pdf3DBackground
Dim background As New Pdf3DBackground()
background.ApplyToEntireAnnotation = True
background.Color = color
'Create a new Pdf3DView
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.Background = background
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
CameraToWorldMatrix
Gets or sets the 3D transformation matrix.
Declaration
public float[] CameraToWorldMatrix { get; set; }
Property Value
Type | Description |
---|---|
System.Single[] | A 12-element 3D transformation matrix that specifies a position and orientation of the camera in world coordinates. |
Remarks
If the array has more than 12 elements, only the first 12 will be considered.
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");
//Creates a new Pdf3DBackground
Pdf3DBackground background = new Pdf3DBackground();
background.ApplyToEntireAnnotation = true;
background.Color =new PdfColor(Color.Blue);
float[] matrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -300.669f, -112.432f, 45.6829f };
//Create a new Pdf3DView
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = matrix;
view.Background = background;
view.CenterOfOrbit = 10f;
view.ExternalName = "Near View";
//Adds a pdf3d view.
annotation.Views.Add(view);
//Adds a annotation.
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")
'Creates a new Pdf3DBackground
Dim background As New Pdf3DBackground()
background.ApplyToEntireAnnotation = True
background.Color = New PdfColor(Color.Blue)
Dim matrix() As Single = { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -300.669f, -112.432f, 45.6829f }
'Create a new Pdf3DView
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = matrix
view.Background = background
view.CenterOfOrbit = 10f
view.ExternalName = "Near View"
'Adds a pdf3d view.
annotation.Views.Add(view)
'Adds a annotation.
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
CenterOfOrbit
Gets or sets the center of orbit for 3D artwork.
Declaration
public float CenterOfOrbit { get; set; }
Property Value
Type | Description |
---|---|
System.Single | A non-negative number indicating a distance in the camera coordinate system along the z axis to the center of orbit for this view. |
Remarks
If this value is negative, the viewer application must determine the center of orbit.
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 };
view.CenterOfOrbit = 10f;
//Add a pdf3d view.
annotation.Views.Add(view);
//Add a annotation.
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 PdfDocument = New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As Pdf3DAnnotation = New Pdf3DAnnotation(New RectangleF(10, 300, 300, 150), "Input.u3d")
'Create a new Pdf3DView
Dim view As Pdf3DView = New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.CenterOfOrbit = 10f
'Adds a pdf3d view
annotation.Views.Add(view)
'Draw a annotation into the new page.
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
CrossSections
Gets the list of cross sections for this view.
Declaration
public Pdf3DCrossSectionCollection CrossSections { get; }
Property Value
Type | Description |
---|---|
Pdf3DCrossSectionCollection | A list of PDF3DCrossSection objects available for this view. |
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 };
Pdf3DCrossSectionCollection crossSectionCollection = view.CrossSections;
//Adds a pdf3d view.
annotation.Views.Add(view);
//Adds a annotation.
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()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
Dim crossSectionCollection As Pdf3DCrossSectionCollection = view.CrossSections
'Adds a pdf3d view.
annotation.Views.Add(view)
'Adds a annotation.
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
ExternalName
Gets or sets the view's external name.
Declaration
public string ExternalName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The external name of the view, suitable for presentation in a user interface. |
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 };
view.ExternalName = "Near View";
//Add a pdf3d view.
annotation.Views.Add(view);
//Add a annotation.
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()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.ExternalName = "Near View"
'Adds a pdf3d view.
annotation.Views.Add(view)
'Adds a annotation.
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
LightingScheme
Gets or sets the lighting scheme for this view.
Declaration
public Pdf3DLighting LightingScheme { get; set; }
Property Value
Type |
---|
Pdf3DLighting |
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 Pdf3DRendermode
Pdf3DRendermode rendermode = new Pdf3DRendermode();
rendermode.Style = Pdf3DRenderStyle.Solid;
rendermode.AuxilaryColor = new PdfColor(Color.Green);
rendermode.FaceColor = new PdfColor(Color.Black);
PdfColor color = new PdfColor(Color.Silver);
//Create a new Pdf3DBackground
Pdf3DBackground background = new Pdf3DBackground();
background.ApplyToEntireAnnotation = true;
background.Color = color;
//Creates a new Pdf3DLighting
Pdf3DLighting lighting = new Pdf3DLighting();
lighting.Style = Pdf3DLightingStyle.CAD;
//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.Background = background;
view.LightingScheme = lighting;
view.RenderMode = rendermode;
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 Pdf3DRendermode
Dim rendermode As New Pdf3DRendermode()
rendermode.Style = Pdf3DRenderStyle.Solid
rendermode.AuxilaryColor = New PdfColor(Color.Green)
rendermode.FaceColor = New PdfColor(Color.Black)
Dim color As New PdfColor(Color.Silver)
'Create a new Pdf3DBackground
Dim background As New Pdf3DBackground()
background.ApplyToEntireAnnotation = True
background.Color = color
'Creates a new Pdf3DLighting
Dim lighting As New Pdf3DLighting()
lighting.Style = Pdf3DLightingStyle.CAD
'Create a new Pdf3DView
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.Background = background
view.LightingScheme = lighting
view.RenderMode = rendermode
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
Nodes
Gets the list of 3D nodes for this view.
Declaration
public Pdf3DNodeCollection Nodes { get; }
Property Value
Type | Description |
---|---|
Pdf3DNodeCollection | A list of PDF3DNode objects available for this view. |
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 };
view.ResetNodesState = true;
Pdf3DNodeCollection nodes = view.Nodes;
//Adds a pdf3d view.
annotation.Views.Add(view);
//Adds a annotation.
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()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.ResetNodesState = True
Dim nodes As Pdf3DNodeCollection = view.Nodes
'Adds a pdf3d view.
annotation.Views.Add(view)
'Adds a annotation.
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Projection
Gets or sets the projection for this view.
Declaration
public Pdf3DProjection Projection { get; set; }
Property Value
Type |
---|
Pdf3DProjection |
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 Pdf3DProjection.
Pdf3DProjection projection = new Pdf3DProjection(Pdf3DProjectionType.Perspective);
projection.FieldOfView = 10;
projection.ClipStyle = Pdf3DProjectionClipStyle.ExplicitNearFar;
projection.FarClipDistance = 10;
projection.Scaling = 10;
//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.Projection = projection;
annotation.Views.Add(view);
//Add the annotation in a new page.
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 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 Pdf3DProjection.
Dim projection As New Pdf3DProjection(Pdf3DProjectionType.Perspective)
projection.FieldOfView = 10
projection.ClipStyle = Pdf3DProjectionClipStyle.ExplicitNearFar
projection.FarClipDistance = 10
projection.Scaling = 10
'Create a new Pdf3DView
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.Projection = projection
annotation.Views.Add(view)
'Add the annotation in a new page.
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
RenderMode
Gets or sets the rendering mode for this view.
Declaration
public Pdf3DRendermode RenderMode { get; set; }
Property Value
Type |
---|
Pdf3DRendermode |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new Pdf3D Annotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DRendermode.
Pdf3DRendermode renderMode = new Pdf3DRendermode();
renderMode.Style = Pdf3DRenderStyle.Solid;
renderMode.AuxilaryColor = new PdfColor(Color.Green);
renderMode.FaceColor = new PdfColor(Color.Black);
renderMode.CreaseValue = 10f;
//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.RenderMode = renderMode;
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 Pdf3D Annotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DRendermode.
Dim renderMode As New Pdf3DRendermode()
renderMode.Style = Pdf3DRenderStyle.Solid
renderMode.AuxilaryColor = New PdfColor(Color.Green)
renderMode.FaceColor = New PdfColor(Color.Black)
renderMode.CreaseValue = 10f
'Create a new Pdf3DView
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.RenderMode = renderMode
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
ResetNodesState
Gets or sets a value indicating whether nodes specified in the Nodes collection are returned to their original states (as specified in the 3D artwork) before applying transformation matrices and opacity settings specified in the node dictionaries.
Declaration
public bool ResetNodesState { get; set; }
Property Value
Type |
---|
System.Boolean |
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 }
view.ResetNodesState = true;
//Adds a pdf3d view.
annotation.Views.Add(view);
//Adds a annotation.
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()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.ResetNodesState = True
'Adds a pdf3d view.
annotation.Views.Add(view)
'Adds a annotation.
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
ViewNodeName
Gets or sets the name of the view node.
Declaration
public string ViewNodeName { get; set; }
Property Value
Type |
---|
System.String |
Remarks
The view node in the content stream defines all the properties for viewing the 3D artwork. If both ViewNodeName and CameraToWorldMatrix are specified, then ViewNodeName takes precedence.
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 };
string name = view.ViewNodeName;
//Add a pdf3d view.
annotation.Views.Add(view);
//Add a annotation.
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()
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 }
Dim name As String = view.ViewNodeName
'Add a pdf3d view.
annotation.Views.Add(view)
'Add a annotation.
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Methods
Initialize()
Initializes annotation object.
Declaration
protected virtual void Initialize()
Save()
Saves an annotation.
Declaration
protected virtual void Save()