Class Pdf3DBackground
Represents the background appearance for 3D artwork.
Inheritance
System.Object
Pdf3DBackground
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class Pdf3DBackground : IPdfWrapper
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");
PdfColor color = new PdfColor(Color.Silver);
//Create a new Pdf3DBackground.
Pdf3DBackground background = new Pdf3DBackground();
background.ApplyToEntireAnnotation = true;
background.Color = color;
//Create a view.
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 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")
Dim color As New PdfColor(Color.Silver)
'Create a new Pdf3DBackground.
Dim background As New Pdf3DBackground()
background.ApplyToEntireAnnotation = True
background.Color = color
'Create a view.
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)
Constructors
Pdf3DBackground()
Initializes a new instance of the Pdf3DBackground class.
Declaration
public Pdf3DBackground()
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");
PdfColor color = new PdfColor(Color.Silver);
//Create a new Pdf3DBackground.
Pdf3DBackground background = new Pdf3DBackground();
background.ApplyToEntireAnnotation = true;
background.Color = color;
//Create a view.
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 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")
Dim color As New PdfColor(Color.Silver)
'Create a new Pdf3DBackground.
Dim background As New Pdf3DBackground()
background.ApplyToEntireAnnotation = True
background.Color = color
'Create a view.
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
Pdf3DBackground(PdfColor)
Initializes a new instance of the Pdf3DBackground class with specified color.
Declaration
public Pdf3DBackground(PdfColor color)
Parameters
Type | Name | Description |
---|---|---|
PdfColor | color | The PdfColor object specifying the background color for the 3D artwork. |
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");
PdfColor color = new PdfColor(Color.Silver);
//Create a new Pdf3DBackground.
Pdf3DBackground background = new Pdf3DBackground(color);
background.ApplyToEntireAnnotation = true;
//Create a view.
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 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")
Dim color As New PdfColor(Color.Silver)
'Create a new Pdf3DBackground.
Dim background As New Pdf3DBackground(color)
background.ApplyToEntireAnnotation = True
'Create a view.
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
Properties
ApplyToEntireAnnotation
Gets or sets a value indicating how the background is applied.
Declaration
public bool ApplyToEntireAnnotation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the background is applied to entire annotation, false if the background is applied to annotation's 3D view box only. |
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");
PdfColor color = new PdfColor(Color.Silver);
//Create a new Pdf3DBackground.
Pdf3DBackground background = new Pdf3DBackground();
background.ApplyToEntireAnnotation = true;
background.Color = color;
//Create a view.
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 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")
Dim color As New PdfColor(Color.Silver)
'Create a new Pdf3DBackground.
Dim background As New Pdf3DBackground()
background.ApplyToEntireAnnotation = True
background.Color = color
'Create a view.
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
Color
Gets or sets the background color of the 3D artwork.
Declaration
public PdfColor Color { get; set; }
Property Value
Type | Description |
---|---|
PdfColor | The PdfColor object specifying the background color for the 3D artwork. |
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");
PdfColor color = new PdfColor(Color.Silver);
//Create a new Pdf3DBackground.
Pdf3DBackground background = new Pdf3DBackground();
background.ApplyToEntireAnnotation = true;
background.Color = color;
//Create a view.
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 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")
Dim color As New PdfColor(Color.Silver)
'Create a new Pdf3DBackground.
Dim background As New Pdf3DBackground()
background.ApplyToEntireAnnotation = True
background.Color = color
'Create a view.
Dim view As New Pdf3DView()
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
Methods
Initialize()
Initializes annotation object.
Declaration
protected virtual void Initialize()
Save()
Saves an annotation.
Declaration
protected virtual void Save()