API referenceForms

pdfSetColSortField

Choose which portable-collection (PDF Package/Portfolio)

C
BOOL32 __stdcall pdfSetColSortField(PPDF IPDF, uint32_t ColField, BOOL32 AscendingOrder);
Delphi
function pdfSetColSortField(const IPDF: PPDF; ColField: Cardinal; AscendingOrder: LongBool): LongBool; stdcall;

Purpose. Choose which portable-collection (PDF Package/Portfolio) schema column the collection's initial sort should use, and its direction.

Description. Requires a collection schema to already exist (FColCreated; established via the collection-field/schema creation path) and ColField to be a valid 1-based column index within FColFCount. Stores ColField/AscendingOrder into FColSortField/ FColSortAsc; these are read back only indirectly, by GetCollectionInfoH, which resolves FColSortField to the actual column key name (FColFKey[FColSortField - 1]) for the /D (default sort) entry of the collection's /CO (Collection) dictionary at serialization.

Parameters.

ParameterDescription
IPDFDocument handle.
ColField1-based column index into the collection schema (not 0-based like most other index parameters in this SDK).
AscendingOrderSort direction.

Return value. True if a collection schema exists and ColField is in range 1..FColFCount; False otherwise (including when no collection has been created at all via pdfCreateCollectionField, Field Creation).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Forms
Category

Setters

Exported names

pdfSetColSortField

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.