SetVirtualFileLimits

Workflow data tools, Virtual files, ActiveX, DLL

Description

Sets the total byte and file count limits of the virtual file registry

Syntax

ActiveX

Function PDFlib::SetVirtualFileLimits(MaxBytes As Double, MaxFiles As Long) As Long

DLL

int DLSetVirtualFileLimits(int InstanceID, long long MaxBytes, int MaxFiles);

Parameters

InstanceIDLibrary instance returned by DLCreateLibrary
MaxBytesMaximum total bytes of all registered files; 0 means unlimited
MaxFilesMaximum number of registered files; 0 means unlimited

Return values

Returns 1 on success or 0 when a limit is negative or below the current usage

Remarks

Registration, copies, replacements and restores that would exceed a limit fail without changing the registry

Read the current limits with GetVirtualFilesJSON first so they can be reinstated; lift them with 0 before restoring a larger snapshot

The virtual file registry is shared by every library instance in the process and is used by every mem:// path and by registered file names; scope workflow resources under a unique prefix

ActiveX exposes this method on IPDFlibrary24; obtain it with CoPDFlibrary.CreateEditionTools24 or query the default interface of PDFlibAX 4.74 or later. ActiveX passes MaxBytes as a Double so scripting clients without 64-bit integers can call it; the value must be a whole number from 0 through 2^53

All editions include these functions. Failed ActiveX calls return an empty string, 0 or Empty and record the reason for GetWorkflowToolsError. The C#, VB.NET and Visual C++ WorkflowTools examples in the DLL and ActiveX demo folders show a complete request, page plan and rollback workflow

See also

Workflow data tools · Virtual file registry · GetWorkflowToolsError