File Formats

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Enum Pdf3DLightingStyle

    Show / Hide Table of Contents

    Enum Pdf3DLightingStyle

    Specifies the available styles for applying light to 3D artwork.

    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public enum Pdf3DLightingStyle
    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

    Name Description
    Artwork

    The Lights as specified in the 3D artwork.

    Blue

    Three blue infinite lights.

    CAD

    Three grey infinite lights and one light attached to the camera.

    Cube

    Six grey infinite lights aligned with the major axes.

    Day

    Three light-grey infinite lights.

    Hard

    Three grey infinite lights.

    Headlamp

    Single infinite light attached to the camera.

    Night

    One yellow, one aqua, and one blue infinite light.

    None

    The lighting specified in the 3D artwork is ignored.

    Primary

    One red, one green, and one blue infinite light.

    Red

    Three red infinite lights.

    White

    Three blue-grey infinite lights.

    See Also
    PdfPage
    Pdf3DActivation
    Pdf3DView
    Pdf3DBackground
    Pdf3DProjection
    Pdf3DRendermode
    Pdf3DView
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved