CopyVirtualFile
Workflow data tools, Virtual files, ActiveX, DLL
Description
Copies a registered virtual file to a new name
Syntax
ActiveX
Function PDFlib::CopyVirtualFile(SourceName As String, TargetName As String, ReplaceExisting As Long) As LongDLL
int DLCopyVirtualFile(int InstanceID, const wchar_t* SourceName, const wchar_t* TargetName, int ReplaceExisting);
int DLCopyVirtualFileA(int InstanceID, const char* SourceName, const char* TargetName, int ReplaceExisting);
Parameters
| InstanceID | Library instance returned by DLCreateLibrary |
|---|---|
| SourceName | Registered file to copy |
| TargetName | New file name |
| ReplaceExisting | Nonzero replaces an existing target; 0 fails when the target exists |
Return values
Returns 1 on success or 0 when the source is missing, the target exists, the name is invalid or a limit would be exceeded
Remarks
The copy receives a new revision
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
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