API referenceCore SDK

pdfCreate3DView

Create a new named camera view (/3DView) on an existing 3D

C
void* __stdcall pdfCreate3DViewA(PPDF IPDF, uint32_t Base3DAnnot, const char* Name, BOOL32 SetAsDefault, double* Matrix, double CamDistance, T3DRenderingMode RM, T3DLightingSheme LS);
void* __stdcall pdfCreate3DViewW(PPDF IPDF, uint32_t Base3DAnnot, const wchar_t* Name, BOOL32 SetAsDefault, double* Matrix, double CamDistance, T3DRenderingMode RM, T3DLightingSheme LS);
Delphi
function pdfCreate3DViewA(const IPDF: PPDF; Base3DAnnot: Cardinal; const Name: PAnsiChar; SetAsDefault: LongBool; Matrix: PDouble; CamDistance: Double; RM: T3DRenderingMode; LS: T3DLightingSheme): Pointer; stdcall;
function pdfCreate3DViewW(const IPDF: PPDF; Base3DAnnot: Cardinal; const Name: PWideChar; SetAsDefault: LongBool; Matrix: PDouble; CamDistance: Double; RM: T3DRenderingMode; LS: T3DLightingSheme): Pointer; stdcall;

Purpose. Create a new named camera view (/3DView) on an existing 3D annotation, returning an opaque view handle for use with pdfCreate3DBackground/pdfCreate3DProjection/ pdfCreate3DGotoViewAction below.

Description. Resolves Base3DAnnot to its internal 3D-registry index via Find3DByHandle; fails if it doesn't resolve to an existing 3D annotation. Matrix supplies the camera-to-world transform (12 or 16 doubles, per the PDF /C2W matrix convention — not independently re-verified as to exact element count/order in this chapter). W transcodes Name through UTF-8 rather than the system default codepage used elsewhere in this SDK's other W-suffixed entry points — a real divergence from this SDK's more common ANSI-codepage-narrowing convention for names.

Parameters.

ParameterDescription
IPDFDocument handle.
Base3DAnnotHandle of an existing 3D annotation (pdfCreate3DAnnot, Rich Media, 3D, File Attachment, and Sound Annotations).
NameThe view's display name.
SetAsDefaultWhether this becomes the annotation's default (/DIS) view.
MatrixCamera-to-world transform.
CamDistanceCamera distance from the target.
RM, LSRendering mode and lighting scheme.

Return value. An opaque encoded view handle (see the chapter note above), or nil if Base3DAnnot doesn't resolve or the view could not be added.

See also. pdfCreate3DAnnot.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfCreate3DView(IntPtr IPDF, uint Base3DAnnot, [MarshalAs(UnmanagedType.LPStr)] string Name, [MarshalAs(UnmanagedType.Bool)] bool SetAsDefault, double[] Matrix, double CamDistance, T3DRenderingMode RM, T3DLightingSheme LS);
public static extern IntPtr pdfCreate3DViewW(IntPtr IPDF, uint Base3DAnnot, [MarshalAs(UnmanagedType.LPWStr)] string Name, [MarshalAs(UnmanagedType.Bool)] bool SetAsDefault, double[] Matrix, double CamDistance, T3DRenderingMode RM, T3DLightingSheme LS);
public static extern IntPtr pdfCreate3DViewA(IntPtr IPDF, uint Base3DAnnot, [MarshalAs(UnmanagedType.LPStr)] string Name, [MarshalAs(UnmanagedType.Bool)] bool SetAsDefault, double[] Matrix, double CamDistance, T3DRenderingMode RM, T3DLightingSheme LS);
Area
Core SDK
Category

Object Creation

Exported names

pdfCreate3DView pdfCreate3DViewW pdfCreate3DViewA

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.