File type plug-ins

PSPad from 4.3.3 version supports plugins for file load/save manipulation. Plugins are stored in the .\Plugins\FileType folder as dynamic link library (.dll) files. The name of each dll indicated it's functions are called when loaded and/or saving a file with a matching file extension. i.e. pdb.dll handles files with the pdb (*.pdb) extention


Each library has simple interface, exports there functions:

  • function PSP_LoadFromFile(FileName, Data: PChar; DataSize: Integer): Integer; stdcall;
    parameter DataSize - max. size of allocated buffer on the PSPad side
    returns real data size
  • function PSP_SaveToFile(FileName, Data: PChar; DataSize: Integer): LongBool; stdcall;
    parameter DataSize - real. size of data
    returns success state - True/False
  • function PSP_Version: Integer; stdcall;
    returns plug-in compatibly version
  • Maximal size is limited to 5,000,000 bytes. If some error occurs in dll (function missing, function returns false), PSPad internal file handling is used. PSPad internally checks the PSPad version Plugin is designed for. A error is raised if version is less then current PSPad interface version and PSPad uses internal file handling.

    Note: Current interface version is 1.