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);
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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Base3DAnnot | Handle of an existing 3D annotation (pdfCreate3DAnnot, Rich Media, 3D, File Attachment, and Sound Annotations). |
Name | The view's display name. |
SetAsDefault | Whether this becomes the annotation's default (/DIS) view. |
Matrix | Camera-to-world transform. |
CamDistance | Camera distance from the target. |
RM, LS | Rendering 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)
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);
Object Creation
pdfCreate3DView
pdfCreate3DViewW
pdfCreate3DViewA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.