Class Pdf3DLightingStyle
Specifies the available styles for applying light to 3D artwork.
Inheritance
System.Object
Pdf3DLightingStyle
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.UWP.dll
Syntax
public sealed class Pdf3DLightingStyle : Enum
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 pdf3dAnnotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create pdfFont, pdfFont style and brush.
Font font = new Font("Calibri", 11, FontStyle.Regular);
PdfFont pdfFont = new PdfTrueTypeFont(font, false);
PdfBrush brush = new PdfSolidBrush(Color.DarkBlue);
//Create 3D activation.
Pdf3DActivation activation = new Pdf3DActivation();
activation.ActivationMode = Pdf3DActivationMode.PageVisible;
activation.ShowToolbar = true;
pdf3dAnnotation.Activation = activation;
Pdf3DView defaultView = new Pdf3DView();
defaultView.ExternalName = "Near View";
defaultView.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 };
defaultView.CenterOfOrbit = 131.695f;
//Set the 3D background.
Pdf3DBackground background=new Pdf3DBackground();
background.Color=new PdfColor(Color.Blue);
defaultView.Background = background;
//Set the projection.
Pdf3DProjection projection = new Pdf3DProjection(Pdf3DProjectionType.Orthographic);
defaultView.Projection = projection;
//Set the render mode.
Pdf3DRendermode renderMode = new Pdf3DRendermode(Pdf3DRenderStyle.Solid);
defaultView.RenderMode = renderMode;
//Set the lighting scheme.
Pdf3DLighting lighting = new Pdf3DLighting(Pdf3DLightingStyle.Night);
defaultView.LightingScheme = lighting;
//Add the view.
pdf3dAnnotation.Views.Add(defaultView);
pdf3dAnnotation.Appearance.Normal.Graphics.DrawString("Click to activate", pdfFont, brush, new PointF(40, 40));
//Add this annotation to a new page.
pdf3dAnnotation.Appearance.Normal.Draw(page, new PointF(pdf3dAnnotation.Location.X, pdf3dAnnotation.Location.Y));
//Adds annotation to page.
page.Annotations.Add(pdf3dAnnotation);
//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 pdf3dAnnotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create pdfFont, pdfFont style and brush.
Dim font As New Font("Calibri", 11, FontStyle.Regular)
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, False)
Dim brush As PdfBrush = New PdfSolidBrush(Color.DarkBlue)
Dim activation As New Pdf3DActivation()
activation.ActivationMode = Pdf3DActivationMode.PageVisible
activation.ShowToolbar = True
pdf3dAnnotation.Activation = activation
Dim defaultView As New Pdf3DView()
defaultView.ExternalName = "Near View"
defaultView.CameraToWorldMatrix = New Single() { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f }
defaultView.CenterOfOrbit = 131.695f
'Set the 3D background.
Dim background As New Pdf3DBackground()
background.Color = New PdfColor(Color.Blue)
defaultView.Background = background
'Set the projection.
Dim projection As New Pdf3DProjection(Pdf3DProjectionType.Orthographic)
defaultView.Projection = projection
'Set the render mode.
Dim renderMode As New Pdf3DRendermode(Pdf3DRenderStyle.Solid)
defaultView.RenderMode = renderMode
'Set the lighting scheme.
Dim lighting As New Pdf3DLighting(Pdf3DLightingStyle.Night)
defaultView.LightingScheme = lighting
'Add the view.
pdf3dAnnotation.Views.Add(defaultView)
pdf3dAnnotation.Appearance.Normal.Graphics.DrawString("Click to activate", pdfFont, brush, New PointF(40, 40))
'Add this annotation to a new page.
pdf3dAnnotation.Appearance.Normal.Draw(page, New PointF(pdf3dAnnotation.Location.X, pdf3dAnnotation.Location.Y))
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
Fields
Artwork
The Lights as specified in the 3D artwork.
Declaration
public const Pdf3DLightingStyle Artwork
Field Value
Type |
---|
Pdf3DLightingStyle |
Blue
Three blue infinite lights.
Declaration
public const Pdf3DLightingStyle Blue
Field Value
Type |
---|
Pdf3DLightingStyle |
CAD
Three grey infinite lights and one light attached to the camera.
Declaration
public const Pdf3DLightingStyle CAD
Field Value
Type |
---|
Pdf3DLightingStyle |
Cube
Six grey infinite lights aligned with the major axes.
Declaration
public const Pdf3DLightingStyle Cube
Field Value
Type |
---|
Pdf3DLightingStyle |
Day
Three light-grey infinite lights.
Declaration
public const Pdf3DLightingStyle Day
Field Value
Type |
---|
Pdf3DLightingStyle |
Hard
Three grey infinite lights.
Declaration
public const Pdf3DLightingStyle Hard
Field Value
Type |
---|
Pdf3DLightingStyle |
Headlamp
Single infinite light attached to the camera.
Declaration
public const Pdf3DLightingStyle Headlamp
Field Value
Type |
---|
Pdf3DLightingStyle |
Night
One yellow, one aqua, and one blue infinite light.
Declaration
public const Pdf3DLightingStyle Night
Field Value
Type |
---|
Pdf3DLightingStyle |
None
The lighting specified in the 3D artwork is ignored.
Declaration
public const Pdf3DLightingStyle None
Field Value
Type |
---|
Pdf3DLightingStyle |
Primary
One red, one green, and one blue infinite light.
Declaration
public const Pdf3DLightingStyle Primary
Field Value
Type |
---|
Pdf3DLightingStyle |
Red
Three red infinite lights.
Declaration
public const Pdf3DLightingStyle Red
Field Value
Type |
---|
Pdf3DLightingStyle |
White
Three blue-grey infinite lights.
Declaration
public const Pdf3DLightingStyle White
Field Value
Type |
---|
Pdf3DLightingStyle |