Unit PDFlibDllFunctions;

{$I ..\Lib\PDFlibDefines.inc}

Interface

Uses
{$IFNDEF XE2+}
  Windows,
  SyncObjs,
{$ELSE}
  Winapi.Windows,
  System.SyncObjs,
{$ENDIF}
  PDFlibrary,
  PDFlibExtra;

Function DLSetProgressCallback(InstanceID: Integer; ProgressProc, UserData: Pointer): Integer; Stdcall;
Function DLAddArcToPath(InstanceID: Integer; CenterX, CenterY, TotalAngle: Double): Integer; Stdcall;
Function DLAddBoxToPath(InstanceID: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLAddCJKFont(InstanceID, CJKFontID: Integer): Integer; Stdcall;
Function DLAddCurveToPath(InstanceID: Integer; CtAX, CtAY, CtBX, CtBY, EndX, EndY: Double): Integer; Stdcall;
Function DLAddEmbeddedFile(InstanceID: Integer; FileName, MIMEType: PWideChar): Integer; Stdcall;
Function DLAddEmbeddedFileA(InstanceID: Integer; FileName, MIMEType: PAnsiChar): Integer; Stdcall;
Function DLAddFileAttachment(InstanceID: Integer; Title: PWideChar; EmbeddedFileID: Integer): Integer; Stdcall;
Function DLAddFileAttachmentA(InstanceID: Integer; Title: PAnsiChar; EmbeddedFileID: Integer): Integer; Stdcall;
Function DLAddFormFieldChoiceSub(InstanceID, Index: Integer; SubName, DisplayName: PWideChar): Integer; Stdcall;
Function DLAddFormFieldChoiceSubA(InstanceID, Index: Integer; SubName, DisplayName: PAnsiChar): Integer; Stdcall;
Function DLAddFormFieldSub(InstanceID, Index: Integer; SubName: PWideChar): Integer; Stdcall;
Function DLAddFormFieldSubA(InstanceID, Index: Integer; SubName: PAnsiChar): Integer; Stdcall;
Function DLAddFormFont(InstanceID, FontID: Integer): Integer; Stdcall;
Function DLAddFreeTextAnnotation(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PWideChar; Angle, Options: Integer): Integer; Stdcall;
Function DLAddFreeTextAnnotationA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Angle, Options: Integer): Integer; Stdcall;
Function DLAddFreeTextAnnotationEx(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PWideChar; Angle, Options, Transparency: Integer)
  : Integer; Stdcall;
Function DLAddFreeTextAnnotationExA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Angle, Options, Transparency: Integer)
  : Integer; Stdcall;
Function DLAddGlobalJavaScript(InstanceID: Integer; PackageName, JavaScript: PWideChar): Integer; Stdcall;
Function DLAddGlobalJavaScriptA(InstanceID: Integer; PackageName, JavaScript: PAnsiChar): Integer; Stdcall;
Function DLAddImageFromFile(InstanceID: Integer; FileName: PWideChar; Options: Integer): Integer; Stdcall;
Function DLAddImageFromFileA(InstanceID: Integer; FileName: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAddImageFromFileOffset(InstanceID: Integer; FileName: PWideChar; Offset, DataLength, Options: Integer): Integer; Stdcall;
Function DLAddImageFromFileOffsetA(InstanceID: Integer; FileName: PAnsiChar; Offset, DataLength, Options: Integer): Integer; Stdcall;
Function DLAddImageFromString(InstanceID: Integer; Source: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAddLGIDictToPage(InstanceID: Integer; DictContent: PWideChar): Integer; Stdcall;
Function DLAddLGIDictToPageA(InstanceID: Integer; DictContent: PAnsiChar): Integer; Stdcall;
Function DLAddLineToPath(InstanceID: Integer; EndX, EndY: Double): Integer; Stdcall;
Function DLAddLinkToDestination(InstanceID: Integer; Left, Top, Width, Height: Double; DestID, Options: Integer): Integer; Stdcall;
Function DLAddLinkToEmbeddedFile(InstanceID: Integer; Left, Top, Width, Height: Double; EmbeddedFileID: Integer; Title, Contents: PWideChar;
  IconType, Transpareny: Integer): Integer; Stdcall;
Function DLAddLinkToEmbeddedFileA(InstanceID: Integer; Left, Top, Width, Height: Double; EmbeddedFileID: Integer; Title, Contents: PAnsiChar;
  IconType, Transpareny: Integer): Integer; Stdcall;
Function DLAddLinkToFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Page: Integer; Position: Double;
  NewWindow, Options: Integer): Integer; Stdcall;
Function DLAddLinkToFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Page: Integer; Position: Double;
  NewWindow, Options: Integer): Integer; Stdcall;
Function DLAddLinkToFileDest(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, NamedDest: PWideChar; Position: Double;
  NewWindow, Options: Integer): Integer; Stdcall;
Function DLAddLinkToFileDestA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, NamedDest: PAnsiChar; Position: Double;
  NewWindow, Options: Integer): Integer; Stdcall;
Function DLAddLinkToFileEx(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; DestPage, NewWindow, Options, Zoom, DestType: Integer;
  DestLeft, DestTop, DestRight, DestBottom: Double): Integer; Stdcall;
Function DLAddLinkToFileExA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; DestPage, NewWindow, Options, Zoom, DestType: Integer;
  DestLeft, DestTop, DestRight, DestBottom: Double): Integer; Stdcall;
Function DLAddLinkToJavaScript(InstanceID: Integer; Left, Top, Width, Height: Double; JavaScript: PWideChar; Options: Integer): Integer; Stdcall;
Function DLAddLinkToJavaScriptA(InstanceID: Integer; Left, Top, Width, Height: Double; JavaScript: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAddLinkToLocalFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Options: Integer): Integer; Stdcall;
Function DLAddLinkToLocalFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAddLinkToPage(InstanceID: Integer; Left, Top, Width, Height: Double; Page: Integer; Position: Double; Options: Integer): Integer; Stdcall;
Function DLAddLinkToWeb(InstanceID: Integer; Left, Top, Width, Height: Double; Link: PWideChar; Options: Integer): Integer; Stdcall;
Function DLAddLinkToWebA(InstanceID: Integer; Left, Top, Width, Height: Double; Link: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAddNoteAnnotation(InstanceID: Integer; Left, Top: Double; AnnotType: Integer; PopupLeft, PopupTop, PopupWidth, PopupHeight: Double;
  Title, Contents: PWideChar; Red, Green, Blue: Double; Open: Integer): Integer; Stdcall;
Function DLAddNoteAnnotationA(InstanceID: Integer; Left, Top: Double; AnnotType: Integer; PopupLeft, PopupTop, PopupWidth, PopupHeight: Double;
  Title, Contents: PAnsiChar; Red, Green, Blue: Double; Open: Integer): Integer; Stdcall;
Function DLAddOpenTypeFontFromFile(InstanceID: Integer; FileName: PWideChar; Options: Integer): Integer; Stdcall;
Function DLAddOpenTypeFontFromFileA(InstanceID: Integer; FileName: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAddPageLabels(InstanceID, Start, Style, Offset: Integer; Prefix: PWideChar): Integer; Stdcall;
Function DLAddPageLabelsA(InstanceID, Start, Style, Offset: Integer; Prefix: PAnsiChar): Integer; Stdcall;
Function DLAddPageMatrix(InstanceID: Integer; xscale, yscale, xoffset, yoffset: Double): Integer; Stdcall;
Function DLAddRelativeLinkToFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Page: Integer; Position: Double;
  NewWindow, Options: Integer): Integer; Stdcall;
Function DLAddRelativeLinkToFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Page: Integer; Position: Double;
  NewWindow, Options: Integer): Integer; Stdcall;
Function DLAddRelativeLinkToFileDest(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, NamedDest: PWideChar; Position: Double;
  NewWindow, Options: Integer): Integer; Stdcall;
Function DLAddRelativeLinkToFileDestA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, NamedDest: PAnsiChar; Position: Double;
  NewWindow, Options: Integer): Integer; Stdcall;
Function DLAddRelativeLinkToFileEx(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar;
  DestPage, NewWindow, Options, Zoom, DestType: Integer; DestLeft, DestTop, DestRight, DestBottom: Double): Integer; Stdcall;
Function DLAddRelativeLinkToFileExA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar;
  DestPage, NewWindow, Options, Zoom, DestType: Integer; DestLeft, DestTop, DestRight, DestBottom: Double): Integer; Stdcall;
Function DLAddRelativeLinkToLocalFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Options: Integer): Integer; Stdcall;
Function DLAddRelativeLinkToLocalFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAddSVGAnnotationFromFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Options: Integer): Integer; Stdcall;
Function DLAddSVGAnnotationFromFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAddSWFAnnotationFromFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, Title: PWideChar; Options: Integer): Integer; Stdcall;
Function DLAddSWFAnnotationFromFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, Title: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAddSeparationColor(InstanceID: Integer; ColorName: PWideChar; C, M, Y, K: Double; Options: Integer): Integer; Stdcall;
Function DLAddSeparationColorA(InstanceID: Integer; ColorName: PAnsiChar; C, M, Y, K: Double; Options: Integer): Integer; Stdcall;
Function DLAddStampAnnotation(InstanceID: Integer; Left, Top, Width, Height: Double; StampType: Integer; Title, Contents: PWideChar; Red, Green, Blue: Double;
  Options: Integer): Integer; Stdcall;
Function DLAddStampAnnotationA(InstanceID: Integer; Left, Top, Width, Height: Double; StampType: Integer; Title, Contents: PAnsiChar; Red, Green, Blue: Double;
  Options: Integer): Integer; Stdcall;
Function DLAddStampAnnotationFromImage(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, Title, Contents: PWideChar; Red, Green, Blue: Double;
  Options: Integer): Integer; Stdcall;
Function DLAddStampAnnotationFromImageA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, Title, Contents: PAnsiChar; Red, Green, Blue: Double;
  Options: Integer): Integer; Stdcall;
Function DLAddStampAnnotationFromImageID(InstanceID: Integer; Left, Top, Width, Height: Double; ImageID: Integer; Title, Contents: PWideChar;
  Red, Green, Blue: Double; Options: Integer): Integer; Stdcall;
Function DLAddStampAnnotationFromImageIDA(InstanceID: Integer; Left, Top, Width, Height: Double; ImageID: Integer; Title, Contents: PAnsiChar;
  Red, Green, Blue: Double; Options: Integer): Integer; Stdcall;
Function DLAddStandardFont(InstanceID, StandardFontID: Integer): Integer; Stdcall;
Function DLAddSubsettedFont(InstanceID: Integer; FontName: PWideChar; CharsetIndex: Integer; SubsetChars: PWideChar): Integer; Stdcall;
Function DLAddSubsettedFontA(InstanceID: Integer; FontName: PAnsiChar; CharsetIndex: Integer; SubsetChars: PAnsiChar): Integer; Stdcall;
Function DLAddTextMarkupAnnotation(InstanceID, MarkupType: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLAddToBuffer(InstanceID: Integer; Buffer, Source: PAnsiChar; SourceLength: Integer): Integer; Stdcall;
Function DLAddToFileList(InstanceID: Integer; ListName, FileName: PWideChar): Integer; Stdcall;
Function DLAddToFileListA(InstanceID: Integer; ListName, FileName: PAnsiChar): Integer; Stdcall;
Function DLAddTrueTypeFont(InstanceID: Integer; FontName: PWideChar; Embed: Integer): Integer; Stdcall;
Function DLAddTrueTypeFontA(InstanceID: Integer; FontName: PAnsiChar; Embed: Integer): Integer; Stdcall;
Function DLAddTrueTypeFontFromFile(InstanceID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLAddTrueTypeFontFromFileA(InstanceID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLAddTrueTypeSubsettedFont(InstanceID: Integer; FontName, SubsetChars: PWideChar; Options: Integer): Integer; Stdcall;
Function DLAddTrueTypeSubsettedFontA(InstanceID: Integer; FontName, SubsetChars: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAddType1Font(InstanceID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLAddType1FontA(InstanceID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLAddU3DAnnotationFromFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Options: Integer): Integer; Stdcall;
Function DLAddU3DAnnotationFromFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLAnalyseFile(InstanceID: Integer; InputFileName, Password: PWideChar): Integer; Stdcall;
Function DLAnalyseFileA(InstanceID: Integer; InputFileName, Password: PAnsiChar): Integer; Stdcall;
Function DLAnnotationCount(InstanceID: Integer): Integer; Stdcall;
Function DLAnsiStringResultLength(InstanceID: Integer): Integer; Stdcall;
Function DLAppendSpace(InstanceID: Integer; RelativeSpace: Double): Integer; Stdcall;
Function DLAppendTableColumns(InstanceID, TableID, NewColumnCount: Integer): Integer; Stdcall;
Function DLAppendTableRows(InstanceID, TableID, NewRowCount: Integer): Integer; Stdcall;
Function DLAppendText(InstanceID: Integer; Text: PWideChar): Integer; Stdcall;
Function DLAppendTextA(InstanceID: Integer; Text: PAnsiChar): Integer; Stdcall;
Function DLAppendToFile(InstanceID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLAppendToFileA(InstanceID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLAppendToString(InstanceID, AppendMode: Integer): PAnsiChar; Stdcall;
Function DLApplyStyle(InstanceID: Integer; StyleName: PWideChar): Integer; Stdcall;
Function DLApplyStyleA(InstanceID: Integer; StyleName: PAnsiChar): Integer; Stdcall;
Function DLAttachAnnotToForm(InstanceID, Index: Integer): Integer; Stdcall;
Function DLBalanceContentStream(InstanceID: Integer): Integer; Stdcall;
Function DLBalancePageTree(InstanceID, Options: Integer): Integer; Stdcall;
Function DLBeginPageUpdate(InstanceID: Integer): Integer; Stdcall;
Function DLCapturePage(InstanceID, Page: Integer): Integer; Stdcall;
Function DLCapturePageEx(InstanceID, Page, Options: Integer): Integer; Stdcall;
Function DLCharWidth(InstanceID, CharCode: Integer): Integer; Stdcall;
Function DLCheckFileCompliance(InstanceID: Integer; InputFileName, Password: PWideChar; ComplianceTest, Options: Integer): Integer; Stdcall;
Function DLCheckFileComplianceA(InstanceID: Integer; InputFileName, Password: PAnsiChar; ComplianceTest, Options: Integer): Integer; Stdcall;
Function DLCheckObjects(InstanceID: Integer): Integer; Stdcall;
Function DLCheckPageAnnots(InstanceID: Integer): Integer; Stdcall;
Function DLCheckPassword(InstanceID: Integer; Password: PWideChar): Integer; Stdcall;
Function DLCheckPasswordA(InstanceID: Integer; Password: PAnsiChar): Integer; Stdcall;
Function DLClearFileList(InstanceID: Integer; ListName: PWideChar): Integer; Stdcall;
Function DLClearFileListA(InstanceID: Integer; ListName: PAnsiChar): Integer; Stdcall;
Function DLClearImage(InstanceID, ImageID: Integer): Integer; Stdcall;
Function DLClearPageLabels(InstanceID: Integer): Integer; Stdcall;
Function DLClearTextFormatting(InstanceID: Integer): Integer; Stdcall;
Function DLCloneOutlineAction(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLClonePages(InstanceID, StartPage, EndPage, RepeatCount: Integer): Integer; Stdcall;
Function DLCloseOutline(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLClosePath(InstanceID: Integer): Integer; Stdcall;
Function DLCombineContentStreams(InstanceID: Integer): Integer; Stdcall;
Function DLCompareOutlines(InstanceID, FirstOutlineID, SecondOutlineID: Integer): Integer; Stdcall;
Function DLCompressContent(InstanceID: Integer): Integer; Stdcall;
Function DLCompressFonts(InstanceID, Compress: Integer): Integer; Stdcall;
Function DLCompressImages(InstanceID, Compress: Integer): Integer; Stdcall;
Function DLCompressPage(InstanceID: Integer): Integer; Stdcall;
Function DLContentStreamCount(InstanceID: Integer): Integer; Stdcall;
Function DLContentStreamSafe(InstanceID: Integer): Integer; Stdcall;
Function DLCopyPageRanges(InstanceID, DocumentID: Integer; RangeList: PWideChar): Integer; Stdcall;
Function DLCopyPageRangesA(InstanceID, DocumentID: Integer; RangeList: PAnsiChar): Integer; Stdcall;
Function DLCopyPageRangesEx(InstanceID, DocumentID: Integer; RangeList: PWideChar; Options: Integer): Integer; Stdcall;
Function DLCopyPageRangesExA(InstanceID, DocumentID: Integer; RangeList: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLCreateBuffer(InstanceID, BufferLength: Integer): PAnsiChar; Stdcall;
Function DLCreateLibrary: Integer; Stdcall;
Function DLCreateNewObject(InstanceID: Integer): Integer; Stdcall;
Function DLCreateRenderer(InstanceID: Integer): Integer; Stdcall;
Function DLCreateTable(InstanceID, RowCount, ColumnCount: Integer): Integer; Stdcall;
Function DLDAAppendFile(InstanceID, FileHandle: Integer): Integer; Stdcall;
Function DLDACapturePage(InstanceID, FileHandle, PageRef: Integer): Integer; Stdcall;
Function DLDACapturePageEx(InstanceID, FileHandle, PageRef, Options: Integer): Integer; Stdcall;
Function DLDACloseFile(InstanceID, FileHandle: Integer): Integer; Stdcall;
Function DLDADrawCapturedPage(InstanceID, FileHandle, DACaptureID, DestPageRef: Integer; PntLeft, PntBottom, PntWidth, PntHeight: Double): Integer; Stdcall;
Function DLDADrawRotatedCapturedPage(InstanceID, FileHandle, DACaptureID, DestPageRef: Integer; PntLeft, PntBottom, PntWidth, PntHeight, Angle: Double)
  : Integer; Stdcall;
Function DLDAEmbedFileStreams(InstanceID, FileHandle: Integer; RootPath: PWideChar): Integer; Stdcall;
Function DLDAEmbedFileStreamsA(InstanceID, FileHandle: Integer; RootPath: PAnsiChar): Integer; Stdcall;
Function DLDAExtractPageText(InstanceID, FileHandle, PageRef, Options: Integer): PWideChar; Stdcall;
Function DLDAExtractPageTextA(InstanceID, FileHandle, PageRef, Options: Integer): PAnsiChar; Stdcall;
Function DLDAExtractPageTextBlocks(InstanceID, FileHandle, PageRef, ExtractOptions: Integer): Integer; Stdcall;
Function DLDAFindPage(InstanceID, FileHandle, Page: Integer): Integer; Stdcall;
Function DLDAGetAnnotationCount(InstanceID, FileHandle, PageRef: Integer): Integer; Stdcall;
Function DLDAGetFormFieldCount(InstanceID, FileHandle: Integer): Integer; Stdcall;
Function DLDAGetFormFieldTitle(InstanceID, FileHandle, FieldIndex: Integer): PWideChar; Stdcall;
Function DLDAGetFormFieldTitleA(InstanceID, FileHandle, FieldIndex: Integer): PAnsiChar; Stdcall;
Function DLDAGetFormFieldValue(InstanceID, FileHandle, FieldIndex: Integer): PWideChar; Stdcall;
Function DLDAGetFormFieldValueA(InstanceID, FileHandle, FieldIndex: Integer): PAnsiChar; Stdcall;
Function DLDAGetImageDataToString(InstanceID, FileHandle, ImageListID, ImageIndex: Integer): PAnsiChar; Stdcall;
Function DLDAGetImageDblProperty(InstanceID, FileHandle, ImageListID, ImageIndex, PropertyID: Integer): Double; Stdcall;
Function DLDAGetImageIntProperty(InstanceID, FileHandle, ImageListID, ImageIndex, PropertyID: Integer): Integer; Stdcall;
Function DLDAGetImageListCount(InstanceID, FileHandle, ImageListID: Integer): Integer; Stdcall;
Function DLDAGetInformation(InstanceID, FileHandle: Integer; Key: PWideChar): PWideChar; Stdcall;
Function DLDAGetInformationA(InstanceID, FileHandle: Integer; Key: PAnsiChar): PAnsiChar; Stdcall;
Function DLDAGetObjectCount(InstanceID, FileHandle: Integer): Integer; Stdcall;
Function DLDAGetObjectToString(InstanceID, FileHandle, ObjectNumber: Integer): PAnsiChar; Stdcall;
Function DLDAGetPageBox(InstanceID, FileHandle, PageRef, BoxIndex, Dimension: Integer): Double; Stdcall;
Function DLDAGetPageContentToString(InstanceID, FileHandle, PageRef: Integer): PAnsiChar; Stdcall;
Function DLDAGetPageCount(InstanceID, FileHandle: Integer): Integer; Stdcall;
Function DLDAGetPageHeight(InstanceID, FileHandle, PageRef: Integer): Double; Stdcall;
Function DLDAGetPageImageList(InstanceID, FileHandle, PageRef: Integer): Integer; Stdcall;
Function DLDAGetPageWidth(InstanceID, FileHandle, PageRef: Integer): Double; Stdcall;
Function DLDAGetTextBlockAsString(InstanceID, TextBlockListID, Index: Integer): PWideChar; Stdcall;
Function DLDAGetTextBlockAsStringA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar; Stdcall;
Function DLDAGetTextBlockBound(InstanceID, TextBlockListID, Index, BoundIndex: Integer): Double; Stdcall;
Function DLDAGetTextBlockCharWidth(InstanceID, TextBlockListID, Index, CharIndex: Integer): Double; Stdcall;
Function DLDAGetTextBlockColor(InstanceID, TextBlockListID, Index, ColorComponent: Integer): Double; Stdcall;
Function DLDAGetTextBlockColorType(InstanceID, TextBlockListID, Index: Integer): Integer; Stdcall;
Function DLDAGetTextBlockCount(InstanceID, TextBlockListID: Integer): Integer; Stdcall;
Function DLDAGetTextBlockFontName(InstanceID, TextBlockListID, Index: Integer): PWideChar; Stdcall;
Function DLDAGetTextBlockFontNameA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar; Stdcall;
Function DLDAGetTextBlockFontSize(InstanceID, TextBlockListID, Index: Integer): Double; Stdcall;
Function DLDAGetTextBlockText(InstanceID, TextBlockListID, Index: Integer): PWideChar; Stdcall;
Function DLDAGetTextBlockTextA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar; Stdcall;
Function DLDAHasPageBox(InstanceID, FileHandle, PageRef, BoxIndex: Integer): Integer; Stdcall;
Function DLDAHidePage(InstanceID, FileHandle, PageRef: Integer): Integer; Stdcall;
Function DLDAMovePage(InstanceID, FileHandle, PageRef, TargetPageRef, Options: Integer): Integer; Stdcall;
Function DLDANewPage(InstanceID, FileHandle: Integer): Integer; Stdcall;
Function DLDANewPages(InstanceID, FileHandle, PageCount: Integer): Integer; Stdcall;
Function DLDANormalizePage(InstanceID, FileHandle, PageRef, NormalizeOptions: Integer): Integer; Stdcall;
Function DLDAOpenFile(InstanceID: Integer; InputFileName, Password: PWideChar): Integer; Stdcall;
Function DLDAOpenFileA(InstanceID: Integer; InputFileName, Password: PAnsiChar): Integer; Stdcall;
Function DLDAOpenFileReadOnly(InstanceID: Integer; InputFileName, Password: PWideChar): Integer; Stdcall;
Function DLDAOpenFileReadOnlyA(InstanceID: Integer; InputFileName, Password: PAnsiChar): Integer; Stdcall;
Function DLDAPageRotation(InstanceID, FileHandle, PageRef: Integer): Integer; Stdcall;
Function DLDAReleaseImageList(InstanceID, FileHandle, ImageListID: Integer): Integer; Stdcall;
Function DLDAReleaseTextBlocks(InstanceID, TextBlockListID: Integer): Integer; Stdcall;
Function DLDARemoveUsageRights(InstanceID, FileHandle: Integer): Integer; Stdcall;
Function DLDARenderPageToDC(InstanceID, FileHandle, PageRef: Integer; DPI: Double; DC: HDC): Integer; Stdcall;
Function DLDARenderPageToFile(InstanceID, FileHandle, PageRef, Options: Integer; DPI: Double; FileName: PWideChar): Integer; Stdcall;
Function DLDARenderPageToFileA(InstanceID, FileHandle, PageRef, Options: Integer; DPI: Double; FileName: PAnsiChar): Integer; Stdcall;
Function DLDARenderPageToString(InstanceID, FileHandle, PageRef, Options: Integer; DPI: Double): PAnsiChar; Stdcall;
Function DLDARotatePage(InstanceID, FileHandle, PageRef, Angle, Options: Integer): Integer; Stdcall;
Function DLDASaveAsFile(InstanceID, FileHandle: Integer; OutputFileName: PWideChar): Integer; Stdcall;
Function DLDASaveAsFileA(InstanceID, FileHandle: Integer; OutputFileName: PAnsiChar): Integer; Stdcall;
Function DLDASaveImageDataToFile(InstanceID, FileHandle, ImageListID, ImageIndex: Integer; ImageFileName: PWideChar): Integer; Stdcall;
Function DLDASaveImageDataToFileA(InstanceID, FileHandle, ImageListID, ImageIndex: Integer; ImageFileName: PAnsiChar): Integer; Stdcall;
Function DLDASetInformation(InstanceID, FileHandle: Integer; Key, NewValue: PWideChar): Integer; Stdcall;
Function DLDASetInformationA(InstanceID, FileHandle: Integer; Key, NewValue: PAnsiChar): Integer; Stdcall;
Function DLDASetPageBox(InstanceID, FileHandle, PageRef, BoxIndex: Integer; X1, Y1, X2, Y2: Double): Integer; Stdcall;
Function DLDASetPageLayout(InstanceID, FileHandle, NewPageLayout: Integer): Integer; Stdcall;
Function DLDASetPageMode(InstanceID, FileHandle, NewPageMode: Integer): Integer; Stdcall;
Function DLDASetPageSize(InstanceID, FileHandle, PageRef: Integer; PntWidth, PntHeight: Double): Integer; Stdcall;
Function DLDASetTextExtractionArea(InstanceID: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLDASetTextExtractionOptions(InstanceID, OptionID, NewValue: Integer): Integer; Stdcall;
Function DLDASetTextExtractionScaling(InstanceID, Options: Integer; Horizontal, Vertical: Double): Integer; Stdcall;
Function DLDASetTextExtractionWordGap(InstanceID: Integer; NewWordGap: Double): Integer; Stdcall;
Function DLDAShiftedHeader(InstanceID, FileHandle: Integer): Integer; Stdcall;
Function DLDecrypt(InstanceID: Integer): Integer; Stdcall;
Function DLDecryptFile(InstanceID: Integer; InputFileName, OutputFileName, Password: PWideChar): Integer; Stdcall;
Function DLDecryptFileA(InstanceID: Integer; InputFileName, OutputFileName, Password: PAnsiChar): Integer; Stdcall;
Function DLDeleteAnalysis(InstanceID, AnalysisID: Integer): Integer; Stdcall;
Function DLDeleteAnnotation(InstanceID, Index: Integer): Integer; Stdcall;
Function DLDeleteContentStream(InstanceID: Integer): Integer; Stdcall;
Function DLDeleteFormField(InstanceID, Index: Integer): Integer; Stdcall;
Function DLDeleteOptionalContentGroup(InstanceID, OptionalContentGroupID: Integer): Integer; Stdcall;
Function DLDeletePageLGIDict(InstanceID, DictIndex: Integer): Integer; Stdcall;
Function DLDeletePages(InstanceID, StartPage, PageCount: Integer): Integer; Stdcall;
Function DLDestroyRenderer(InstanceID: Integer): Integer; Stdcall;
Function DLDocJavaScriptAction(InstanceID: Integer; ActionType, JavaScript: PWideChar): Integer; Stdcall;
Function DLDocJavaScriptActionA(InstanceID: Integer; ActionType, JavaScript: PAnsiChar): Integer; Stdcall;
Function DLDocumentCount(InstanceID: Integer): Integer; Stdcall;
Function DLDrawArc(InstanceID: Integer; XPos, YPos, Radius, StartAngle, EndAngle: Double; Pie, DrawOptions: Integer): Integer; Stdcall;
Function DLDrawBarcode(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PWideChar; Barcode, Options: Integer): Integer; Stdcall;
Function DLDrawBarcodeA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Barcode, Options: Integer): Integer; Stdcall;
Function DLDrawBox(InstanceID: Integer; Left, Top, Width, Height: Double; DrawOptions: Integer): Integer; Stdcall;
Function DLDrawCapturedPage(InstanceID, CaptureID: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLDrawCapturedPageMatrix(InstanceID, CaptureID: Integer; M11, M12, M21, M22, MDX, MDY: Double): Integer; Stdcall;
Function DLDrawCircle(InstanceID: Integer; XPos, YPos, Radius: Double; DrawOptions: Integer): Integer; Stdcall;
Function DLDrawDataMatrixSymbol(InstanceID: Integer; Left, Top, ModuleSize: Double; Text: PWideChar; Encoding, SymbolSize, Options: Integer): Integer; Stdcall;
Function DLDrawDataMatrixSymbolA(InstanceID: Integer; Left, Top, ModuleSize: Double; Text: PAnsiChar; Encoding, SymbolSize, Options: Integer): Integer; Stdcall;
Function DLDrawEllipse(InstanceID: Integer; XPos, YPos, Width, Height: Double; DrawOptions: Integer): Integer; Stdcall;
Function DLDrawEllipticArc(InstanceID: Integer; XPos, YPos, Width, Height, StartAngle, EndAngle: Double; Pie, DrawOptions: Integer): Integer; Stdcall;
Function DLDrawHTMLText(InstanceID: Integer; Left, Top, Width: Double; HTMLText: PWideChar): Integer; Stdcall;
Function DLDrawHTMLTextA(InstanceID: Integer; Left, Top, Width: Double; HTMLText: PAnsiChar): Integer; Stdcall;
Function DLDrawHTMLTextBox(InstanceID: Integer; Left, Top, Width, Height: Double; HTMLText: PWideChar): PWideChar; Stdcall;
Function DLDrawHTMLTextBoxA(InstanceID: Integer; Left, Top, Width, Height: Double; HTMLText: PAnsiChar): PAnsiChar; Stdcall;
Function DLDrawHTMLTextBoxMatrix(InstanceID: Integer; Width, Height: Double; HTMLText: PWideChar; M11, M12, M21, M22, MDX, MDY: Double): PWideChar; Stdcall;
Function DLDrawHTMLTextBoxMatrixA(InstanceID: Integer; Width, Height: Double; HTMLText: PAnsiChar; M11, M12, M21, M22, MDX, MDY: Double): PAnsiChar; Stdcall;
Function DLDrawHTMLTextMatrix(InstanceID: Integer; Width: Double; HTMLText: PWideChar; M11, M12, M21, M22, MDX, MDY: Double): Integer; Stdcall;
Function DLDrawHTMLTextMatrixA(InstanceID: Integer; Width: Double; HTMLText: PAnsiChar; M11, M12, M21, M22, MDX, MDY: Double): Integer; Stdcall;
Function DLDrawImage(InstanceID: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLDrawImageMatrix(InstanceID: Integer; M11, M12, M21, M22, MDX, MDY: Double): Integer; Stdcall;
Function DLDrawIntelligentMailBarcode(InstanceID: Integer; Left, Top, BarWidth, FullBarHeight, TrackerHeight, SpaceWidth: Double; BarcodeData: PWideChar;
  Options: Integer): Integer; Stdcall;
Function DLDrawIntelligentMailBarcodeA(InstanceID: Integer; Left, Top, BarWidth, FullBarHeight, TrackerHeight, SpaceWidth: Double; BarcodeData: PAnsiChar;
  Options: Integer): Integer; Stdcall;
Function DLDrawLine(InstanceID: Integer; StartX, StartY, EndX, EndY: Double): Integer; Stdcall;
Function DLDrawMultiLineText(InstanceID: Integer; XPos, YPos: Double; Delimiter, Text: PWideChar): Integer; Stdcall;
Function DLDrawMultiLineTextA(InstanceID: Integer; XPos, YPos: Double; Delimiter, Text: PAnsiChar): Integer; Stdcall;
Function DLDrawPDF417Symbol(InstanceID: Integer; Left, Top: Double; Text: PWideChar; Options: Integer): Integer; Stdcall;
Function DLDrawPDF417SymbolA(InstanceID: Integer; Left, Top: Double; Text: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLDrawPDF417SymbolEx(InstanceID: Integer; Left, Top: Double; Text: PWideChar; Options, FixedColumns, FixedRows, ErrorLevel: Integer;
  ModuleSize, HeightWidthRatio: Double): Integer; Stdcall;
Function DLDrawPDF417SymbolExA(InstanceID: Integer; Left, Top: Double; Text: PAnsiChar; Options, FixedColumns, FixedRows, ErrorLevel: Integer;
  ModuleSize, HeightWidthRatio: Double): Integer; Stdcall;
Function DLDrawPath(InstanceID, PathOptions: Integer): Integer; Stdcall;
Function DLDrawPathEvenOdd(InstanceID, PathOptions: Integer): Integer; Stdcall;
Function DLDrawPostScriptXObject(InstanceID, PSRef: Integer): Integer; Stdcall;
Function DLDrawQRCode(InstanceID: Integer; Left, Top, SymbolSize: Double; Text: PWideChar; EncodeOptions, DrawOptions: Integer): Integer; Stdcall;
Function DLDrawQRCodeA(InstanceID: Integer; Left, Top, SymbolSize: Double; Text: PAnsiChar; EncodeOptions, DrawOptions: Integer): Integer; Stdcall;
Function DLDrawRotatedBox(InstanceID: Integer; Left, Bottom, Width, Height, Angle: Double; DrawOptions: Integer): Integer; Stdcall;
Function DLDrawRotatedCapturedPage(InstanceID, CaptureID: Integer; Left, Bottom, Width, Height, Angle: Double): Integer; Stdcall;
Function DLDrawRotatedImage(InstanceID: Integer; Left, Bottom, Width, Height, Angle: Double): Integer; Stdcall;
Function DLDrawRotatedMultiLineText(InstanceID: Integer; XPos, YPos, Angle: Double; Delimiter, Text: PWideChar): Integer; Stdcall;
Function DLDrawRotatedMultiLineTextA(InstanceID: Integer; XPos, YPos, Angle: Double; Delimiter, Text: PAnsiChar): Integer; Stdcall;
Function DLDrawRotatedText(InstanceID: Integer; XPos, YPos, Angle: Double; Text: PWideChar): Integer; Stdcall;
Function DLDrawRotatedTextA(InstanceID: Integer; XPos, YPos, Angle: Double; Text: PAnsiChar): Integer; Stdcall;
Function DLDrawRotatedTextBox(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PWideChar; Options: Integer): Integer; Stdcall;
Function DLDrawRotatedTextBoxA(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLDrawRotatedTextBoxEx(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PWideChar; Options, Border, Radius, DrawOptions: Integer)
  : Integer; Stdcall;
Function DLDrawRotatedTextBoxExA(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PAnsiChar; Options, Border, Radius, DrawOptions: Integer)
  : Integer; Stdcall;
Function DLDrawRoundedBox(InstanceID: Integer; Left, Top, Width, Height, Radius: Double; DrawOptions: Integer): Integer; Stdcall;
Function DLDrawRoundedRotatedBox(InstanceID: Integer; Left, Bottom, Width, Height, Radius, Angle: Double; DrawOptions: Integer): Integer; Stdcall;
Function DLDrawScaledImage(InstanceID: Integer; Left, Top, Scale: Double): Integer; Stdcall;
Function DLDrawSpacedText(InstanceID: Integer; XPos, YPos, Spacing: Double; Text: PWideChar): Integer; Stdcall;
Function DLDrawSpacedTextA(InstanceID: Integer; XPos, YPos, Spacing: Double; Text: PAnsiChar): Integer; Stdcall;
Function DLDrawTableRows(InstanceID, TableID: Integer; Left, Top, Height: Double; FirstRow, LastRow: Integer): Double; Stdcall;
Function DLDrawText(InstanceID: Integer; XPos, YPos: Double; Text: PWideChar): Integer; Stdcall;
Function DLDrawTextA(InstanceID: Integer; XPos, YPos: Double; Text: PAnsiChar): Integer; Stdcall;
Function DLDrawTextArc(InstanceID: Integer; XPos, YPos, Radius, Angle: Double; Text: PWideChar; DrawOptions: Integer): Integer; Stdcall;
Function DLDrawTextArcA(InstanceID: Integer; XPos, YPos, Radius, Angle: Double; Text: PAnsiChar; DrawOptions: Integer): Integer; Stdcall;
Function DLDrawTextBox(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PWideChar; Options: Integer): Integer; Stdcall;
Function DLDrawTextBoxA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLDrawTextBoxMatrix(InstanceID: Integer; Width, Height: Double; Text: PWideChar; Options: Integer; M11, M12, M21, M22, MDX, MDY: Double)
  : Integer; Stdcall;
Function DLDrawTextBoxMatrixA(InstanceID: Integer; Width, Height: Double; Text: PAnsiChar; Options: Integer; M11, M12, M21, M22, MDX, MDY: Double)
  : Integer; Stdcall;
Function DLDrawWrappedText(InstanceID: Integer; XPos, YPos, Width: Double; Text: PWideChar): Integer; Stdcall;
Function DLDrawWrappedTextA(InstanceID: Integer; XPos, YPos, Width: Double; Text: PAnsiChar): Integer; Stdcall;
Function DLEditableContentStream(InstanceID: Integer): Integer; Stdcall;
Function DLEmbedFile(InstanceID: Integer; Title, FileName, MIMEType: PWideChar): Integer; Stdcall;
Function DLEmbedFileA(InstanceID: Integer; Title, FileName, MIMEType: PAnsiChar): Integer; Stdcall;
Function DLEmbeddedFileCount(InstanceID: Integer): Integer; Stdcall;
Function DLEncapsulateContentStream(InstanceID: Integer): Integer; Stdcall;
Function DLEncodePermissions(InstanceID, CanPrint, CanCopy, CanChange, CanAddNotes, CanFillFields, CanCopyAccess, CanAssemble, CanPrintFull: Integer)
  : Integer; Stdcall;
Function DLEncrypt(InstanceID: Integer; Owner, User: PWideChar; Strength, Permissions: Integer): Integer; Stdcall;
Function DLEncryptA(InstanceID: Integer; Owner, User: PAnsiChar; Strength, Permissions: Integer): Integer; Stdcall;
Function DLEncryptFile(InstanceID: Integer; InputFileName, OutputFileName, Owner, User: PWideChar; Strength, Permissions: Integer): Integer; Stdcall;
Function DLEncryptFileA(InstanceID: Integer; InputFileName, OutputFileName, Owner, User: PAnsiChar; Strength, Permissions: Integer): Integer; Stdcall;
Function DLEncryptWithFingerprint(InstanceID: Integer; Fingerprint: PWideChar): Integer; Stdcall;
Function DLEncryptWithFingerprintA(InstanceID: Integer; Fingerprint: PAnsiChar): Integer; Stdcall;
Function DLEncryptionAlgorithm(InstanceID: Integer): Integer; Stdcall;
Function DLEncryptionStatus(InstanceID: Integer): Integer; Stdcall;
Function DLEncryptionStrength(InstanceID: Integer): Integer; Stdcall;
Function DLEndPageUpdate(InstanceID: Integer): Integer; Stdcall;
Function DLEndSignProcessToFile(InstanceID, SignProcessID: Integer; OutputFile: PWideChar): Integer; Stdcall;
Function DLEndSignProcessToFileA(InstanceID, SignProcessID: Integer; OutputFile: PAnsiChar): Integer; Stdcall;
Function DLEndSignProcessToString(InstanceID, SignProcessID: Integer): PAnsiChar; Stdcall;
Function DLExtractFilePageContentToString(InstanceID: Integer; InputFileName, Password: PWideChar; Page: Integer): PAnsiChar; Stdcall;
Function DLExtractFilePageContentToStringA(InstanceID: Integer; InputFileName, Password: PAnsiChar; Page: Integer): PAnsiChar; Stdcall;
Function DLExtractFilePageText(InstanceID: Integer; InputFileName, Password: PWideChar; Page, Options: Integer): PWideChar; Stdcall;
Function DLExtractFilePageTextA(InstanceID: Integer; InputFileName, Password: PAnsiChar; Page, Options: Integer): PAnsiChar; Stdcall;
Function DLExtractFilePageTextBlocks(InstanceID: Integer; InputFileName, Password: PWideChar; Page, Options: Integer): Integer; Stdcall;
Function DLExtractFilePageTextBlocksA(InstanceID: Integer; InputFileName, Password: PAnsiChar; Page, Options: Integer): Integer; Stdcall;
Function DLExtractFilePages(InstanceID: Integer; InputFileName, Password, OutputFileName, RangeList: PWideChar): Integer; Stdcall;
Function DLExtractFilePagesA(InstanceID: Integer; InputFileName, Password, OutputFileName, RangeList: PAnsiChar): Integer; Stdcall;
Function DLExtractFilePagesEx(InstanceID: Integer; InputFileName, Password, OutputFileName, RangeList: PWideChar; Options: Integer): Integer; Stdcall;
Function DLExtractFilePagesExA(InstanceID: Integer; InputFileName, Password, OutputFileName, RangeList: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLExtractPageRanges(InstanceID: Integer; RangeList: PWideChar): Integer; Stdcall;
Function DLExtractPageRangesA(InstanceID: Integer; RangeList: PAnsiChar): Integer; Stdcall;
Function DLExtractPageTextBlocks(InstanceID, ExtractOptions: Integer): Integer; Stdcall;
Function DLExtractPages(InstanceID, StartPage, PageCount: Integer): Integer; Stdcall;
Function DLFileListCount(InstanceID: Integer; ListName: PWideChar): Integer; Stdcall;
Function DLFileListCountA(InstanceID: Integer; ListName: PAnsiChar): Integer; Stdcall;
Function DLFileListItem(InstanceID: Integer; ListName: PWideChar; Index: Integer): PWideChar; Stdcall;
Function DLFileListItemA(InstanceID: Integer; ListName: PAnsiChar; Index: Integer): PAnsiChar; Stdcall;
Function DLFindFonts(InstanceID: Integer): Integer; Stdcall;
Function DLFindFormFieldByTitle(InstanceID: Integer; Title: PWideChar): Integer; Stdcall;
Function DLFindFormFieldByTitleA(InstanceID: Integer; Title: PAnsiChar): Integer; Stdcall;
Function DLFindImages(InstanceID: Integer): Integer; Stdcall;
Function DLFitImage(InstanceID: Integer; Left, Top, Width, Height: Double; HAlign, VAlign, Rotate: Integer): Integer; Stdcall;
Function DLFitRotatedTextBox(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PWideChar; Options: Integer): Integer; Stdcall;
Function DLFitRotatedTextBoxA(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLFitTextBox(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PWideChar; Options: Integer): Integer; Stdcall;
Function DLFitTextBoxA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLFlattenAnnot(InstanceID, Index, Options: Integer): Integer; Stdcall;
Function DLFlattenFormField(InstanceID, Index: Integer): Integer; Stdcall;
Function DLFontCount(InstanceID: Integer): Integer; Stdcall;
Function DLFontFamily(InstanceID: Integer): PWideChar; Stdcall;
Function DLFontFamilyA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLFontHasKerning(InstanceID: Integer): Integer; Stdcall;
Function DLFontName(InstanceID: Integer): PWideChar; Stdcall;
Function DLFontNameA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLFontReference(InstanceID: Integer): PWideChar; Stdcall;
Function DLFontReferenceA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLFontSize(InstanceID: Integer): Integer; Stdcall;
Function DLFontType(InstanceID: Integer): Integer; Stdcall;
Function DLFormFieldCount(InstanceID: Integer): Integer; Stdcall;
Function DLFormFieldHasParent(InstanceID, Index: Integer): Integer; Stdcall;
Function DLFormFieldJavaScriptAction(InstanceID, Index: Integer; ActionType, JavaScript: PWideChar): Integer; Stdcall;
Function DLFormFieldJavaScriptActionA(InstanceID, Index: Integer; ActionType, JavaScript: PAnsiChar): Integer; Stdcall;
Function DLFormFieldWebLinkAction(InstanceID, Index: Integer; ActionType, Link: PWideChar): Integer; Stdcall;
Function DLFormFieldWebLinkActionA(InstanceID, Index: Integer; ActionType, Link: PAnsiChar): Integer; Stdcall;
Function DLGetActionDest(InstanceID, ActionID: Integer): Integer; Stdcall;
Function DLGetActionType(InstanceID, ActionID: Integer): PWideChar; Stdcall;
Function DLGetActionTypeA(InstanceID, ActionID: Integer): PAnsiChar; Stdcall;
Function DLGetActionURL(InstanceID, ActionID: Integer): PWideChar; Stdcall;
Function DLGetActionURLA(InstanceID, ActionID: Integer): PAnsiChar; Stdcall;
Function DLGetAnalysisInfo(InstanceID, AnalysisID, AnalysisItem: Integer): PWideChar; Stdcall;
Function DLGetAnalysisInfoA(InstanceID, AnalysisID, AnalysisItem: Integer): PAnsiChar; Stdcall;
Function DLGetAnnotActionID(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetAnnotDblProperty(InstanceID, Index, Tag: Integer): Double; Stdcall;
Function DLGetAnnotDest(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetAnnotEmbeddedFileName(InstanceID, Index, Options: Integer): PWideChar; Stdcall;
Function DLGetAnnotEmbeddedFileNameA(InstanceID, Index, Options: Integer): PAnsiChar; Stdcall;
Function DLGetAnnotEmbeddedFileToFile(InstanceID, Index, Options: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLGetAnnotEmbeddedFileToFileA(InstanceID, Index, Options: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLGetAnnotEmbeddedFileToString(InstanceID, Index, Options: Integer): PAnsiChar; Stdcall;
Function DLGetAnnotIntProperty(InstanceID, Index, Tag: Integer): Integer; Stdcall;
Function DLGetAnnotQuadCount(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetAnnotQuadPoints(InstanceID, Index, QuadNumber, PointNumber: Integer): Double; Stdcall;
Function DLGetAnnotSoundToFile(InstanceID, Index, Options: Integer; SoundFileName: PWideChar): Integer; Stdcall;
Function DLGetAnnotSoundToFileA(InstanceID, Index, Options: Integer; SoundFileName: PAnsiChar): Integer; Stdcall;
Function DLGetAnnotSoundToString(InstanceID, Index, Options: Integer): PAnsiChar; Stdcall;
Function DLGetAnnotStrProperty(InstanceID, Index, Tag: Integer): PWideChar; Stdcall;
Function DLGetAnnotStrPropertyA(InstanceID, Index, Tag: Integer): PAnsiChar; Stdcall;
Function DLGetBarcodeWidth(InstanceID: Integer; NominalWidth: Double; Text: PWideChar; Barcode: Integer): Double; Stdcall;
Function DLGetBarcodeWidthA(InstanceID: Integer; NominalWidth: Double; Text: PAnsiChar; Barcode: Integer): Double; Stdcall;
Function DLGetBaseURL(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetBaseURLA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetCSDictEPSG(InstanceID, CSDictID: Integer): Integer; Stdcall;
Function DLGetCSDictType(InstanceID, CSDictID: Integer): Integer; Stdcall;
Function DLGetCSDictWKT(InstanceID, CSDictID: Integer): PWideChar; Stdcall;
Function DLGetCSDictWKTA(InstanceID, CSDictID: Integer): PAnsiChar; Stdcall;
Function DLGetCanvasDC(InstanceID, CanvasWidth, CanvasHeight: Integer): HDC; Stdcall;
Function DLGetCanvasDCEx(InstanceID, CanvasWidth, CanvasHeight, ReferenceDC: Integer): Integer; Stdcall;
Function DLGetCatalogInformation(InstanceID: Integer; Key: PWideChar): PWideChar; Stdcall;
Function DLGetCatalogInformationA(InstanceID: Integer; Key: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetContentStreamToString(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetCustomInformation(InstanceID: Integer; Key: PWideChar): PWideChar; Stdcall;
Function DLGetCustomInformationA(InstanceID: Integer; Key: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetCustomKeys(InstanceID, Location: Integer): PWideChar; Stdcall;
Function DLGetCustomKeysA(InstanceID, Location: Integer): PAnsiChar; Stdcall;
Function DLGetDefaultPrinterName(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetDefaultPrinterNameA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetDestName(InstanceID, DestID: Integer): PWideChar; Stdcall;
Function DLGetDestNameA(InstanceID, DestID: Integer): PAnsiChar; Stdcall;
Function DLGetDestPage(InstanceID, DestID: Integer): Integer; Stdcall;
Function DLGetDestType(InstanceID, DestID: Integer): Integer; Stdcall;
Function DLGetDestValue(InstanceID, DestID, ValueKey: Integer): Double; Stdcall;
Function DLGetDocJavaScript(InstanceID: Integer; ActionType: PWideChar): PWideChar; Stdcall;
Function DLGetDocJavaScriptA(InstanceID: Integer; ActionType: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetDocumentFileName(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetDocumentFileNameA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetDocumentFileSize(InstanceID: Integer): Integer; Stdcall;
Function DLGetDocumentID(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetDocumentIdentifier(InstanceID, Part, Options: Integer): PWideChar; Stdcall;
Function DLGetDocumentIdentifierA(InstanceID, Part, Options: Integer): PAnsiChar; Stdcall;
Function DLGetDocumentMetadata(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetDocumentMetadataA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetDocumentRepaired(InstanceID: Integer): Integer; Stdcall;
Function DLGetDocumentResourceList(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetDocumentResourceListA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetEmbeddedFileContentToFile(InstanceID, Index: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLGetEmbeddedFileContentToFileA(InstanceID, Index: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLGetEmbeddedFileContentToString(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetEmbeddedFileID(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetEmbeddedFileIntProperty(InstanceID, Index, Tag: Integer): Integer; Stdcall;
Function DLGetEmbeddedFileStrProperty(InstanceID, Index, Tag: Integer): PWideChar; Stdcall;
Function DLGetEmbeddedFileStrPropertyA(InstanceID, Index, Tag: Integer): PAnsiChar; Stdcall;
Function DLGetEncryptionFingerprint(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetEncryptionFingerprintA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetFileMetadata(InstanceID: Integer; InputFileName, Password: PWideChar): PWideChar; Stdcall;
Function DLGetFileMetadataA(InstanceID: Integer; InputFileName, Password: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetFirstChildOutline(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLGetFirstOutline(InstanceID: Integer): Integer; Stdcall;
Function DLGetFontEncoding(InstanceID: Integer): Integer; Stdcall;
Function DLGetFontFlags(InstanceID, FontFlagItemID: Integer): Integer; Stdcall;
Function DLGetFontID(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFontIsEmbedded(InstanceID: Integer): Integer; Stdcall;
Function DLGetFontIsSubsetted(InstanceID: Integer): Integer; Stdcall;
Function DLGetFontMetrics(InstanceID, MetricType: Integer): Integer; Stdcall;
Function DLGetFontObjectNumber(InstanceID: Integer): Integer; Stdcall;
Function DLGetFormFieldActionID(InstanceID, Index: Integer; TriggerEvent: PWideChar): Integer; Stdcall;
Function DLGetFormFieldActionIDA(InstanceID, Index: Integer; TriggerEvent: PAnsiChar): Integer; Stdcall;
Function DLGetFormFieldAlignment(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldAnnotFlags(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldBackgroundColor(InstanceID, Index, ColorComponent: Integer): Double; Stdcall;
Function DLGetFormFieldBackgroundColorType(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldBorderColor(InstanceID, Index, ColorComponent: Integer): Double; Stdcall;
Function DLGetFormFieldBorderColorType(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldBorderProperty(InstanceID, Index, PropKey: Integer): Double; Stdcall;
Function DLGetFormFieldBorderStyle(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldBound(InstanceID, Index, Edge: Integer): Double; Stdcall;
Function DLGetFormFieldCaption(InstanceID, Index: Integer): PWideChar; Stdcall;
Function DLGetFormFieldCaptionA(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetFormFieldCaptionEx(InstanceID, Index, StringType: Integer): PWideChar; Stdcall;
Function DLGetFormFieldCaptionExA(InstanceID, Index, StringType: Integer): PAnsiChar; Stdcall;
Function DLGetFormFieldCheckStyle(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldChildTitle(InstanceID, Index: Integer): PWideChar; Stdcall;
Function DLGetFormFieldChildTitleA(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetFormFieldChoiceType(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldColor(InstanceID, Index, ColorComponent: Integer): Double; Stdcall;
Function DLGetFormFieldComb(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldDefaultValue(InstanceID, Index: Integer): PWideChar; Stdcall;
Function DLGetFormFieldDefaultValueA(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetFormFieldDescription(InstanceID, Index: Integer): PWideChar; Stdcall;
Function DLGetFormFieldDescriptionA(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetFormFieldFlags(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldFontName(InstanceID, Index: Integer): PWideChar; Stdcall;
Function DLGetFormFieldFontNameA(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetFormFieldJavaScript(InstanceID, Index: Integer; ActionType: PWideChar): PWideChar; Stdcall;
Function DLGetFormFieldJavaScriptA(InstanceID, Index: Integer; ActionType: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetFormFieldKidCount(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldKidTempIndex(InstanceID, Index, SubIndex: Integer): Integer; Stdcall;
Function DLGetFormFieldMaxLen(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldNoExport(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldPage(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldPrintable(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldReadOnly(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldRequired(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldRichTextString(InstanceID, Index: Integer; Key: PWideChar): PWideChar; Stdcall;
Function DLGetFormFieldRichTextStringA(InstanceID, Index: Integer; Key: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetFormFieldRotation(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldSubCount(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldSubDisplayName(InstanceID, Index, SubIndex: Integer): PWideChar; Stdcall;
Function DLGetFormFieldSubDisplayNameA(InstanceID, Index, SubIndex: Integer): PAnsiChar; Stdcall;
Function DLGetFormFieldSubName(InstanceID, Index, SubIndex: Integer): PWideChar; Stdcall;
Function DLGetFormFieldSubNameA(InstanceID, Index, SubIndex: Integer): PAnsiChar; Stdcall;
Function DLGetFormFieldSubmitActionString(InstanceID, Index: Integer; ActionType: PWideChar): PWideChar; Stdcall;
Function DLGetFormFieldSubmitActionStringA(InstanceID, Index: Integer; ActionType: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetFormFieldTabOrder(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldTabOrderEx(InstanceID, Index, Options: Integer): Integer; Stdcall;
Function DLGetFormFieldTextFlags(InstanceID, Index, ValueKey: Integer): Integer; Stdcall;
Function DLGetFormFieldTextSize(InstanceID, Index: Integer): Double; Stdcall;
Function DLGetFormFieldTitle(InstanceID, Index: Integer): PWideChar; Stdcall;
Function DLGetFormFieldTitleA(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetFormFieldType(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldValue(InstanceID, Index: Integer): PWideChar; Stdcall;
Function DLGetFormFieldValueA(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetFormFieldValueByTitle(InstanceID: Integer; Title: PWideChar): PWideChar; Stdcall;
Function DLGetFormFieldValueByTitleA(InstanceID: Integer; Title: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetFormFieldVisible(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetFormFieldWebLink(InstanceID, Index: Integer; ActionType: PWideChar): PWideChar; Stdcall;
Function DLGetFormFieldWebLinkA(InstanceID, Index: Integer; ActionType: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetFormFontCount(InstanceID: Integer): Integer; Stdcall;
Function DLGetFormFontName(InstanceID, FontIndex: Integer): PWideChar; Stdcall;
Function DLGetFormFontNameA(InstanceID, FontIndex: Integer): PAnsiChar; Stdcall;
Function DLGetGlobalJavaScript(InstanceID: Integer; PackageName: PWideChar): PWideChar; Stdcall;
Function DLGetGlobalJavaScriptA(InstanceID: Integer; PackageName: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetHTMLTextHeight(InstanceID: Integer; Width: Double; HTMLText: PWideChar): Double; Stdcall;
Function DLGetHTMLTextHeightA(InstanceID: Integer; Width: Double; HTMLText: PAnsiChar): Double; Stdcall;
Function DLGetHTMLTextLineCount(InstanceID: Integer; Width: Double; HTMLText: PWideChar): Integer; Stdcall;
Function DLGetHTMLTextLineCountA(InstanceID: Integer; Width: Double; HTMLText: PAnsiChar): Integer; Stdcall;
Function DLGetHTMLTextWidth(InstanceID: Integer; MaxWidth: Double; HTMLText: PWideChar): Double; Stdcall;
Function DLGetHTMLTextWidthA(InstanceID: Integer; MaxWidth: Double; HTMLText: PAnsiChar): Double; Stdcall;
Function DLGetImageID(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetImageListCount(InstanceID, ImageListID: Integer): Integer; Stdcall;
Function DLGetImageListItemDataToString(InstanceID, ImageListID, ImageIndex, Options: Integer): PAnsiChar; Stdcall;
Function DLGetImageListItemDblProperty(InstanceID, ImageListID, ImageIndex, PropertyID: Integer): Double; Stdcall;
Function DLGetImageListItemFormatDesc(InstanceID, ImageListID, ImageIndex, Options: Integer): PWideChar; Stdcall;
Function DLGetImageListItemFormatDescA(InstanceID, ImageListID, ImageIndex, Options: Integer): PAnsiChar; Stdcall;
Function DLGetImageListItemIntProperty(InstanceID, ImageListID, ImageIndex, PropertyID: Integer): Integer; Stdcall;
Function DLGetImageMeasureDict(InstanceID: Integer): Integer; Stdcall;
Function DLGetImagePageCount(InstanceID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLGetImagePageCountA(InstanceID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLGetImagePageCountFromString(InstanceID: Integer; Source: PAnsiChar): Integer; Stdcall;
Function DLGetImagePtDataDict(InstanceID: Integer): Integer; Stdcall;
Function DLGetInformation(InstanceID, Key: Integer): PWideChar; Stdcall;
Function DLGetInformationA(InstanceID, Key: Integer): PAnsiChar; Stdcall;
Function DLGetInstalledFontsByCharset(InstanceID, CharsetIndex, Options: Integer): PWideChar; Stdcall;
Function DLGetInstalledFontsByCharsetA(InstanceID, CharsetIndex, Options: Integer): PAnsiChar; Stdcall;
Function DLGetInstalledFontsByCodePage(InstanceID, CodePage, Options: Integer): PWideChar; Stdcall;
Function DLGetInstalledFontsByCodePageA(InstanceID, CodePage, Options: Integer): PAnsiChar; Stdcall;
Function DLGetKerning(InstanceID: Integer; CharPair: PWideChar): Integer; Stdcall;
Function DLGetKerningA(InstanceID: Integer; CharPair: PAnsiChar): Integer; Stdcall;
Function DLGetLatestPrinterNames(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetLatestPrinterNamesA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetMaxObjectNumber(InstanceID: Integer): Integer; Stdcall;
Function DLGetMeasureDictBoundsCount(InstanceID, MeasureDictID: Integer): Integer; Stdcall;
Function DLGetMeasureDictBoundsItem(InstanceID, MeasureDictID, ItemIndex: Integer): Double; Stdcall;
Function DLGetMeasureDictCoordinateSystem(InstanceID, MeasureDictID: Integer): Integer; Stdcall;
Function DLGetMeasureDictDCSDict(InstanceID, MeasureDictID: Integer): Integer; Stdcall;
Function DLGetMeasureDictGCSDict(InstanceID, MeasureDictID: Integer): Integer; Stdcall;
Function DLGetMeasureDictGPTSCount(InstanceID, MeasureDictID: Integer): Integer; Stdcall;
Function DLGetMeasureDictGPTSItem(InstanceID, MeasureDictID, ItemIndex: Integer): Double; Stdcall;
Function DLGetMeasureDictLPTSCount(InstanceID, MeasureDictID: Integer): Integer; Stdcall;
Function DLGetMeasureDictLPTSItem(InstanceID, MeasureDictID, ItemIndex: Integer): Double; Stdcall;
Function DLGetMeasureDictPDU(InstanceID, MeasureDictID, UnitIndex: Integer): Integer; Stdcall;
Function DLGetNamedDestination(InstanceID: Integer; DestName: PWideChar): Integer; Stdcall;
Function DLGetNamedDestinationA(InstanceID: Integer; DestName: PAnsiChar): Integer; Stdcall;
Function DLGetNextOutline(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLGetObjectCount(InstanceID: Integer): Integer; Stdcall;
Function DLGetObjectDecodeError(InstanceID, ObjectNumber: Integer): Integer; Stdcall;
Function DLGetObjectToString(InstanceID, ObjectNumber: Integer): PAnsiChar; Stdcall;
Function DLGetOpenActionDestination(InstanceID: Integer): Integer; Stdcall;
Function DLGetOpenActionJavaScript(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetOpenActionJavaScriptA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetOptionalContentConfigCount(InstanceID: Integer): Integer; Stdcall;
Function DLGetOptionalContentConfigLocked(InstanceID, OptionalContentConfigID, OptionalContentGroupID: Integer): Integer; Stdcall;
Function DLGetOptionalContentConfigOrderCount(InstanceID, OptionalContentConfigID: Integer): Integer; Stdcall;
Function DLGetOptionalContentConfigOrderItemID(InstanceID, OptionalContentConfigID, ItemIndex: Integer): Integer; Stdcall;
Function DLGetOptionalContentConfigOrderItemLabel(InstanceID, OptionalContentConfigID, ItemIndex: Integer): PWideChar; Stdcall;
Function DLGetOptionalContentConfigOrderItemLabelA(InstanceID, OptionalContentConfigID, ItemIndex: Integer): PAnsiChar; Stdcall;
Function DLGetOptionalContentConfigOrderItemLevel(InstanceID, OptionalContentConfigID, ItemIndex: Integer): Integer; Stdcall;
Function DLGetOptionalContentConfigOrderItemType(InstanceID, OptionalContentConfigID, ItemIndex: Integer): Integer; Stdcall;
Function DLGetOptionalContentConfigState(InstanceID, OptionalContentConfigID, OptionalContentGroupID: Integer): Integer; Stdcall;
Function DLGetOptionalContentGroupID(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetOptionalContentGroupName(InstanceID, OptionalContentGroupID: Integer): PWideChar; Stdcall;
Function DLGetOptionalContentGroupNameA(InstanceID, OptionalContentGroupID: Integer): PAnsiChar; Stdcall;
Function DLGetOptionalContentGroupPrintable(InstanceID, OptionalContentGroupID: Integer): Integer; Stdcall;
Function DLGetOptionalContentGroupVisible(InstanceID, OptionalContentGroupID: Integer): Integer; Stdcall;
Function DLGetOrigin(InstanceID: Integer): Integer; Stdcall;
Function DLGetOutlineActionID(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLGetOutlineColor(InstanceID, OutlineID, ColorComponent: Integer): Double; Stdcall;
Function DLGetOutlineDest(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLGetOutlineID(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetOutlineJavaScript(InstanceID, OutlineID: Integer): PWideChar; Stdcall;
Function DLGetOutlineJavaScriptA(InstanceID, OutlineID: Integer): PAnsiChar; Stdcall;
Function DLGetOutlineObjectNumber(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLGetOutlineOpenFile(InstanceID, OutlineID: Integer): PWideChar; Stdcall;
Function DLGetOutlineOpenFileA(InstanceID, OutlineID: Integer): PAnsiChar; Stdcall;
Function DLGetOutlinePage(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLGetOutlineStyle(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLGetOutlineWebLink(InstanceID, OutlineID: Integer): PWideChar; Stdcall;
Function DLGetOutlineWebLinkA(InstanceID, OutlineID: Integer): PAnsiChar; Stdcall;
Function DLGetPageBox(InstanceID, BoxType, Dimension: Integer): Double; Stdcall;
Function DLGetPageColorSpaces(InstanceID, Options: Integer): PWideChar; Stdcall;
Function DLGetPageColorSpacesA(InstanceID, Options: Integer): PAnsiChar; Stdcall;
Function DLGetPageContentToString(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetPageImageList(InstanceID, Options: Integer): Integer; Stdcall;
Function DLGetPageJavaScript(InstanceID: Integer; ActionType: PWideChar): PWideChar; Stdcall;
Function DLGetPageJavaScriptA(InstanceID: Integer; ActionType: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetPageLGIDictContent(InstanceID, DictIndex: Integer): PWideChar; Stdcall;
Function DLGetPageLGIDictContentA(InstanceID, DictIndex: Integer): PAnsiChar; Stdcall;
Function DLGetPageLGIDictCount(InstanceID: Integer): Integer; Stdcall;
Function DLGetPageLabel(InstanceID, Page: Integer): PWideChar; Stdcall;
Function DLGetPageLabelA(InstanceID, Page: Integer): PAnsiChar; Stdcall;
Function DLGetPageLayout(InstanceID: Integer): Integer; Stdcall;
Function DLGetPageMetricsToString(InstanceID, StartPage, EndPage, Options: Integer): PAnsiChar; Stdcall;
Function DLGetPageMode(InstanceID: Integer): Integer; Stdcall;
Function DLGetPageText(InstanceID, ExtractOptions: Integer): PWideChar; Stdcall;
Function DLGetPageTextA(InstanceID, ExtractOptions: Integer): PAnsiChar; Stdcall;
Function DLGetPageUserUnit(InstanceID: Integer): Double; Stdcall;
Function DLGetPageViewPortCount(InstanceID: Integer): Integer; Stdcall;
Function DLGetPageViewPortID(InstanceID, Index: Integer): Integer; Stdcall;
Function DLGetParentOutline(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLGetPrevOutline(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLGetPrintPreviewBitmapToString(InstanceID: Integer; PrinterName: PWideChar; PreviewPage, PrintOptions, MaxDimension, PreviewOptions: Integer)
  : PAnsiChar; Stdcall;
Function DLGetPrintPreviewBitmapToStringA(InstanceID: Integer; PrinterName: PAnsiChar; PreviewPage, PrintOptions, MaxDimension, PreviewOptions: Integer)
  : PAnsiChar; Stdcall;
Function DLGetPrinterBins(InstanceID: Integer; PrinterName: PWideChar): PWideChar; Stdcall;
Function DLGetPrinterBinsA(InstanceID: Integer; PrinterName: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetPrinterDevModeToString(InstanceID: Integer; PrinterName: PWideChar): PAnsiChar; Stdcall;
Function DLGetPrinterDevModeToStringA(InstanceID: Integer; PrinterName: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetPrinterMediaTypes(InstanceID: Integer; PrinterName: PWideChar): PWideChar; Stdcall;
Function DLGetPrinterMediaTypesA(InstanceID: Integer; PrinterName: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetPrinterNames(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetPrinterNamesA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetRenderScale(InstanceID: Integer): Double; Stdcall;
Function DLGetSignProcessByteRange(InstanceID, SignProcessID, ArrayPosition: Integer): Integer; Stdcall;
Function DLGetSignProcessResult(InstanceID, SignProcessID: Integer): Integer; Stdcall;
Function DLGetStringListCount(InstanceID, StringListID: Integer): Integer; Stdcall;
Function DLGetStringListItem(InstanceID, StringListID, ItemIndex: Integer): PWideChar; Stdcall;
Function DLGetStringListItemA(InstanceID, StringListID, ItemIndex: Integer): PAnsiChar; Stdcall;
Function DLGetTabOrderMode(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetTabOrderModeA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetTableCellDblProperty(InstanceID, TableID, RowNumber, ColumnNumber, Tag: Integer): Double; Stdcall;
Function DLGetTableCellIntProperty(InstanceID, TableID, RowNumber, ColumnNumber, Tag: Integer): Integer; Stdcall;
Function DLGetTableCellStrProperty(InstanceID, TableID, RowNumber, ColumnNumber, Tag: Integer): PWideChar; Stdcall;
Function DLGetTableCellStrPropertyA(InstanceID, TableID, RowNumber, ColumnNumber, Tag: Integer): PAnsiChar; Stdcall;
Function DLGetTableColumnCount(InstanceID, TableID: Integer): Integer; Stdcall;
Function DLGetTableLastDrawnRow(InstanceID, TableID: Integer): Integer; Stdcall;
Function DLGetTableRowCount(InstanceID, TableID: Integer): Integer; Stdcall;
Function DLGetTempPath(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetTempPathA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLGetTextAscent(InstanceID: Integer): Double; Stdcall;
Function DLGetTextBlockAsString(InstanceID, TextBlockListID, Index: Integer): PWideChar; Stdcall;
Function DLGetTextBlockAsStringA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetTextBlockBound(InstanceID, TextBlockListID, Index, BoundIndex: Integer): Double; Stdcall;
Function DLGetTextBlockCharWidth(InstanceID, TextBlockListID, Index, CharIndex: Integer): Double; Stdcall;
Function DLGetTextBlockColor(InstanceID, TextBlockListID, Index, ColorComponent: Integer): Double; Stdcall;
Function DLGetTextBlockColorType(InstanceID, TextBlockListID, Index: Integer): Integer; Stdcall;
Function DLGetTextBlockCount(InstanceID, TextBlockListID: Integer): Integer; Stdcall;
Function DLGetTextBlockFontName(InstanceID, TextBlockListID, Index: Integer): PWideChar; Stdcall;
Function DLGetTextBlockFontNameA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetTextBlockFontSize(InstanceID, TextBlockListID, Index: Integer): Double; Stdcall;
Function DLGetTextBlockText(InstanceID, TextBlockListID, Index: Integer): PWideChar; Stdcall;
Function DLGetTextBlockTextA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetTextBound(InstanceID, Edge: Integer): Double; Stdcall;
Function DLGetTextDescent(InstanceID: Integer): Double; Stdcall;
Function DLGetTextHeight(InstanceID: Integer): Double; Stdcall;
Function DLGetTextSize(InstanceID: Integer): Double; Stdcall;
Function DLGetTextWidth(InstanceID: Integer; Text: PWideChar): Double; Stdcall;
Function DLGetTextWidthA(InstanceID: Integer; Text: PAnsiChar): Double; Stdcall;
Function DLGetUnicodeCharactersFromEncoding(InstanceID, Encoding: Integer): PWideChar; Stdcall;
Function DLGetUnicodeCharactersFromEncodingA(InstanceID, Encoding: Integer): PAnsiChar; Stdcall;
Function DLGetViewPortBBox(InstanceID, ViewPortID, Dimension: Integer): Double; Stdcall;
Function DLGetViewPortMeasureDict(InstanceID, ViewPortID: Integer): Integer; Stdcall;
Function DLGetViewPortName(InstanceID, ViewPortID: Integer): PWideChar; Stdcall;
Function DLGetViewPortNameA(InstanceID, ViewPortID: Integer): PAnsiChar; Stdcall;
Function DLGetViewPortPtDataDict(InstanceID, ViewPortID: Integer): Integer; Stdcall;
Function DLGetViewerPreferences(InstanceID, Option: Integer): Integer; Stdcall;
Function DLGetWrappedText(InstanceID: Integer; Width: Double; Delimiter, Text: PWideChar): PWideChar; Stdcall;
Function DLGetWrappedTextA(InstanceID: Integer; Width: Double; Delimiter, Text: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetWrappedTextBreakString(InstanceID: Integer; Width: Double; Delimiter, Text: PWideChar): PWideChar; Stdcall;
Function DLGetWrappedTextBreakStringA(InstanceID: Integer; Width: Double; Delimiter, Text: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetWrappedTextHeight(InstanceID: Integer; Width: Double; Text: PWideChar): Double; Stdcall;
Function DLGetWrappedTextHeightA(InstanceID: Integer; Width: Double; Text: PAnsiChar): Double; Stdcall;
Function DLGetWrappedTextLineCount(InstanceID: Integer; Width: Double; Text: PWideChar): Integer; Stdcall;
Function DLGetWrappedTextLineCountA(InstanceID: Integer; Width: Double; Text: PAnsiChar): Integer; Stdcall;
Function DLGetXFAFormFieldCount(InstanceID: Integer): Integer; Stdcall;
Function DLGetXFAFormFieldName(InstanceID, Index: Integer): PWideChar; Stdcall;
Function DLGetXFAFormFieldNameA(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLGetXFAFormFieldNames(InstanceID: Integer; Delimiter: PWideChar): PWideChar; Stdcall;
Function DLGetXFAFormFieldNamesA(InstanceID: Integer; Delimiter: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetXFAFormFieldValue(InstanceID: Integer; XFAFieldName: PWideChar): PWideChar; Stdcall;
Function DLGetXFAFormFieldValueA(InstanceID: Integer; XFAFieldName: PAnsiChar): PAnsiChar; Stdcall;
Function DLGetXFAToString(InstanceID, Options: Integer): PAnsiChar; Stdcall;
Function DLGlobalJavaScriptCount(InstanceID: Integer): Integer; Stdcall;
Function DLGlobalJavaScriptPackageName(InstanceID, Index: Integer): PWideChar; Stdcall;
Function DLGlobalJavaScriptPackageNameA(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLHasFontResources(InstanceID: Integer): Integer; Stdcall;
Function DLHasPageBox(InstanceID, BoxType: Integer): Integer; Stdcall;
Function DLHidePage(InstanceID: Integer): Integer; Stdcall;
Function DLImageCount(InstanceID: Integer): Integer; Stdcall;
Function DLImageFillColor(InstanceID: Integer): Integer; Stdcall;
Function DLImageHeight(InstanceID: Integer): Integer; Stdcall;
Function DLImageHorizontalResolution(InstanceID: Integer): Integer; Stdcall;
Function DLImageResolutionUnits(InstanceID: Integer): Integer; Stdcall;
Function DLImageType(InstanceID: Integer): Integer; Stdcall;
Function DLImageVerticalResolution(InstanceID: Integer): Integer; Stdcall;
Function DLImageWidth(InstanceID: Integer): Integer; Stdcall;
Function DLImportEMFFromFile(InstanceID: Integer; FileName: PWideChar; FontOptions, GeneralOptions: Integer): Integer; Stdcall;
Function DLImportEMFFromFileA(InstanceID: Integer; FileName: PAnsiChar; FontOptions, GeneralOptions: Integer): Integer; Stdcall;
Function DLInsertPages(InstanceID, StartPage, PageCount: Integer): Integer; Stdcall;
Function DLInsertTableColumns(InstanceID, TableID, Position, NewColumnCount: Integer): Integer; Stdcall;
Function DLInsertTableRows(InstanceID, TableID, Position, NewRowCount: Integer): Integer; Stdcall;
Function DLIsAnnotFormField(InstanceID, Index: Integer): Integer; Stdcall;
Function DLIsLinearized(InstanceID: Integer): Integer; Stdcall;
Function DLIsTaggedPDF(InstanceID: Integer): Integer; Stdcall;
Function DLLastErrorCode(InstanceID: Integer): Integer; Stdcall;
Function DLLastRenderError(InstanceID: Integer): PWideChar; Stdcall;
Function DLLastRenderErrorA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLLibraryVersion(InstanceID: Integer): PWideChar; Stdcall;
Function DLLibraryVersionA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLLibraryVersionEx(InstanceID: Integer): PWideChar; Stdcall;
Function DLLibraryVersionExA(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLLinearizeFile(InstanceID: Integer; InputFileName, Password, OutputFileName: PWideChar; Options: Integer): Integer; Stdcall;
Function DLLinearizeFileA(InstanceID: Integer; InputFileName, Password, OutputFileName: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLLoadFromCanvasDC(InstanceID: Integer; DPI: Double; Options: Integer): Integer; Stdcall;
Function DLLoadFromFile(InstanceID: Integer; FileName, Password: PWideChar): Integer; Stdcall;
Function DLLoadFromFileA(InstanceID: Integer; FileName, Password: PAnsiChar): Integer; Stdcall;
Function DLLoadFromString(InstanceID: Integer; Source: PAnsiChar; Password: PWideChar): Integer; Stdcall;
Function DLLoadFromStringA(InstanceID: Integer; Source: PAnsiChar; Password: PAnsiChar): Integer; Stdcall;
Function DLLoadState(InstanceID: Integer): Integer; Stdcall;
Function DLMergeDocument(InstanceID, DocumentID: Integer): Integer; Stdcall;
Function DLMergeFileList(InstanceID: Integer; ListName, OutputFileName: PWideChar): Integer; Stdcall;
Function DLMergeFileListA(InstanceID: Integer; ListName, OutputFileName: PAnsiChar): Integer; Stdcall;
Function DLMergeFileListFast(InstanceID: Integer; ListName, OutputFileName: PWideChar): Integer; Stdcall;
Function DLMergeFileListFastA(InstanceID: Integer; ListName, OutputFileName: PAnsiChar): Integer; Stdcall;
Function DLMergeFiles(InstanceID: Integer; FirstFileName, SecondFileName, OutputFileName: PWideChar): Integer; Stdcall;
Function DLMergeFilesA(InstanceID: Integer; FirstFileName, SecondFileName, OutputFileName: PAnsiChar): Integer; Stdcall;
Function DLMergeTableCells(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer): Integer; Stdcall;
Function DLMoveContentStream(InstanceID, FromPosition, ToPosition: Integer): Integer; Stdcall;
Function DLMoveOutlineAfter(InstanceID, OutlineID, SiblingID: Integer): Integer; Stdcall;
Function DLMoveOutlineBefore(InstanceID, OutlineID, SiblingID: Integer): Integer; Stdcall;
Function DLMovePage(InstanceID, NewPosition: Integer): Integer; Stdcall;
Function DLMovePath(InstanceID: Integer; NewX, NewY: Double): Integer; Stdcall;
Function DLMultiplyScale(InstanceID: Integer; MultScaleBy: Double): Integer; Stdcall;
Function DLNewChildFormField(InstanceID, Index: Integer; Title: PWideChar; FieldType: Integer): Integer; Stdcall;
Function DLNewChildFormFieldA(InstanceID, Index: Integer; Title: PAnsiChar; FieldType: Integer): Integer; Stdcall;
Function DLNewContentStream(InstanceID: Integer): Integer; Stdcall;
Function DLNewCustomPrinter(InstanceID: Integer; OriginalPrinterName: PWideChar): PWideChar; Stdcall;
Function DLNewCustomPrinterA(InstanceID: Integer; OriginalPrinterName: PAnsiChar): PAnsiChar; Stdcall;
Function DLNewDestination(InstanceID, DestPage, Zoom, DestType: Integer; Left, Top, Right, Bottom: Double): Integer; Stdcall;
Function DLNewDocument(InstanceID: Integer): Integer; Stdcall;
Function DLNewFormField(InstanceID: Integer; Title: PWideChar; FieldType: Integer): Integer; Stdcall;
Function DLNewFormFieldA(InstanceID: Integer; Title: PAnsiChar; FieldType: Integer): Integer; Stdcall;
Function DLNewInternalPrinterObject(InstanceID, Options: Integer): Integer; Stdcall;
Function DLNewNamedDestination(InstanceID: Integer; DestName: PWideChar; DestID: Integer): Integer; Stdcall;
Function DLNewNamedDestinationA(InstanceID: Integer; DestName: PAnsiChar; DestID: Integer): Integer; Stdcall;
Function DLNewOptionalContentGroup(InstanceID: Integer; GroupName: PWideChar): Integer; Stdcall;
Function DLNewOptionalContentGroupA(InstanceID: Integer; GroupName: PAnsiChar): Integer; Stdcall;
Function DLNewOutline(InstanceID, Parent: Integer; Title: PWideChar; DestPage: Integer; DestPosition: Double): Integer; Stdcall;
Function DLNewOutlineA(InstanceID, Parent: Integer; Title: PAnsiChar; DestPage: Integer; DestPosition: Double): Integer; Stdcall;
Function DLNewPage(InstanceID: Integer): Integer; Stdcall;
Function DLNewPageFromCanvasDC(InstanceID: Integer; DPI: Double; Options: Integer): Integer; Stdcall;
Function DLNewPages(InstanceID, PageCount: Integer): Integer; Stdcall;
Function DLNewPostScriptXObject(InstanceID: Integer; PS: PWideChar): Integer; Stdcall;
Function DLNewPostScriptXObjectA(InstanceID: Integer; PS: PAnsiChar): Integer; Stdcall;
Function DLNewRGBAxialShader(InstanceID: Integer; ShaderName: PWideChar; StartX, StartY, StartRed, StartGreen, StartBlue, EndX, EndY, EndRed, EndGreen,
  EndBlue: Double; Extend: Integer): Integer; Stdcall;
Function DLNewRGBAxialShaderA(InstanceID: Integer; ShaderName: PAnsiChar; StartX, StartY, StartRed, StartGreen, StartBlue, EndX, EndY, EndRed, EndGreen,
  EndBlue: Double; Extend: Integer): Integer; Stdcall;
Function DLNewSignProcessFromFile(InstanceID: Integer; InputFile, Password: PWideChar): Integer; Stdcall;
Function DLNewSignProcessFromFileA(InstanceID: Integer; InputFile, Password: PAnsiChar): Integer; Stdcall;
Function DLNewSignProcessFromString(InstanceID: Integer; Source: PAnsiChar; Password: PWideChar): Integer; Stdcall;
Function DLNewSignProcessFromStringA(InstanceID: Integer; Source: PAnsiChar; Password: PAnsiChar): Integer; Stdcall;
Function DLNewStaticOutline(InstanceID, Parent: Integer; Title: PWideChar): Integer; Stdcall;
Function DLNewStaticOutlineA(InstanceID, Parent: Integer; Title: PAnsiChar): Integer; Stdcall;
Function DLNewTilingPatternFromCapturedPage(InstanceID: Integer; PatternName: PWideChar; CaptureID: Integer): Integer; Stdcall;
Function DLNewTilingPatternFromCapturedPageA(InstanceID: Integer; PatternName: PAnsiChar; CaptureID: Integer): Integer; Stdcall;
Function DLNoEmbedFontListAdd(InstanceID: Integer; FontName: PWideChar): Integer; Stdcall;
Function DLNoEmbedFontListAddA(InstanceID: Integer; FontName: PAnsiChar): Integer; Stdcall;
Function DLNoEmbedFontListCount(InstanceID: Integer): Integer; Stdcall;
Function DLNoEmbedFontListGet(InstanceID, Index: Integer): PWideChar; Stdcall;
Function DLNoEmbedFontListGetA(InstanceID, Index: Integer): PAnsiChar; Stdcall;
Function DLNoEmbedFontListRemoveAll(InstanceID: Integer): Integer; Stdcall;
Function DLNoEmbedFontListRemoveIndex(InstanceID, Index: Integer): Integer; Stdcall;
Function DLNoEmbedFontListRemoveName(InstanceID: Integer; FontName: PWideChar): Integer; Stdcall;
Function DLNoEmbedFontListRemoveNameA(InstanceID: Integer; FontName: PAnsiChar): Integer; Stdcall;
Function DLNormalizePage(InstanceID, NormalizeOptions: Integer): Integer; Stdcall;
Function DLOpenOutline(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLOptionalContentGroupCount(InstanceID: Integer): Integer; Stdcall;
Function DLOutlineCount(InstanceID: Integer): Integer; Stdcall;
Function DLOutlineTitle(InstanceID, OutlineID: Integer): PWideChar; Stdcall;
Function DLOutlineTitleA(InstanceID, OutlineID: Integer): PAnsiChar; Stdcall;
Function DLPageCount(InstanceID: Integer): Integer; Stdcall;
Function DLPageHasFontResources(InstanceID, PageNumber: Integer): Integer; Stdcall;
Function DLPageHeight(InstanceID: Integer): Double; Stdcall;
Function DLPageJavaScriptAction(InstanceID: Integer; ActionType, JavaScript: PWideChar): Integer; Stdcall;
Function DLPageJavaScriptActionA(InstanceID: Integer; ActionType, JavaScript: PAnsiChar): Integer; Stdcall;
Function DLPageRotation(InstanceID: Integer): Integer; Stdcall;
Function DLPageWidth(InstanceID: Integer): Double; Stdcall;
Function DLPrintDocument(InstanceID: Integer; PrinterName: PWideChar; StartPage, EndPage, Options: Integer): Integer; Stdcall;
Function DLPrintDocumentA(InstanceID: Integer; PrinterName: PAnsiChar; StartPage, EndPage, Options: Integer): Integer; Stdcall;
Function DLPrintDocumentToFile(InstanceID: Integer; PrinterName: PWideChar; StartPage, EndPage, Options: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLPrintDocumentToFileA(InstanceID: Integer; PrinterName: PAnsiChar; StartPage, EndPage, Options: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLPrintMode(InstanceID, Mode: Integer): Integer; Stdcall;
Function DLPrintOptions(InstanceID, PageScaling, AutoRotateCenter: Integer; Title: PWideChar): Integer; Stdcall;
Function DLPrintOptionsA(InstanceID, PageScaling, AutoRotateCenter: Integer; Title: PAnsiChar): Integer; Stdcall;
Function DLPrintPages(InstanceID: Integer; PrinterName, PageRanges: PWideChar; Options: Integer): Integer; Stdcall;
Function DLPrintPagesA(InstanceID: Integer; PrinterName, PageRanges: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLPrintPagesToFile(InstanceID: Integer; PrinterName, PageRanges: PWideChar; Options: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLPrintPagesToFileA(InstanceID: Integer; PrinterName, PageRanges: PAnsiChar; Options: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLReleaseBuffer(InstanceID: Integer; Buffer: PAnsiChar): Integer; Stdcall;
Function DLReleaseImage(InstanceID, ImageID: Integer): Integer; Stdcall;
Function DLReleaseImageList(InstanceID, ImageListID: Integer): Integer; Stdcall;
Function DLReleaseLibrary(InstanceID: Integer): Integer; Stdcall;
Function DLReleaseSignProcess(InstanceID, SignProcessID: Integer): Integer; Stdcall;
Function DLReleaseStringList(InstanceID, StringListID: Integer): Integer; Stdcall;
Function DLReleaseTextBlocks(InstanceID, TextBlockListID: Integer): Integer; Stdcall;
Function DLRemoveAppearanceStream(InstanceID, Index: Integer): Integer; Stdcall;
Function DLRemoveCustomInformation(InstanceID: Integer; Key: PWideChar): Integer; Stdcall;
Function DLRemoveCustomInformationA(InstanceID: Integer; Key: PAnsiChar): Integer; Stdcall;
Function DLRemoveDocument(InstanceID, DocumentID: Integer): Integer; Stdcall;
Function DLRemoveEmbeddedFile(InstanceID, Index: Integer): Integer; Stdcall;
Function DLRemoveFormFieldBackgroundColor(InstanceID, Index: Integer): Integer; Stdcall;
Function DLRemoveFormFieldBorderColor(InstanceID, Index: Integer): Integer; Stdcall;
Function DLRemoveFormFieldChoiceSub(InstanceID, Index: Integer; SubName: PWideChar): Integer; Stdcall;
Function DLRemoveFormFieldChoiceSubA(InstanceID, Index: Integer; SubName: PAnsiChar): Integer; Stdcall;
Function DLRemoveGlobalJavaScript(InstanceID: Integer; PackageName: PWideChar): Integer; Stdcall;
Function DLRemoveGlobalJavaScriptA(InstanceID: Integer; PackageName: PAnsiChar): Integer; Stdcall;
Function DLRemoveOpenAction(InstanceID: Integer): Integer; Stdcall;
Function DLRemoveOutline(InstanceID, OutlineID: Integer): Integer; Stdcall;
Function DLRemovePageBox(InstanceID, BoxType: Integer): Integer; Stdcall;
Function DLRemoveSharedContentStreams(InstanceID: Integer): Integer; Stdcall;
Function DLRemoveStyle(InstanceID: Integer; StyleName: PWideChar): Integer; Stdcall;
Function DLRemoveStyleA(InstanceID: Integer; StyleName: PAnsiChar): Integer; Stdcall;
Function DLRemoveUsageRights(InstanceID: Integer): Integer; Stdcall;
Function DLRemoveXFAEntries(InstanceID, Options: Integer): Integer; Stdcall;
Function DLRenderAsMultipageTIFFToFile(InstanceID: Integer; DPI: Double; PageRanges: PWideChar; ImageOptions, OutputOptions: Integer; FileName: PWideChar)
  : Integer; Stdcall;
Function DLRenderAsMultipageTIFFToFileA(InstanceID: Integer; DPI: Double; PageRanges: PAnsiChar; ImageOptions, OutputOptions: Integer; FileName: PAnsiChar)
  : Integer; Stdcall;
Function DLRenderDocumentToFile(InstanceID: Integer; DPI: Double; StartPage, EndPage, Options: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLRenderDocumentToFileA(InstanceID: Integer; DPI: Double; StartPage, EndPage, Options: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLRenderPageToDC(InstanceID: Integer; DPI: Double; Page: Integer; DC: HDC): Integer; Stdcall;
Function DLRenderPageToDCClip(InstanceID: Integer; DPI: Double; Page, DC: Integer; Clip: PAnsiChar): Integer; Stdcall;
Function DLRenderPageToFile(InstanceID: Integer; DPI: Double; Page, Options: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLRenderPageToFileA(InstanceID: Integer; DPI: Double; Page, Options: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLRenderPageToString(InstanceID: Integer; DPI: Double; Page, Options: Integer): PAnsiChar; Stdcall;
Function DLReplaceFonts(InstanceID, Options: Integer): Integer; Stdcall;
Function DLReplaceImage(InstanceID, OriginalImageID, NewImageID: Integer): Integer; Stdcall;
Function DLReplaceTag(InstanceID: Integer; Tag, NewValue: PWideChar): Integer; Stdcall;
Function DLReplaceTagA(InstanceID: Integer; Tag, NewValue: PAnsiChar): Integer; Stdcall;
Function DLRequestPrinterStatus(InstanceID, StatusCommand: Integer): Integer; Stdcall;
Function DLRetrieveCustomDataToFile(InstanceID: Integer; Key, FileName: PWideChar; Location: Integer): Integer; Stdcall;
Function DLRetrieveCustomDataToFileA(InstanceID: Integer; Key, FileName: PAnsiChar; Location: Integer): Integer; Stdcall;
Function DLRetrieveCustomDataToString(InstanceID: Integer; Key: PAnsiChar; Location: Integer): PAnsiChar; Stdcall;
Function DLReverseImage(InstanceID, Reset: Integer): Integer; Stdcall;
Function DLRotatePage(InstanceID, PageRotation: Integer): Integer; Stdcall;
Function DLSaveFontToFile(InstanceID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLSaveFontToFileA(InstanceID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLSaveImageListItemDataToFile(InstanceID, ImageListID, ImageIndex, Options: Integer; ImageFileName: PWideChar): Integer; Stdcall;
Function DLSaveImageListItemDataToFileA(InstanceID, ImageListID, ImageIndex, Options: Integer; ImageFileName: PAnsiChar): Integer; Stdcall;
Function DLSaveImageToFile(InstanceID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLSaveImageToFileA(InstanceID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLSaveImageToString(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLSaveState(InstanceID: Integer): Integer; Stdcall;
Function DLSaveStyle(InstanceID: Integer; StyleName: PWideChar): Integer; Stdcall;
Function DLSaveStyleA(InstanceID: Integer; StyleName: PAnsiChar): Integer; Stdcall;
Function DLSaveToFile(InstanceID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLSaveToFileA(InstanceID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLSaveToString(InstanceID: Integer): PAnsiChar; Stdcall;
Function DLSecurityInfo(InstanceID, SecurityItem: Integer): Integer; Stdcall;
Function DLSelectContentStream(InstanceID, NewIndex: Integer): Integer; Stdcall;
Function DLSelectDocument(InstanceID, DocumentID: Integer): Integer; Stdcall;
Function DLSelectFont(InstanceID, FontID: Integer): Integer; Stdcall;
Function DLSelectImage(InstanceID, ImageID: Integer): Integer; Stdcall;
Function DLSelectPage(InstanceID, PageNumber: Integer): Integer; Stdcall;
Function DLSelectRenderer(InstanceID, RendererID: Integer): Integer; Stdcall;
Function DLSelectedDocument(InstanceID: Integer): Integer; Stdcall;
Function DLSelectedFont(InstanceID: Integer): Integer; Stdcall;
Function DLSelectedImage(InstanceID: Integer): Integer; Stdcall;
Function DLSelectedPage(InstanceID: Integer): Integer; Stdcall;
Function DLSelectedRenderer(InstanceID: Integer): Integer; Stdcall;
Function DLSetActionURL(InstanceID, ActionID: Integer; NewURL: PWideChar): Integer; Stdcall;
Function DLSetActionURLA(InstanceID, ActionID: Integer; NewURL: PAnsiChar): Integer; Stdcall;
Function DLSetAnnotBorderColor(InstanceID, Index: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetAnnotBorderStyle(InstanceID, Index: Integer; Width: Double; Style: Integer; DashOn, DashOff: Double): Integer; Stdcall;
Function DLSetAnnotContents(InstanceID, Index: Integer; NewContents: PWideChar): Integer; Stdcall;
Function DLSetAnnotContentsA(InstanceID, Index: Integer; NewContents: PAnsiChar): Integer; Stdcall;
Function DLSetAnnotDblProperty(InstanceID, Index, Tag: Integer; NewValue: Double): Integer; Stdcall;
Function DLSetAnnotIntProperty(InstanceID, Index, Tag, NewValue: Integer): Integer; Stdcall;
Function DLSetAnnotOptional(InstanceID, Index, OptionalContentGroupID: Integer): Integer; Stdcall;
Function DLSetAnnotQuadPoints(InstanceID, Index, QuadNumber: Integer; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Double): Integer; Stdcall;
Function DLSetAnnotRect(InstanceID, Index: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLSetAnnotStrProperty(InstanceID, Index, Tag: Integer; NewValue: PWideChar): Integer; Stdcall;
Function DLSetAnnotStrPropertyA(InstanceID, Index, Tag: Integer; NewValue: PAnsiChar): Integer; Stdcall;
Function DLSetAnsiMode(InstanceID, NewAnsiMode: Integer): Integer; Stdcall;
Function DLSetAppendInputFromString(InstanceID: Integer; Source: PAnsiChar): Integer; Stdcall;
Function DLSetBaseURL(InstanceID: Integer; NewBaseURL: PWideChar): Integer; Stdcall;
Function DLSetBaseURLA(InstanceID: Integer; NewBaseURL: PAnsiChar): Integer; Stdcall;
Function DLSetBlendMode(InstanceID, BlendMode: Integer): Integer; Stdcall;
Function DLSetBreakString(InstanceID: Integer; NewBreakString: PWideChar): Integer; Stdcall;
Function DLSetBreakStringA(InstanceID: Integer; NewBreakString: PAnsiChar): Integer; Stdcall;
Function DLSetCSDictEPSG(InstanceID, CSDictID, NewEPSG: Integer): Integer; Stdcall;
Function DLSetCSDictType(InstanceID, CSDictID, NewDictType: Integer): Integer; Stdcall;
Function DLSetCSDictWKT(InstanceID, CSDictID: Integer; NewWKT: PWideChar): Integer; Stdcall;
Function DLSetCSDictWKTA(InstanceID, CSDictID: Integer; NewWKT: PAnsiChar): Integer; Stdcall;
Function DLSetCairoFileName(InstanceID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLSetCairoFileNameA(InstanceID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLSetCapturedPageOptional(InstanceID, CaptureID, OptionalContentGroupID: Integer): Integer; Stdcall;
Function DLSetCapturedPageTransparencyGroup(InstanceID, CaptureID, CS, Isolate, Knockout: Integer): Integer; Stdcall;
Function DLSetCatalogInformation(InstanceID: Integer; Key, NewValue: PWideChar): Integer; Stdcall;
Function DLSetCatalogInformationA(InstanceID: Integer; Key, NewValue: PAnsiChar): Integer; Stdcall;
Function DLSetCharWidth(InstanceID, CharCode, NewWidth: Integer): Integer; Stdcall;
Function DLSetClippingPath(InstanceID: Integer): Integer; Stdcall;
Function DLSetClippingPathEvenOdd(InstanceID: Integer): Integer; Stdcall;
Function DLSetCompatibility(InstanceID, CompatibilityItem, CompatibilityMode: Integer): Integer; Stdcall;
Function DLSetContentStreamFromString(InstanceID: Integer; Source: PAnsiChar): Integer; Stdcall;
Function DLSetContentStreamOptional(InstanceID, OptionalContentGroupID: Integer): Integer; Stdcall;
Function DLSetCropBox(InstanceID: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLSetCustomInformation(InstanceID: Integer; Key, NewValue: PWideChar): Integer; Stdcall;
Function DLSetCustomInformationA(InstanceID: Integer; Key, NewValue: PAnsiChar): Integer; Stdcall;
Function DLSetCustomLineDash(InstanceID: Integer; DashPattern: PWideChar; DashPhase: Double): Integer; Stdcall;
Function DLSetCustomLineDashA(InstanceID: Integer; DashPattern: PAnsiChar; DashPhase: Double): Integer; Stdcall;
Function DLSetPDFiumFileName(InstanceID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLSetPDFiumFileNameA(InstanceID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLSetDecodeMode(InstanceID, NewDecodeMode: Integer): Integer; Stdcall;
Function DLSetDestProperties(InstanceID, DestID, Zoom, DestType: Integer; Left, Top, Right, Bottom: Double): Integer; Stdcall;
Function DLSetDestValue(InstanceID, DestID, ValueKey: Integer; NewValue: Double): Integer; Stdcall;
Function DLSetDocumentMetadata(InstanceID: Integer; XMP: PWideChar): Integer; Stdcall;
Function DLSetDocumentMetadataA(InstanceID: Integer; XMP: PAnsiChar): Integer; Stdcall;
Function DLSetEmbeddedFileStrProperty(InstanceID, Index, Tag: Integer; NewValue: PWideChar): Integer; Stdcall;
Function DLSetEmbeddedFileStrPropertyA(InstanceID, Index, Tag: Integer; NewValue: PAnsiChar): Integer; Stdcall;
Function DLSetFillColor(InstanceID: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetFillColorCMYK(InstanceID: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetFillColorSep(InstanceID: Integer; ColorName: PWideChar; Tint: Double): Integer; Stdcall;
Function DLSetFillColorSepA(InstanceID: Integer; ColorName: PAnsiChar; Tint: Double): Integer; Stdcall;
Function DLSetFillShader(InstanceID: Integer; ShaderName: PWideChar): Integer; Stdcall;
Function DLSetFillShaderA(InstanceID: Integer; ShaderName: PAnsiChar): Integer; Stdcall;
Function DLSetFillTilingPattern(InstanceID: Integer; PatternName: PWideChar): Integer; Stdcall;
Function DLSetFillTilingPatternA(InstanceID: Integer; PatternName: PAnsiChar): Integer; Stdcall;
Function DLSetFindImagesMode(InstanceID, NewFindImagesMode: Integer): Integer; Stdcall;
Function DLSetFontEncoding(InstanceID, Encoding: Integer): Integer; Stdcall;
Function DLSetFontFlags(InstanceID, Fixed, Serif, Symbolic, Script, Italic, AllCap, SmallCap, ForceBold: Integer): Integer; Stdcall;
Function DLSetFormFieldAlignment(InstanceID, Index, Alignment: Integer): Integer; Stdcall;
Function DLSetFormFieldAnnotFlags(InstanceID, Index, NewFlags: Integer): Integer; Stdcall;
Function DLSetFormFieldBackgroundColor(InstanceID, Index: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetFormFieldBackgroundColorCMYK(InstanceID, Index: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetFormFieldBackgroundColorGray(InstanceID, Index: Integer; Gray: Double): Integer; Stdcall;
Function DLSetFormFieldBackgroundColorSep(InstanceID, Index: Integer; ColorName: PWideChar; Tint: Double): Integer; Stdcall;
Function DLSetFormFieldBackgroundColorSepA(InstanceID, Index: Integer; ColorName: PAnsiChar; Tint: Double): Integer; Stdcall;
Function DLSetFormFieldBorderColor(InstanceID, Index: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetFormFieldBorderColorCMYK(InstanceID, Index: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetFormFieldBorderColorGray(InstanceID, Index: Integer; Gray: Double): Integer; Stdcall;
Function DLSetFormFieldBorderColorSep(InstanceID, Index: Integer; ColorName: PWideChar; Tint: Double): Integer; Stdcall;
Function DLSetFormFieldBorderColorSepA(InstanceID, Index: Integer; ColorName: PAnsiChar; Tint: Double): Integer; Stdcall;
Function DLSetFormFieldBorderStyle(InstanceID, Index: Integer; Width: Double; Style: Integer; DashOn, DashOff: Double): Integer; Stdcall;
Function DLSetFormFieldBounds(InstanceID, Index: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLSetFormFieldCalcOrder(InstanceID, Index, Order: Integer): Integer; Stdcall;
Function DLSetFormFieldCaption(InstanceID, Index: Integer; NewCaption: PWideChar): Integer; Stdcall;
Function DLSetFormFieldCaptionA(InstanceID, Index: Integer; NewCaption: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldCheckStyle(InstanceID, Index, CheckStyle, Position: Integer): Integer; Stdcall;
Function DLSetFormFieldChildTitle(InstanceID, Index: Integer; NewTitle: PWideChar): Integer; Stdcall;
Function DLSetFormFieldChildTitleA(InstanceID, Index: Integer; NewTitle: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldChoiceSub(InstanceID, Index, SubIndex: Integer; SubName, DisplayName: PWideChar): Integer; Stdcall;
Function DLSetFormFieldChoiceSubA(InstanceID, Index, SubIndex: Integer; SubName, DisplayName: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldChoiceType(InstanceID, Index, ChoiceType: Integer): Integer; Stdcall;
Function DLSetFormFieldColor(InstanceID, Index: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetFormFieldColorCMYK(InstanceID, Index: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetFormFieldColorSep(InstanceID, Index: Integer; ColorName: PWideChar; Tint: Double): Integer; Stdcall;
Function DLSetFormFieldColorSepA(InstanceID, Index: Integer; ColorName: PAnsiChar; Tint: Double): Integer; Stdcall;
Function DLSetFormFieldComb(InstanceID, Index, Comb: Integer): Integer; Stdcall;
Function DLSetFormFieldDefaultValue(InstanceID, Index: Integer; NewDefaultValue: PWideChar): Integer; Stdcall;
Function DLSetFormFieldDefaultValueA(InstanceID, Index: Integer; NewDefaultValue: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldDescription(InstanceID, Index: Integer; NewDescription: PWideChar): Integer; Stdcall;
Function DLSetFormFieldDescriptionA(InstanceID, Index: Integer; NewDescription: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldFlags(InstanceID, Index, NewFlags: Integer): Integer; Stdcall;
Function DLSetFormFieldFont(InstanceID, Index, FontIndex: Integer): Integer; Stdcall;
Function DLSetFormFieldHighlightMode(InstanceID, Index, NewMode: Integer): Integer; Stdcall;
Function DLSetFormFieldIcon(InstanceID, Index, IconType, CaptureID: Integer): Integer; Stdcall;
Function DLSetFormFieldIconStyle(InstanceID, Index, Placement, Scale, ScaleType, HorizontalShift, VerticalShift: Integer): Integer; Stdcall;
Function DLSetFormFieldMaxLen(InstanceID, Index, NewMaxLen: Integer): Integer; Stdcall;
Function DLSetFormFieldNoExport(InstanceID, Index, NoExport: Integer): Integer; Stdcall;
Function DLSetFormFieldOptional(InstanceID, Index, OptionalContentGroupID: Integer): Integer; Stdcall;
Function DLSetFormFieldPage(InstanceID, Index, NewPage: Integer): Integer; Stdcall;
Function DLSetFormFieldPrintable(InstanceID, Index, Printable: Integer): Integer; Stdcall;
Function DLSetFormFieldReadOnly(InstanceID, Index, ReadOnly: Integer): Integer; Stdcall;
Function DLSetFormFieldRequired(InstanceID, Index, Required: Integer): Integer; Stdcall;
Function DLSetFormFieldResetAction(InstanceID, Index: Integer; ActionType: PWideChar): Integer; Stdcall;
Function DLSetFormFieldResetActionA(InstanceID, Index: Integer; ActionType: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldRichTextString(InstanceID, Index: Integer; Key, NewValue: PWideChar): Integer; Stdcall;
Function DLSetFormFieldRichTextStringA(InstanceID, Index: Integer; Key, NewValue: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldRotation(InstanceID, Index, Angle: Integer): Integer; Stdcall;
Function DLSetFormFieldSignatureImage(InstanceID, Index, ImageID, Options: Integer): Integer; Stdcall;
Function DLSetFormFieldStandardFont(InstanceID, Index, StandardFontID: Integer): Integer; Stdcall;
Function DLSetFormFieldSubmitAction(InstanceID, Index: Integer; ActionType, Link: PWideChar): Integer; Stdcall;
Function DLSetFormFieldSubmitActionA(InstanceID, Index: Integer; ActionType, Link: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldSubmitActionEx(InstanceID, Index: Integer; ActionType, Link: PWideChar; Flags: Integer): Integer; Stdcall;
Function DLSetFormFieldSubmitActionExA(InstanceID, Index: Integer; ActionType, Link: PAnsiChar; Flags: Integer): Integer; Stdcall;
Function DLSetFormFieldTabOrder(InstanceID, Index, Order: Integer): Integer; Stdcall;
Function DLSetFormFieldTextFlags(InstanceID, Index, Multiline, Password, FileSelect, DoNotSpellCheck, DoNotScroll: Integer): Integer; Stdcall;
Function DLSetFormFieldTextSize(InstanceID, Index: Integer; NewTextSize: Double): Integer; Stdcall;
Function DLSetFormFieldTitle(InstanceID, Index: Integer; NewTitle: PWideChar): Integer; Stdcall;
Function DLSetFormFieldTitleA(InstanceID, Index: Integer; NewTitle: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldValue(InstanceID, Index: Integer; NewValue: PWideChar): Integer; Stdcall;
Function DLSetFormFieldValueA(InstanceID, Index: Integer; NewValue: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldValueByTitle(InstanceID: Integer; Title, NewValue: PWideChar): Integer; Stdcall;
Function DLSetFormFieldValueByTitleA(InstanceID: Integer; Title, NewValue: PAnsiChar): Integer; Stdcall;
Function DLSetFormFieldVisible(InstanceID, Index, Visible: Integer): Integer; Stdcall;
Function DLSetGDIPlusFileName(InstanceID: Integer; DLLFileName: PWideChar): Integer; Stdcall;
Function DLSetGDIPlusFileNameA(InstanceID: Integer; DLLFileName: PAnsiChar): Integer; Stdcall;
Function DLSetGDIPlusOptions(InstanceID, OptionID, NewValue: Integer): Integer; Stdcall;
Function DLSetHTMLBoldFont(InstanceID: Integer; FontSet: PWideChar; FontID: Integer): Integer; Stdcall;
Function DLSetHTMLBoldFontA(InstanceID: Integer; FontSet: PAnsiChar; FontID: Integer): Integer; Stdcall;
Function DLSetHTMLBoldItalicFont(InstanceID: Integer; FontSet: PWideChar; FontID: Integer): Integer; Stdcall;
Function DLSetHTMLBoldItalicFontA(InstanceID: Integer; FontSet: PAnsiChar; FontID: Integer): Integer; Stdcall;
Function DLSetHTMLItalicFont(InstanceID: Integer; FontSet: PWideChar; FontID: Integer): Integer; Stdcall;
Function DLSetHTMLItalicFontA(InstanceID: Integer; FontSet: PAnsiChar; FontID: Integer): Integer; Stdcall;
Function DLSetHTMLNormalFont(InstanceID: Integer; FontSet: PWideChar; FontID: Integer): Integer; Stdcall;
Function DLSetHTMLNormalFontA(InstanceID: Integer; FontSet: PAnsiChar; FontID: Integer): Integer; Stdcall;
Function DLSetHeaderCommentsFromString(InstanceID: Integer; Source: PAnsiChar): Integer; Stdcall;
Function DLSetImageAsMask(InstanceID, MaskType: Integer): Integer; Stdcall;
Function DLSetImageMask(InstanceID: Integer; FromRed, FromGreen, FromBlue, ToRed, ToGreen, ToBlue: Double): Integer; Stdcall;
Function DLSetImageMaskCMYK(InstanceID: Integer; FromC, FromM, FromY, FromK, ToC, ToM, ToY, ToK: Double): Integer; Stdcall;
Function DLSetImageMaskFromImage(InstanceID, ImageID: Integer): Integer; Stdcall;
Function DLSetImageOptional(InstanceID, OptionalContentGroupID: Integer): Integer; Stdcall;
Function DLSetImageResolution(InstanceID, Horizontal, Vertical, Units: Integer): Integer; Stdcall;
Function DLSetInformation(InstanceID, Key: Integer; NewValue: PWideChar): Integer; Stdcall;
Function DLSetInformationA(InstanceID, Key: Integer; NewValue: PAnsiChar): Integer; Stdcall;
Function DLSetJPEGQuality(InstanceID, Quality: Integer): Integer; Stdcall;
Function DLSetJavaScriptMode(InstanceID, JSMode: Integer): Integer; Stdcall;
Function DLSetKerning(InstanceID: Integer; CharPair: PWideChar; Adjustment: Integer): Integer; Stdcall;
Function DLSetKerningA(InstanceID: Integer; CharPair: PAnsiChar; Adjustment: Integer): Integer; Stdcall;
Function DLSetLineCap(InstanceID, LineCap: Integer): Integer; Stdcall;
Function DLSetLineColor(InstanceID: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetLineColorCMYK(InstanceID: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetLineColorSep(InstanceID: Integer; ColorName: PWideChar; Tint: Double): Integer; Stdcall;
Function DLSetLineColorSepA(InstanceID: Integer; ColorName: PAnsiChar; Tint: Double): Integer; Stdcall;
Function DLSetLineDash(InstanceID: Integer; DashOn, DashOff: Double): Integer; Stdcall;
Function DLSetLineDashEx(InstanceID: Integer; DashValues: PWideChar): Integer; Stdcall;
Function DLSetLineDashExA(InstanceID: Integer; DashValues: PAnsiChar): Integer; Stdcall;
Function DLSetLineJoin(InstanceID, LineJoin: Integer): Integer; Stdcall;
Function DLSetLineShader(InstanceID: Integer; ShaderName: PWideChar): Integer; Stdcall;
Function DLSetLineShaderA(InstanceID: Integer; ShaderName: PAnsiChar): Integer; Stdcall;
Function DLSetLineWidth(InstanceID: Integer; LineWidth: Double): Integer; Stdcall;
Function DLSetMarkupAnnotStyle(InstanceID, Index: Integer; Red, Green, Blue, Transparency: Double): Integer; Stdcall;
Function DLSetMeasureDictBoundsCount(InstanceID, MeasureDictID, NewCount: Integer): Integer; Stdcall;
Function DLSetMeasureDictBoundsItem(InstanceID, MeasureDictID, ItemIndex: Integer; NewValue: Double): Integer; Stdcall;
Function DLSetMeasureDictCoordinateSystem(InstanceID, MeasureDictID, CoordinateSystemID: Integer): Integer; Stdcall;
Function DLSetMeasureDictGPTSCount(InstanceID, MeasureDictID, NewCount: Integer): Integer; Stdcall;
Function DLSetMeasureDictGPTSItem(InstanceID, MeasureDictID, ItemIndex: Integer; NewValue: Double): Integer; Stdcall;
Function DLSetMeasureDictLPTSCount(InstanceID, MeasureDictID, NewCount: Integer): Integer; Stdcall;
Function DLSetMeasureDictLPTSItem(InstanceID, MeasureDictID, ItemIndex: Integer; NewValue: Double): Integer; Stdcall;
Function DLSetMeasureDictPDU(InstanceID, MeasureDictID, LinearUnit, AreaUnit, AngularUnit: Integer): Integer; Stdcall;
Function DLSetMeasurementUnits(InstanceID, MeasurementUnits: Integer): Integer; Stdcall;
Function DLSetNeedAppearances(InstanceID, NewValue: Integer): Integer; Stdcall;
Function DLSetObjectFromString(InstanceID, ObjectNumber: Integer; Source: PAnsiChar): Integer; Stdcall;
Function DLSetOpenActionDestination(InstanceID, OpenPage, Zoom: Integer): Integer; Stdcall;
Function DLSetOpenActionDestinationFull(InstanceID, OpenPage, Zoom, DestType: Integer; Left, Top, Right, Bottom: Double): Integer; Stdcall;
Function DLSetOpenActionJavaScript(InstanceID: Integer; JavaScript: PWideChar): Integer; Stdcall;
Function DLSetOpenActionJavaScriptA(InstanceID: Integer; JavaScript: PAnsiChar): Integer; Stdcall;
Function DLSetOpenActionMenu(InstanceID: Integer; MenuItem: PWideChar): Integer; Stdcall;
Function DLSetOpenActionMenuA(InstanceID: Integer; MenuItem: PAnsiChar): Integer; Stdcall;
Function DLSetOptionalContentConfigLocked(InstanceID, OptionalContentConfigID, OptionalContentGroupID, NewLocked: Integer): Integer; Stdcall;
Function DLSetOptionalContentConfigState(InstanceID, OptionalContentConfigID, OptionalContentGroupID, NewState: Integer): Integer; Stdcall;
Function DLSetOptionalContentGroupName(InstanceID, OptionalContentGroupID: Integer; NewGroupName: PWideChar): Integer; Stdcall;
Function DLSetOptionalContentGroupNameA(InstanceID, OptionalContentGroupID: Integer; NewGroupName: PAnsiChar): Integer; Stdcall;
Function DLSetOptionalContentGroupPrintable(InstanceID, OptionalContentGroupID, Printable: Integer): Integer; Stdcall;
Function DLSetOptionalContentGroupVisible(InstanceID, OptionalContentGroupID, Visible: Integer): Integer; Stdcall;
Function DLSetOrigin(InstanceID, Origin: Integer): Integer; Stdcall;
Function DLSetOutlineColor(InstanceID, OutlineID: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetOutlineDestination(InstanceID, OutlineID, DestPage: Integer; DestPosition: Double): Integer; Stdcall;
Function DLSetOutlineDestinationFull(InstanceID, OutlineID, DestPage, Zoom, DestType: Integer; Left, Top, Right, Bottom: Double): Integer; Stdcall;
Function DLSetOutlineDestinationZoom(InstanceID, OutlineID, DestPage: Integer; DestPosition: Double; Zoom: Integer): Integer; Stdcall;
Function DLSetOutlineJavaScript(InstanceID, OutlineID: Integer; JavaScript: PWideChar): Integer; Stdcall;
Function DLSetOutlineJavaScriptA(InstanceID, OutlineID: Integer; JavaScript: PAnsiChar): Integer; Stdcall;
Function DLSetOutlineNamedDestination(InstanceID, OutlineID: Integer; DestName: PWideChar): Integer; Stdcall;
Function DLSetOutlineNamedDestinationA(InstanceID, OutlineID: Integer; DestName: PAnsiChar): Integer; Stdcall;
Function DLSetOutlineOpenFile(InstanceID, OutlineID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLSetOutlineOpenFileA(InstanceID, OutlineID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLSetOutlineRemoteDestination(InstanceID, OutlineID: Integer; FileName: PWideChar; OpenPage, Zoom, DestType: Integer;
  PntLeft, PntTop, PntRight, PntBottom: Double; NewWindow: Integer): Integer; Stdcall;
Function DLSetOutlineRemoteDestinationA(InstanceID, OutlineID: Integer; FileName: PAnsiChar; OpenPage, Zoom, DestType: Integer;
  PntLeft, PntTop, PntRight, PntBottom: Double; NewWindow: Integer): Integer; Stdcall;
Function DLSetOutlineStyle(InstanceID, OutlineID, SetItalic, SetBold: Integer): Integer; Stdcall;
Function DLSetOutlineTitle(InstanceID, OutlineID: Integer; NewTitle: PWideChar): Integer; Stdcall;
Function DLSetOutlineTitleA(InstanceID, OutlineID: Integer; NewTitle: PAnsiChar): Integer; Stdcall;
Function DLSetOutlineWebLink(InstanceID, OutlineID: Integer; Link: PWideChar): Integer; Stdcall;
Function DLSetOutlineWebLinkA(InstanceID, OutlineID: Integer; Link: PAnsiChar): Integer; Stdcall;
Function DLSetOverprint(InstanceID, StrokingOverprint, OtherOverprint, OverprintMode: Integer): Integer; Stdcall;
Function DLSetPDFAMode(InstanceID, NewMode: Integer): Integer; Stdcall;
Function DLSetPNGTransparencyColor(InstanceID, RedByte, GreenByte, BlueByte: Integer): Integer; Stdcall;
Function DLSetPageActionMenu(InstanceID: Integer; MenuItem: PWideChar): Integer; Stdcall;
Function DLSetPageActionMenuA(InstanceID: Integer; MenuItem: PAnsiChar): Integer; Stdcall;
Function DLSetPageBox(InstanceID, BoxType: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLSetPageContentFromString(InstanceID: Integer; Source: PAnsiChar): Integer; Stdcall;
Function DLSetPageDimensions(InstanceID: Integer; NewPageWidth, NewPageHeight: Double): Integer; Stdcall;
Function DLSetPageLayout(InstanceID, NewPageLayout: Integer): Integer; Stdcall;
Function DLSetPageMode(InstanceID, NewPageMode: Integer): Integer; Stdcall;
Function DLSetPageSize(InstanceID: Integer; PaperName: PWideChar): Integer; Stdcall;
Function DLSetPageSizeA(InstanceID: Integer; PaperName: PAnsiChar): Integer; Stdcall;
Function DLSetPageThumbnail(InstanceID: Integer): Integer; Stdcall;
Function DLSetPageTransparencyGroup(InstanceID, CS, Isolate, Knockout: Integer): Integer; Stdcall;
Function DLSetPageUserUnit(InstanceID: Integer; UserUnit: Double): Integer; Stdcall;
Function DLSetPrecision(InstanceID, NewPrecision: Integer): Integer; Stdcall;
Function DLSetPrinterDevModeFromString(InstanceID: Integer; Source: PAnsiChar): Integer; Stdcall;
Function DLSetRenderCropType(InstanceID, NewCropType: Integer): Integer; Stdcall;
Function DLSetRenderDCErasePage(InstanceID, NewErasePage: Integer): Integer; Stdcall;
Function DLSetRenderDCOffset(InstanceID, NewOffsetX, NewOffsetY: Integer): Integer; Stdcall;
Function DLSetRenderOptions(InstanceID, OptionID, NewValue: Integer): Integer; Stdcall;
Function DLSetRenderScale(InstanceID: Integer; NewScale: Double): Integer; Stdcall;
Function DLSetScale(InstanceID: Integer; NewScale: Double): Integer; Stdcall;
Function DLSetSignProcessCustomSubFilter(InstanceID, SignProcessID: Integer; SubFilterStr: PWideChar): Integer; Stdcall;
Function DLSetSignProcessCustomSubFilterA(InstanceID, SignProcessID: Integer; SubFilterStr: PAnsiChar): Integer; Stdcall;
Function DLSetSignProcessField(InstanceID, SignProcessID: Integer; SignatureFieldName: PWideChar): Integer; Stdcall;
Function DLSetSignProcessFieldA(InstanceID, SignProcessID: Integer; SignatureFieldName: PAnsiChar): Integer; Stdcall;
Function DLSetSignProcessFieldBounds(InstanceID, SignProcessID: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLSetSignProcessFieldImageFromFile(InstanceID, SignProcessID: Integer; ImageFileName: PWideChar; Options: Integer): Integer; Stdcall;
Function DLSetSignProcessFieldImageFromFileA(InstanceID, SignProcessID: Integer; ImageFileName: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLSetSignProcessFieldPage(InstanceID, SignProcessID, SignaturePage: Integer): Integer; Stdcall;
Function DLSetSignProcessInfo(InstanceID, SignProcessID: Integer; Reason, Location, ContactInfo: PWideChar): Integer; Stdcall;
Function DLSetSignProcessInfoA(InstanceID, SignProcessID: Integer; Reason, Location, ContactInfo: PAnsiChar): Integer; Stdcall;
Function DLSetSignProcessKeyset(InstanceID, SignProcessID, KeysetID: Integer): Integer; Stdcall;
Function DLSetSignProcessPFXFromFile(InstanceID, SignProcessID: Integer; PFXFileName, PFXPassword: PWideChar): Integer; Stdcall;
Function DLSetSignProcessPFXFromFileA(InstanceID, SignProcessID: Integer; PFXFileName, PFXPassword: PAnsiChar): Integer; Stdcall;
Function DLSetSignProcessPassthrough(InstanceID, SignProcessID, SignatureLength: Integer): Integer; Stdcall;
Function DLSetSignProcessSubFilter(InstanceID, SignProcessID, SubFilter: Integer): Integer; Stdcall;
Function DLSetTabOrderMode(InstanceID: Integer; Mode: PWideChar): Integer; Stdcall;
Function DLSetTabOrderModeA(InstanceID: Integer; Mode: PAnsiChar): Integer; Stdcall;
Function DLSetTableBorderColor(InstanceID, TableID, BorderIndex: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetTableBorderColorCMYK(InstanceID, TableID, BorderIndex: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetTableBorderWidth(InstanceID, TableID, BorderIndex: Integer; NewWidth: Double): Integer; Stdcall;
Function DLSetTableCellAlignment(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn, NewCellAlignment: Integer): Integer; Stdcall;
Function DLSetTableCellBackgroundColor(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetTableCellBackgroundColorCMYK(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetTableCellBorderColor(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex: Integer; Red, Green, Blue: Double)
  : Integer; Stdcall;
Function DLSetTableCellBorderColorCMYK(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex: Integer; C, M, Y, K: Double)
  : Integer; Stdcall;
Function DLSetTableCellBorderWidth(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex: Integer; NewWidth: Double): Integer; Stdcall;
Function DLSetTableCellContent(InstanceID, TableID, RowNumber, ColumnNumber: Integer; HTMLText: PWideChar): Integer; Stdcall;
Function DLSetTableCellContentA(InstanceID, TableID, RowNumber, ColumnNumber: Integer; HTMLText: PAnsiChar): Integer; Stdcall;
Function DLSetTableCellPadding(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex: Integer; NewPadding: Double): Integer; Stdcall;
Function DLSetTableCellTextColor(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetTableCellTextColorCMYK(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetTableCellTextSize(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer; NewTextSize: Double): Integer; Stdcall;
Function DLSetTableColumnWidth(InstanceID, TableID, FirstColumn, LastColumn: Integer; NewWidth: Double): Integer; Stdcall;
Function DLSetTableRowHeight(InstanceID, TableID, FirstRow, LastRow: Integer; NewHeight: Double): Integer; Stdcall;
Function DLSetTableThinBorders(InstanceID, TableID, ThinBorders: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetTableThinBordersCMYK(InstanceID, TableID, ThinBorders: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetTempFile(InstanceID: Integer; FileName: PWideChar): Integer; Stdcall;
Function DLSetTempFileA(InstanceID: Integer; FileName: PAnsiChar): Integer; Stdcall;
Function DLSetTempPath(InstanceID: Integer; NewPath: PWideChar): Integer; Stdcall;
Function DLSetTempPathA(InstanceID: Integer; NewPath: PAnsiChar): Integer; Stdcall;
Function DLSetTextAlign(InstanceID, TextAlign: Integer): Integer; Stdcall;
Function DLSetTextCharSpacing(InstanceID: Integer; CharSpacing: Double): Integer; Stdcall;
Function DLSetTextColor(InstanceID: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetTextColorCMYK(InstanceID: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetTextColorSep(InstanceID: Integer; ColorName: PWideChar; Tint: Double): Integer; Stdcall;
Function DLSetTextColorSepA(InstanceID: Integer; ColorName: PAnsiChar; Tint: Double): Integer; Stdcall;
Function DLSetTextExtractionArea(InstanceID: Integer; Left, Top, Width, Height: Double): Integer; Stdcall;
Function DLSetTextExtractionOptions(InstanceID, OptionID, NewValue: Integer): Integer; Stdcall;
Function DLSetTextExtractionScaling(InstanceID, Options: Integer; Horizontal, Vertical: Double): Integer; Stdcall;
Function DLSetTextExtractionWordGap(InstanceID: Integer; NewWordGap: Double): Integer; Stdcall;
Function DLSetTextHighlight(InstanceID, Highlight: Integer): Integer; Stdcall;
Function DLSetTextHighlightColor(InstanceID: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetTextHighlightColorCMYK(InstanceID: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetTextHighlightColorSep(InstanceID: Integer; ColorName: PWideChar; Tint: Double): Integer; Stdcall;
Function DLSetTextHighlightColorSepA(InstanceID: Integer; ColorName: PAnsiChar; Tint: Double): Integer; Stdcall;
Function DLSetTextMode(InstanceID, TextMode: Integer): Integer; Stdcall;
Function DLSetTextRise(InstanceID: Integer; Rise: Double): Integer; Stdcall;
Function DLSetTextScaling(InstanceID: Integer; ScalePercentage: Double): Integer; Stdcall;
Function DLSetTextShader(InstanceID: Integer; ShaderName: PWideChar): Integer; Stdcall;
Function DLSetTextShaderA(InstanceID: Integer; ShaderName: PAnsiChar): Integer; Stdcall;
Function DLSetTextSize(InstanceID: Integer; TextSize: Double): Integer; Stdcall;
Function DLSetTextSpacing(InstanceID: Integer; Spacing: Double): Integer; Stdcall;
Function DLSetTextUnderline(InstanceID, Underline: Integer): Integer; Stdcall;
Function DLSetTextUnderlineColor(InstanceID: Integer; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetTextUnderlineColorCMYK(InstanceID: Integer; C, M, Y, K: Double): Integer; Stdcall;
Function DLSetTextUnderlineColorSep(InstanceID: Integer; ColorName: PWideChar; Tint: Double): Integer; Stdcall;
Function DLSetTextUnderlineColorSepA(InstanceID: Integer; ColorName: PAnsiChar; Tint: Double): Integer; Stdcall;
Function DLSetTextUnderlineCustomDash(InstanceID: Integer; DashPattern: PWideChar; DashPhase: Double): Integer; Stdcall;
Function DLSetTextUnderlineCustomDashA(InstanceID: Integer; DashPattern: PAnsiChar; DashPhase: Double): Integer; Stdcall;
Function DLSetTextUnderlineDash(InstanceID: Integer; DashOn, DashOff: Double): Integer; Stdcall;
Function DLSetTextUnderlineDistance(InstanceID: Integer; UnderlineDistance: Double): Integer; Stdcall;
Function DLSetTextUnderlineWidth(InstanceID: Integer; UnderlineWidth: Double): Integer; Stdcall;
Function DLSetTextWordSpacing(InstanceID: Integer; WordSpacing: Double): Integer; Stdcall;
Function DLSetTransparency(InstanceID, Transparency: Integer): Integer; Stdcall;
Function DLSetViewerPreferences(InstanceID, Option, NewValue: Integer): Integer; Stdcall;
Function DLSetXFAFormFieldAccess(InstanceID: Integer; XFAFieldName: PWideChar; NewAccess: Integer): Integer; Stdcall;
Function DLSetXFAFormFieldAccessA(InstanceID: Integer; XFAFieldName: PAnsiChar; NewAccess: Integer): Integer; Stdcall;
Function DLSetXFAFormFieldBorderColor(InstanceID: Integer; XFAFieldName: PWideChar; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetXFAFormFieldBorderColorA(InstanceID: Integer; XFAFieldName: PAnsiChar; Red, Green, Blue: Double): Integer; Stdcall;
Function DLSetXFAFormFieldBorderPresence(InstanceID: Integer; XFAFieldName: PWideChar; NewPresence: Integer): Integer; Stdcall;
Function DLSetXFAFormFieldBorderPresenceA(InstanceID: Integer; XFAFieldName: PAnsiChar; NewPresence: Integer): Integer; Stdcall;
Function DLSetXFAFormFieldBorderWidth(InstanceID: Integer; XFAFieldName: PWideChar; BorderWidth: Double): Integer; Stdcall;
Function DLSetXFAFormFieldBorderWidthA(InstanceID: Integer; XFAFieldName: PAnsiChar; BorderWidth: Double): Integer; Stdcall;
Function DLSetXFAFormFieldValue(InstanceID: Integer; XFAFieldName, NewValue: PWideChar): Integer; Stdcall;
Function DLSetXFAFormFieldValueA(InstanceID: Integer; XFAFieldName, NewValue: PAnsiChar): Integer; Stdcall;
Function DLSetXFAFromString(InstanceID: Integer; Source: PAnsiChar; Options: Integer): Integer; Stdcall;
Function DLSetupPrinter(InstanceID: Integer; CustomPrinterName: PWideChar; Setting, NewValue: Integer): Integer; Stdcall;
Function DLSetupPrinterA(InstanceID: Integer; CustomPrinterName: PAnsiChar; Setting, NewValue: Integer): Integer; Stdcall;
Function DLSignFile(InstanceID: Integer; InputFileName, OpenPassword, SignatureFieldName, OutputFileName, PFXFileName, PFXPassword, Reason, Location,
  ContactInfo: PWideChar): Integer; Stdcall;
Function DLSignFileA(InstanceID: Integer; InputFileName, OpenPassword, SignatureFieldName, OutputFileName, PFXFileName, PFXPassword, Reason, Location,
  ContactInfo: PAnsiChar): Integer; Stdcall;
Function DLSplitPageText(InstanceID, Options: Integer): Integer; Stdcall;
Function DLStartPath(InstanceID: Integer; StartX, StartY: Double): Integer; Stdcall;
Function DLStoreCustomDataFromFile(InstanceID: Integer; Key, FileName: PWideChar; Location, Options: Integer): Integer; Stdcall;
Function DLStoreCustomDataFromFileA(InstanceID: Integer; Key, FileName: PAnsiChar; Location, Options: Integer): Integer; Stdcall;
Function DLStoreCustomDataFromString(InstanceID: Integer; Key, NewValue: PAnsiChar; Location, Options: Integer): Integer; Stdcall;
Function DLStringResultLength(InstanceID: Integer): Integer; Stdcall;
Function DLTestTempPath(InstanceID: Integer): Integer; Stdcall;
Function DLTransformFile(InstanceID: Integer; InputFileName, Password, OutputFileName: PWideChar; TransformType, Options: Integer): Integer; Stdcall;
Function DLTransformFileA(InstanceID: Integer; InputFileName, Password, OutputFileName: PAnsiChar; TransformType, Options: Integer): Integer; Stdcall;
Function DLUpdateAndFlattenFormField(InstanceID, Index: Integer): Integer; Stdcall;
Function DLUpdateAppearanceStream(InstanceID, Index: Integer): Integer; Stdcall;
Function DLUpdateTrueTypeSubsettedFont(InstanceID: Integer; SubsetChars: PWideChar): Integer; Stdcall;
Function DLUpdateTrueTypeSubsettedFontA(InstanceID: Integer; SubsetChars: PAnsiChar): Integer; Stdcall;
Function DLUseKerning(InstanceID, Kern: Integer): Integer; Stdcall;
Function DLUseUnsafeContentStreams(InstanceID, SafetyLevel: Integer): Integer; Stdcall;
Procedure InitLibrary;
Procedure FinalizeLibrary;

Implementation

Type
  TPDFlibBuffer = Class
  Public
    Store: Array Of AnsiChar;
    StoreLength: Integer;
    StorePosition: Integer;
  End;

  TPDFlibInstance = Class
  Public
    PDFlib: TPDFlib;
    InstanceID: Integer;
    ReturnString: AnsiString;
    WideReturnString: WideString;
    Buffers: Array Of TPDFlibBuffer;
    AnsiMode: Integer;
    ProgressProc: Function(Percent: Integer; UserData: Pointer): Integer; Stdcall;
    ProgressUserData: Pointer;
    Procedure ProgressEvent(Progress: Integer);
    Function FindBuffer(Buffer: PAnsiChar): TPDFlibBuffer;
    Function ReleaseBuffer(Buffer: PAnsiChar): Boolean;
    Function GetString(Str: PAnsiChar): AnsiString;
    Function GetWideString(Str: PWideChar): WideString;
    Function GetWideStringFromAnsi(Str: PAnsiChar): WideString;
    Constructor Create;
    Destructor Destroy; Override;
  End;

Var
  InstanceList: Array Of TPDFlibInstance;
  CriticalSection: TCriticalSection;

Constructor TPDFlibInstance.Create;
Begin
  PDFlib := TPDFlib.Create;
  InstanceID := Integer(PDFlib);
  ReturnString := '';
  WideReturnString := '';
  AnsiMode := 0;
  SetLength(Buffers, 0);
End;

Destructor TPDFlibInstance.Destroy;
Var
  X: Integer;
Begin
  For X := 0 To Length(Buffers) - 1 Do
    Buffers[X].Free;
  PDFlib.Free;
  Inherited;
End;

Function TPDFlibInstance.FindBuffer(Buffer: PAnsiChar): TPDFlibBuffer;
Var
  X: Integer;
Begin
  X := 0;
  Result := Nil;
  While (not Assigned(Result)) and (X < Length(Buffers)) Do
    If @Buffers[X].Store = Buffer Then
      Result := Buffers[X]
    Else
      Inc(X);
End;

Function TPDFlibInstance.GetString(Str: PAnsiChar): AnsiString;
Var
  BufferObj: TPDFlibBuffer;
Begin
  BufferObj := FindBuffer(Str);
  If Assigned(BufferObj) Then
  Begin
    SetLength(Result, BufferObj.StoreLength);
    Move(BufferObj.Store[0], Result[1], BufferObj.StoreLength);
  End
  Else
    Result := Str;
End;

Function TPDFlibInstance.GetWideString(Str: PWideChar): WideString;
Var
  BufferObj: TPDFlibBuffer;
  L: Integer;
Begin
  BufferObj := FindBuffer(PAnsiChar(Str));
  If Assigned(BufferObj) Then
  Begin
    L := BufferObj.StoreLength;
    If L mod 2 = 1 Then
      Dec(L);
    SetLength(Result, L div 2);
    Move(BufferObj.Store[0], Result[1], L);
  End
  Else
    Result := Str;
End;

Function TPDFlibInstance.GetWideStringFromAnsi(Str: PAnsiChar): WideString;
Var
  A: AnsiString;
Begin
  A := GetString(Str);
  If (AnsiMode = 0) Then
  Begin
    Result := WideString(A);
  End
  Else If (AnsiMode = 1) Then
  Begin
    Result := PLUTF8Decode(A);
  End
  Else
  Begin
    Result := '';
  End;
End;

Function TPDFlibInstance.ReleaseBuffer(Buffer: PAnsiChar): Boolean;
Var
  X: Integer;
  I: Integer;
Begin
  Result := False;
  I := -1;
  X := 0;
  While (I < 0) and (X < Length(Buffers)) Do
    If @Buffers[X].Store = Buffer Then
      I := X
    Else
      Inc(X);
  If I >= 0 Then
  Begin
    Buffers[I].Free;
    For X := I To Length(Buffers) - 2 Do
      Buffers[X] := Buffers[X + 1];
    SetLength(Buffers, Length(Buffers) - 1);
    Result := True;
  End;
End;

Function FindInstance(InstanceID: Integer; Var Index: Integer): Boolean;
Var
  X: Integer;
Begin
  Result := False;
  CriticalSection.Enter;
  Try
    If (InstanceID = 0) Then
    Begin
      If (Length(InstanceList) = 0) Then
      Begin
        SetLength(InstanceList, 1);
        InstanceList[0] := TPDFlibInstance.Create;
      End;
      Result := True;
      Index := 0;
    End;
    X := 1;
    While (not Result) and (X < Length(InstanceList)) Do
    Begin
      If Assigned(InstanceList[X]) and (InstanceList[X].InstanceID = InstanceID) Then
      Begin
        Result := True;
        Index := X;
      End
      Else
        Inc(X);
    End;
  Finally
    CriticalSection.Leave;
  End;
End;

Procedure TPDFlibInstance.ProgressEvent(Progress: Integer);
Begin
  If Assigned(ProgressProc) Then
  Begin
    ProgressProc(Progress, ProgressUserData);
  End;
End;

Function DLSetProgressCallback(InstanceID: Integer; ProgressProc, UserData: Pointer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := 1;
    InstanceList[I].PDFlib.OnProgress := InstanceList[I].ProgressEvent;
    InstanceList[I].ProgressProc := ProgressProc;
    InstanceList[I].ProgressUserData := UserData;
  End
  Else
    Result := 0;
End;

Function DLAddArcToPath(InstanceID: Integer; CenterX, CenterY, TotalAngle: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddArcToPath(CenterX, CenterY, TotalAngle);
  End
  Else
    Result := 0;
End;

Function DLAddBoxToPath(InstanceID: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddBoxToPath(Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLAddCJKFont(InstanceID, CJKFontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddCJKFont(CJKFontID);
  End
  Else
    Result := 0;
End;

Function DLAddCurveToPath(InstanceID: Integer; CtAX, CtAY, CtBX, CtBY, EndX, EndY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddCurveToPath(CtAX, CtAY, CtBX, CtBY, EndX, EndY);
  End
  Else
    Result := 0;
End;

Function DLAddEmbeddedFile(InstanceID: Integer; FileName, MIMEType: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddEmbeddedFile(InstanceList[I].GetWideString(FileName), InstanceList[I].GetWideString(MIMEType));
  End
  Else
    Result := 0;
End;

Function DLAddEmbeddedFileA(InstanceID: Integer; FileName, MIMEType: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddEmbeddedFile(InstanceList[I].GetWideStringFromAnsi(FileName), InstanceList[I].GetWideStringFromAnsi(MIMEType));
  End
  Else
    Result := 0;
End;

Function DLAddFileAttachment(InstanceID: Integer; Title: PWideChar; EmbeddedFileID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFileAttachment(InstanceList[I].GetWideString(Title), EmbeddedFileID);
  End
  Else
    Result := 0;
End;

Function DLAddFileAttachmentA(InstanceID: Integer; Title: PAnsiChar; EmbeddedFileID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFileAttachment(InstanceList[I].GetWideStringFromAnsi(Title), EmbeddedFileID);
  End
  Else
    Result := 0;
End;

Function DLAddFormFieldChoiceSub(InstanceID, Index: Integer; SubName, DisplayName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFormFieldChoiceSub(Index, InstanceList[I].GetWideString(SubName), InstanceList[I].GetWideString(DisplayName));
  End
  Else
    Result := 0;
End;

Function DLAddFormFieldChoiceSubA(InstanceID, Index: Integer; SubName, DisplayName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFormFieldChoiceSub(Index, InstanceList[I].GetWideStringFromAnsi(SubName),
      InstanceList[I].GetWideStringFromAnsi(DisplayName));
  End
  Else
    Result := 0;
End;

Function DLAddFormFieldSub(InstanceID, Index: Integer; SubName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFormFieldSub(Index, InstanceList[I].GetWideString(SubName));
  End
  Else
    Result := 0;
End;

Function DLAddFormFieldSubA(InstanceID, Index: Integer; SubName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFormFieldSub(Index, InstanceList[I].GetWideStringFromAnsi(SubName));
  End
  Else
    Result := 0;
End;

Function DLAddFormFont(InstanceID, FontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFormFont(FontID);
  End
  Else
    Result := 0;
End;

Function DLAddFreeTextAnnotation(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PWideChar; Angle, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFreeTextAnnotation(Left, Top, Width, Height, InstanceList[I].GetWideString(Text), Angle, Options);
  End
  Else
    Result := 0;
End;

Function DLAddFreeTextAnnotationA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Angle, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFreeTextAnnotation(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(Text), Angle, Options);
  End
  Else
    Result := 0;
End;

Function DLAddFreeTextAnnotationEx(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PWideChar; Angle, Options, Transparency: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFreeTextAnnotationEx(Left, Top, Width, Height, InstanceList[I].GetWideString(Text), Angle, Options, Transparency);
  End
  Else
    Result := 0;
End;

Function DLAddFreeTextAnnotationExA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Angle, Options, Transparency: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddFreeTextAnnotationEx(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(Text), Angle, Options,
      Transparency);
  End
  Else
    Result := 0;
End;

Function DLAddGlobalJavaScript(InstanceID: Integer; PackageName, JavaScript: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddGlobalJavaScript(InstanceList[I].GetWideString(PackageName), InstanceList[I].GetWideString(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLAddGlobalJavaScriptA(InstanceID: Integer; PackageName, JavaScript: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddGlobalJavaScript(InstanceList[I].GetWideStringFromAnsi(PackageName), InstanceList[I].GetWideStringFromAnsi(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLAddImageFromFile(InstanceID: Integer; FileName: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddImageFromFile(InstanceList[I].GetWideString(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddImageFromFileA(InstanceID: Integer; FileName: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddImageFromFile(InstanceList[I].GetWideStringFromAnsi(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddImageFromFileOffset(InstanceID: Integer; FileName: PWideChar; Offset, DataLength, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddImageFromFileOffset(InstanceList[I].GetWideString(FileName), Offset, DataLength, Options);
  End
  Else
    Result := 0;
End;

Function DLAddImageFromFileOffsetA(InstanceID: Integer; FileName: PAnsiChar; Offset, DataLength, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddImageFromFileOffset(InstanceList[I].GetWideStringFromAnsi(FileName), Offset, DataLength, Options);
  End
  Else
    Result := 0;
End;

Function DLAddImageFromString(InstanceID: Integer; Source: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddImageFromString(InstanceList[I].GetString(Source), Options);
  End
  Else
    Result := 0;
End;

Function DLAddLGIDictToPage(InstanceID: Integer; DictContent: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLGIDictToPage(InstanceList[I].GetWideString(DictContent));
  End
  Else
    Result := 0;
End;

Function DLAddLGIDictToPageA(InstanceID: Integer; DictContent: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLGIDictToPage(InstanceList[I].GetWideStringFromAnsi(DictContent));
  End
  Else
    Result := 0;
End;

Function DLAddLineToPath(InstanceID: Integer; EndX, EndY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLineToPath(EndX, EndY);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToDestination(InstanceID: Integer; Left, Top, Width, Height: Double; DestID, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToDestination(Left, Top, Width, Height, DestID, Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToEmbeddedFile(InstanceID: Integer; Left, Top, Width, Height: Double; EmbeddedFileID: Integer; Title, Contents: PWideChar;
  IconType, Transpareny: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToEmbeddedFile(Left, Top, Width, Height, EmbeddedFileID, InstanceList[I].GetWideString(Title),
      InstanceList[I].GetWideString(Contents), IconType, Transpareny);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToEmbeddedFileA(InstanceID: Integer; Left, Top, Width, Height: Double; EmbeddedFileID: Integer; Title, Contents: PAnsiChar;
  IconType, Transpareny: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToEmbeddedFile(Left, Top, Width, Height, EmbeddedFileID, InstanceList[I].GetWideStringFromAnsi(Title),
      InstanceList[I].GetWideStringFromAnsi(Contents), IconType, Transpareny);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Page: Integer; Position: Double;
  NewWindow, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToFile(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName), Page, Position, NewWindow, Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Page: Integer; Position: Double;
  NewWindow, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToFile(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName), Page, Position,
      NewWindow, Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToFileDest(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, NamedDest: PWideChar; Position: Double;
  NewWindow, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToFileDest(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName),
      InstanceList[I].GetWideString(NamedDest), Position, NewWindow, Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToFileDestA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, NamedDest: PAnsiChar; Position: Double;
  NewWindow, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToFileDest(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName),
      InstanceList[I].GetWideStringFromAnsi(NamedDest), Position, NewWindow, Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToFileEx(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; DestPage, NewWindow, Options, Zoom, DestType: Integer;
  DestLeft, DestTop, DestRight, DestBottom: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToFileEx(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName), DestPage, NewWindow, Options, Zoom,
      DestType, DestLeft, DestTop, DestRight, DestBottom);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToFileExA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; DestPage, NewWindow, Options, Zoom, DestType: Integer;
  DestLeft, DestTop, DestRight, DestBottom: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToFileEx(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName), DestPage, NewWindow, Options,
      Zoom, DestType, DestLeft, DestTop, DestRight, DestBottom);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToJavaScript(InstanceID: Integer; Left, Top, Width, Height: Double; JavaScript: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToJavaScript(Left, Top, Width, Height, InstanceList[I].GetWideString(JavaScript), Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToJavaScriptA(InstanceID: Integer; Left, Top, Width, Height: Double; JavaScript: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToJavaScript(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(JavaScript), Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToLocalFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToLocalFile(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToLocalFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToLocalFile(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToPage(InstanceID: Integer; Left, Top, Width, Height: Double; Page: Integer; Position: Double; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToPage(Left, Top, Width, Height, Page, Position, Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToWeb(InstanceID: Integer; Left, Top, Width, Height: Double; Link: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToWeb(Left, Top, Width, Height, InstanceList[I].GetWideString(Link), Options);
  End
  Else
    Result := 0;
End;

Function DLAddLinkToWebA(InstanceID: Integer; Left, Top, Width, Height: Double; Link: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddLinkToWeb(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(Link), Options);
  End
  Else
    Result := 0;
End;

Function DLAddNoteAnnotation(InstanceID: Integer; Left, Top: Double; AnnotType: Integer; PopupLeft, PopupTop, PopupWidth, PopupHeight: Double;
  Title, Contents: PWideChar; Red, Green, Blue: Double; Open: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddNoteAnnotation(Left, Top, AnnotType, PopupLeft, PopupTop, PopupWidth, PopupHeight, InstanceList[I].GetWideString(Title),
      InstanceList[I].GetWideString(Contents), Red, Green, Blue, Open);
  End
  Else
    Result := 0;
End;

Function DLAddNoteAnnotationA(InstanceID: Integer; Left, Top: Double; AnnotType: Integer; PopupLeft, PopupTop, PopupWidth, PopupHeight: Double;
  Title, Contents: PAnsiChar; Red, Green, Blue: Double; Open: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddNoteAnnotation(Left, Top, AnnotType, PopupLeft, PopupTop, PopupWidth, PopupHeight,
      InstanceList[I].GetWideStringFromAnsi(Title), InstanceList[I].GetWideStringFromAnsi(Contents), Red, Green, Blue, Open);
  End
  Else
    Result := 0;
End;

Function DLAddOpenTypeFontFromFile(InstanceID: Integer; FileName: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddOpenTypeFontFromFile(InstanceList[I].GetWideString(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddOpenTypeFontFromFileA(InstanceID: Integer; FileName: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddOpenTypeFontFromFile(InstanceList[I].GetWideStringFromAnsi(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddPageLabels(InstanceID, Start, Style, Offset: Integer; Prefix: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddPageLabels(Start, Style, Offset, InstanceList[I].GetWideString(Prefix));
  End
  Else
    Result := 0;
End;

Function DLAddPageLabelsA(InstanceID, Start, Style, Offset: Integer; Prefix: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddPageLabels(Start, Style, Offset, InstanceList[I].GetWideStringFromAnsi(Prefix));
  End
  Else
    Result := 0;
End;

Function DLAddPageMatrix(InstanceID: Integer; xscale, yscale, xoffset, yoffset: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddPageMatrix(xscale, yscale, xoffset, yoffset);
  End
  Else
    Result := 0;
End;

Function DLAddRelativeLinkToFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Page: Integer; Position: Double;
  NewWindow, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddRelativeLinkToFile(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName), Page, Position,
      NewWindow, Options);
  End
  Else
    Result := 0;
End;

Function DLAddRelativeLinkToFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Page: Integer; Position: Double;
  NewWindow, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddRelativeLinkToFile(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName), Page, Position,
      NewWindow, Options);
  End
  Else
    Result := 0;
End;

Function DLAddRelativeLinkToFileDest(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, NamedDest: PWideChar; Position: Double;
  NewWindow, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddRelativeLinkToFileDest(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName),
      InstanceList[I].GetWideString(NamedDest), Position, NewWindow, Options);
  End
  Else
    Result := 0;
End;

Function DLAddRelativeLinkToFileDestA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, NamedDest: PAnsiChar; Position: Double;
  NewWindow, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddRelativeLinkToFileDest(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName),
      InstanceList[I].GetWideStringFromAnsi(NamedDest), Position, NewWindow, Options);
  End
  Else
    Result := 0;
End;

Function DLAddRelativeLinkToFileEx(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar;
  DestPage, NewWindow, Options, Zoom, DestType: Integer; DestLeft, DestTop, DestRight, DestBottom: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddRelativeLinkToFileEx(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName), DestPage, NewWindow, Options,
      Zoom, DestType, DestLeft, DestTop, DestRight, DestBottom);
  End
  Else
    Result := 0;
End;

Function DLAddRelativeLinkToFileExA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar;
  DestPage, NewWindow, Options, Zoom, DestType: Integer; DestLeft, DestTop, DestRight, DestBottom: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddRelativeLinkToFileEx(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName), DestPage, NewWindow,
      Options, Zoom, DestType, DestLeft, DestTop, DestRight, DestBottom);
  End
  Else
    Result := 0;
End;

Function DLAddRelativeLinkToLocalFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddRelativeLinkToLocalFile(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddRelativeLinkToLocalFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddRelativeLinkToLocalFile(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddSVGAnnotationFromFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddSVGAnnotationFromFile(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddSVGAnnotationFromFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddSVGAnnotationFromFile(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddSWFAnnotationFromFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, Title: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddSWFAnnotationFromFile(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName),
      InstanceList[I].GetWideString(Title), Options);
  End
  Else
    Result := 0;
End;

Function DLAddSWFAnnotationFromFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, Title: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddSWFAnnotationFromFile(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName),
      InstanceList[I].GetWideStringFromAnsi(Title), Options);
  End
  Else
    Result := 0;
End;

Function DLAddSeparationColor(InstanceID: Integer; ColorName: PWideChar; C, M, Y, K: Double; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddSeparationColor(InstanceList[I].GetWideString(ColorName), C, M, Y, K, Options);
  End
  Else
    Result := 0;
End;

Function DLAddSeparationColorA(InstanceID: Integer; ColorName: PAnsiChar; C, M, Y, K: Double; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddSeparationColor(InstanceList[I].GetWideStringFromAnsi(ColorName), C, M, Y, K, Options);
  End
  Else
    Result := 0;
End;

Function DLAddStampAnnotation(InstanceID: Integer; Left, Top, Width, Height: Double; StampType: Integer; Title, Contents: PWideChar; Red, Green, Blue: Double;
  Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddStampAnnotation(Left, Top, Width, Height, StampType, InstanceList[I].GetWideString(Title),
      InstanceList[I].GetWideString(Contents), Red, Green, Blue, Options);
  End
  Else
    Result := 0;
End;

Function DLAddStampAnnotationA(InstanceID: Integer; Left, Top, Width, Height: Double; StampType: Integer; Title, Contents: PAnsiChar; Red, Green, Blue: Double;
  Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddStampAnnotation(Left, Top, Width, Height, StampType, InstanceList[I].GetWideStringFromAnsi(Title),
      InstanceList[I].GetWideStringFromAnsi(Contents), Red, Green, Blue, Options);
  End
  Else
    Result := 0;
End;

Function DLAddStampAnnotationFromImage(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, Title, Contents: PWideChar; Red, Green, Blue: Double;
  Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddStampAnnotationFromImage(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName),
      InstanceList[I].GetWideString(Title), InstanceList[I].GetWideString(Contents), Red, Green, Blue, Options);
  End
  Else
    Result := 0;
End;

Function DLAddStampAnnotationFromImageA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName, Title, Contents: PAnsiChar; Red, Green, Blue: Double;
  Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddStampAnnotationFromImage(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName),
      InstanceList[I].GetWideStringFromAnsi(Title), InstanceList[I].GetWideStringFromAnsi(Contents), Red, Green, Blue, Options);
  End
  Else
    Result := 0;
End;

Function DLAddStampAnnotationFromImageID(InstanceID: Integer; Left, Top, Width, Height: Double; ImageID: Integer; Title, Contents: PWideChar;
  Red, Green, Blue: Double; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddStampAnnotationFromImageID(Left, Top, Width, Height, ImageID, InstanceList[I].GetWideString(Title),
      InstanceList[I].GetWideString(Contents), Red, Green, Blue, Options);
  End
  Else
    Result := 0;
End;

Function DLAddStampAnnotationFromImageIDA(InstanceID: Integer; Left, Top, Width, Height: Double; ImageID: Integer; Title, Contents: PAnsiChar;
  Red, Green, Blue: Double; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddStampAnnotationFromImageID(Left, Top, Width, Height, ImageID, InstanceList[I].GetWideStringFromAnsi(Title),
      InstanceList[I].GetWideStringFromAnsi(Contents), Red, Green, Blue, Options);
  End
  Else
    Result := 0;
End;

Function DLAddStandardFont(InstanceID, StandardFontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddStandardFont(StandardFontID);
  End
  Else
    Result := 0;
End;

Function DLAddSubsettedFont(InstanceID: Integer; FontName: PWideChar; CharsetIndex: Integer; SubsetChars: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddSubsettedFont(InstanceList[I].GetWideString(FontName), CharsetIndex, InstanceList[I].GetWideString(SubsetChars));
  End
  Else
    Result := 0;
End;

Function DLAddSubsettedFontA(InstanceID: Integer; FontName: PAnsiChar; CharsetIndex: Integer; SubsetChars: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddSubsettedFont(InstanceList[I].GetWideStringFromAnsi(FontName), CharsetIndex,
      InstanceList[I].GetWideStringFromAnsi(SubsetChars));
  End
  Else
    Result := 0;
End;

Function DLAddTextMarkupAnnotation(InstanceID, MarkupType: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddTextMarkupAnnotation(MarkupType, Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLAddToBuffer(InstanceID: Integer; Buffer, Source: PAnsiChar; SourceLength: Integer): Integer;
Var
  I: Integer;
  BufferObj: TPDFlibBuffer;
Begin
  Result := 0;
  If FindInstance(InstanceID, I) Then
  Begin
    BufferObj := InstanceList[I].FindBuffer(Buffer);
    If Assigned(BufferObj) Then
    Begin
      If SourceLength > (BufferObj.StoreLength - BufferObj.StorePosition) Then
        SourceLength := BufferObj.StoreLength - BufferObj.StorePosition;
      If SourceLength > 0 Then
      Begin
        Move(Source^, BufferObj.Store[BufferObj.StorePosition], SourceLength);
        Inc(BufferObj.StorePosition, SourceLength);
        Result := BufferObj.StoreLength - BufferObj.StorePosition;
      End;
    End;
  End;
End;

Function DLAddToFileList(InstanceID: Integer; ListName, FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddToFileList(InstanceList[I].GetWideString(ListName), InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLAddToFileListA(InstanceID: Integer; ListName, FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddToFileList(InstanceList[I].GetWideStringFromAnsi(ListName), InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLAddTrueTypeFont(InstanceID: Integer; FontName: PWideChar; Embed: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddTrueTypeFont(InstanceList[I].GetWideString(FontName), Embed);
  End
  Else
    Result := 0;
End;

Function DLAddTrueTypeFontA(InstanceID: Integer; FontName: PAnsiChar; Embed: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddTrueTypeFont(InstanceList[I].GetWideStringFromAnsi(FontName), Embed);
  End
  Else
    Result := 0;
End;

Function DLAddTrueTypeFontFromFile(InstanceID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddTrueTypeFontFromFile(InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLAddTrueTypeFontFromFileA(InstanceID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddTrueTypeFontFromFile(InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLAddTrueTypeSubsettedFont(InstanceID: Integer; FontName, SubsetChars: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddTrueTypeSubsettedFont(InstanceList[I].GetWideString(FontName), InstanceList[I].GetWideString(SubsetChars), Options);
  End
  Else
    Result := 0;
End;

Function DLAddTrueTypeSubsettedFontA(InstanceID: Integer; FontName, SubsetChars: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddTrueTypeSubsettedFont(InstanceList[I].GetWideStringFromAnsi(FontName),
      InstanceList[I].GetWideStringFromAnsi(SubsetChars), Options);
  End
  Else
    Result := 0;
End;

Function DLAddType1Font(InstanceID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddType1Font(InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLAddType1FontA(InstanceID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddType1Font(InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLAddU3DAnnotationFromFile(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddU3DAnnotationFromFile(Left, Top, Width, Height, InstanceList[I].GetWideString(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAddU3DAnnotationFromFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AddU3DAnnotationFromFile(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(FileName), Options);
  End
  Else
    Result := 0;
End;

Function DLAnalyseFile(InstanceID: Integer; InputFileName, Password: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AnalyseFile(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(Password));
  End
  Else
    Result := 0;
End;

Function DLAnalyseFileA(InstanceID: Integer; InputFileName, Password: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AnalyseFile(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(Password));
  End
  Else
    Result := 0;
End;

Function DLAnnotationCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AnnotationCount;
  End
  Else
    Result := 0;
End;

Function DLAnsiStringResultLength(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := Length(InstanceList[I].ReturnString);
  End
  Else
    Result := 0;
End;

Function DLAppendSpace(InstanceID: Integer; RelativeSpace: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AppendSpace(RelativeSpace);
  End
  Else
    Result := 0;
End;

Function DLAppendTableColumns(InstanceID, TableID, NewColumnCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AppendTableColumns(TableID, NewColumnCount);
  End
  Else
    Result := 0;
End;

Function DLAppendTableRows(InstanceID, TableID, NewRowCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AppendTableRows(TableID, NewRowCount);
  End
  Else
    Result := 0;
End;

Function DLAppendText(InstanceID: Integer; Text: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AppendText(InstanceList[I].GetWideString(Text));
  End
  Else
    Result := 0;
End;

Function DLAppendTextA(InstanceID: Integer; Text: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AppendText(InstanceList[I].GetWideStringFromAnsi(Text));
  End
  Else
    Result := 0;
End;

Function DLAppendToFile(InstanceID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AppendToFile(InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLAppendToFileA(InstanceID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AppendToFile(InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLAppendToString(InstanceID, AppendMode: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.AppendToString(AppendMode);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLApplyStyle(InstanceID: Integer; StyleName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ApplyStyle(InstanceList[I].GetWideString(StyleName));
  End
  Else
    Result := 0;
End;

Function DLApplyStyleA(InstanceID: Integer; StyleName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ApplyStyle(InstanceList[I].GetWideStringFromAnsi(StyleName));
  End
  Else
    Result := 0;
End;

Function DLAttachAnnotToForm(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.AttachAnnotToForm(Index);
  End
  Else
    Result := 0;
End;

Function DLBalanceContentStream(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.BalanceContentStream;
  End
  Else
    Result := 0;
End;

Function DLBalancePageTree(InstanceID, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.BalancePageTree(Options);
  End
  Else
    Result := 0;
End;

Function DLBeginPageUpdate(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.BeginPageUpdate;
  End
  Else
    Result := 0;
End;

Function DLCapturePage(InstanceID, Page: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CapturePage(Page);
  End
  Else
    Result := 0;
End;

Function DLCapturePageEx(InstanceID, Page, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CapturePageEx(Page, Options);
  End
  Else
    Result := 0;
End;

Function DLCharWidth(InstanceID, CharCode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CharWidth(CharCode);
  End
  Else
    Result := 0;
End;

Function DLCheckFileCompliance(InstanceID: Integer; InputFileName, Password: PWideChar; ComplianceTest, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CheckFileCompliance(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(Password),
      ComplianceTest, Options);
  End
  Else
    Result := 0;
End;

Function DLCheckFileComplianceA(InstanceID: Integer; InputFileName, Password: PAnsiChar; ComplianceTest, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CheckFileCompliance(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(Password),
      ComplianceTest, Options);
  End
  Else
    Result := 0;
End;

Function DLCheckObjects(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CheckObjects;
  End
  Else
    Result := 0;
End;

Function DLCheckPageAnnots(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CheckPageAnnots;
  End
  Else
    Result := 0;
End;

Function DLCheckPassword(InstanceID: Integer; Password: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CheckPassword(InstanceList[I].GetWideString(Password));
  End
  Else
    Result := 0;
End;

Function DLCheckPasswordA(InstanceID: Integer; Password: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CheckPassword(InstanceList[I].GetWideStringFromAnsi(Password));
  End
  Else
    Result := 0;
End;

Function DLClearFileList(InstanceID: Integer; ListName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ClearFileList(InstanceList[I].GetWideString(ListName));
  End
  Else
    Result := 0;
End;

Function DLClearFileListA(InstanceID: Integer; ListName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ClearFileList(InstanceList[I].GetWideStringFromAnsi(ListName));
  End
  Else
    Result := 0;
End;

Function DLClearImage(InstanceID, ImageID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ClearImage(ImageID);
  End
  Else
    Result := 0;
End;

Function DLClearPageLabels(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ClearPageLabels;
  End
  Else
    Result := 0;
End;

Function DLClearTextFormatting(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ClearTextFormatting;
  End
  Else
    Result := 0;
End;

Function DLCloneOutlineAction(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CloneOutlineAction(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLClonePages(InstanceID, StartPage, EndPage, RepeatCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ClonePages(StartPage, EndPage, RepeatCount);
  End
  Else
    Result := 0;
End;

Function DLCloseOutline(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CloseOutline(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLClosePath(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ClosePath;
  End
  Else
    Result := 0;
End;

Function DLCombineContentStreams(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CombineContentStreams;
  End
  Else
    Result := 0;
End;

Function DLCompareOutlines(InstanceID, FirstOutlineID, SecondOutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CompareOutlines(FirstOutlineID, SecondOutlineID);
  End
  Else
    Result := 0;
End;

Function DLCompressContent(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CompressContent;
  End
  Else
    Result := 0;
End;

Function DLCompressFonts(InstanceID, Compress: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CompressFonts(Compress);
  End
  Else
    Result := 0;
End;

Function DLCompressImages(InstanceID, Compress: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CompressImages(Compress);
  End
  Else
    Result := 0;
End;

Function DLCompressPage(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CompressPage;
  End
  Else
    Result := 0;
End;

Function DLContentStreamCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ContentStreamCount;
  End
  Else
    Result := 0;
End;

Function DLContentStreamSafe(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ContentStreamSafe;
  End
  Else
    Result := 0;
End;

Function DLCopyPageRanges(InstanceID, DocumentID: Integer; RangeList: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CopyPageRanges(DocumentID, InstanceList[I].GetWideString(RangeList));
  End
  Else
    Result := 0;
End;

Function DLCopyPageRangesA(InstanceID, DocumentID: Integer; RangeList: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CopyPageRanges(DocumentID, InstanceList[I].GetWideStringFromAnsi(RangeList));
  End
  Else
    Result := 0;
End;

Function DLCopyPageRangesEx(InstanceID, DocumentID: Integer; RangeList: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CopyPageRangesEx(DocumentID, InstanceList[I].GetWideString(RangeList), Options);
  End
  Else
    Result := 0;
End;

Function DLCopyPageRangesExA(InstanceID, DocumentID: Integer; RangeList: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CopyPageRangesEx(DocumentID, InstanceList[I].GetWideStringFromAnsi(RangeList), Options);
  End
  Else
    Result := 0;
End;

Function DLCreateBuffer(InstanceID, BufferLength: Integer): PAnsiChar;
Var
  I: Integer;
  L: Integer;
  Buffer: TPDFlibBuffer;
Begin
  If (BufferLength > 0) and FindInstance(InstanceID, I) Then
  Begin
    L := Length(InstanceList[I].Buffers);
    SetLength(InstanceList[I].Buffers, L + 1);
    Buffer := TPDFlibBuffer.Create;
    InstanceList[I].Buffers[L] := Buffer;
    SetLength(Buffer.Store, BufferLength);
    Result := @Buffer.Store;
    Buffer.StoreLength := BufferLength;
    Buffer.StorePosition := 0;
  End
  Else
    Result := Nil;
End;

Function DLCreateLibrary: Integer;
Var
  X: Integer;
  I: Integer;
  L: Integer;
Begin
  CriticalSection.Enter;
  Try
    If (Length(InstanceList) = 0) Then
    Begin
      SetLength(InstanceList, 1);
      InstanceList[0] := TPDFlibInstance.Create;
    End;
    L := Length(InstanceList);
    I := -1;
    X := 0;
    While (I < 0) and (X < L) Do
      If not Assigned(InstanceList[X]) Then
        I := X
      Else
        Inc(X);
    If I < 0 Then
    Begin
      SetLength(InstanceList, L + 1);
      I := L;
    End;
    InstanceList[I] := TPDFlibInstance.Create;
    Result := InstanceList[I].InstanceID;
  Finally
    CriticalSection.Leave;
  End;
End;

Function DLCreateNewObject(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CreateNewObject;
  End
  Else
    Result := 0;
End;

Function DLCreateRenderer(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CreateRenderer;
  End
  Else
    Result := 0;
End;

Function DLCreateTable(InstanceID, RowCount, ColumnCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.CreateTable(RowCount, ColumnCount);
  End
  Else
    Result := 0;
End;

Function DLDAAppendFile(InstanceID, FileHandle: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAAppendFile(FileHandle);
  End
  Else
    Result := 0;
End;

Function DLDACapturePage(InstanceID, FileHandle, PageRef: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DACapturePage(FileHandle, PageRef);
  End
  Else
    Result := 0;
End;

Function DLDACapturePageEx(InstanceID, FileHandle, PageRef, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DACapturePageEx(FileHandle, PageRef, Options);
  End
  Else
    Result := 0;
End;

Function DLDACloseFile(InstanceID, FileHandle: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DACloseFile(FileHandle);
  End
  Else
    Result := 0;
End;

Function DLDADrawCapturedPage(InstanceID, FileHandle, DACaptureID, DestPageRef: Integer; PntLeft, PntBottom, PntWidth, PntHeight: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DADrawCapturedPage(FileHandle, DACaptureID, DestPageRef, PntLeft, PntBottom, PntWidth, PntHeight);
  End
  Else
    Result := 0;
End;

Function DLDADrawRotatedCapturedPage(InstanceID, FileHandle, DACaptureID, DestPageRef: Integer; PntLeft, PntBottom, PntWidth, PntHeight, Angle: Double)
  : Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DADrawRotatedCapturedPage(FileHandle, DACaptureID, DestPageRef, PntLeft, PntBottom, PntWidth, PntHeight, Angle);
  End
  Else
    Result := 0;
End;

Function DLDAEmbedFileStreams(InstanceID, FileHandle: Integer; RootPath: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAEmbedFileStreams(FileHandle, InstanceList[I].GetWideString(RootPath));
  End
  Else
    Result := 0;
End;

Function DLDAEmbedFileStreamsA(InstanceID, FileHandle: Integer; RootPath: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAEmbedFileStreams(FileHandle, InstanceList[I].GetWideStringFromAnsi(RootPath));
  End
  Else
    Result := 0;
End;

Function DLDAExtractPageText(InstanceID, FileHandle, PageRef, Options: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAExtractPageText(FileHandle, PageRef, Options);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAExtractPageTextA(InstanceID, FileHandle, PageRef, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAExtractPageText(FileHandle, PageRef, Options);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAExtractPageTextBlocks(InstanceID, FileHandle, PageRef, ExtractOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAExtractPageTextBlocks(FileHandle, PageRef, ExtractOptions);
  End
  Else
    Result := 0;
End;

Function DLDAFindPage(InstanceID, FileHandle, Page: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAFindPage(FileHandle, Page);
  End
  Else
    Result := 0;
End;

Function DLDAGetAnnotationCount(InstanceID, FileHandle, PageRef: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetAnnotationCount(FileHandle, PageRef);
  End
  Else
    Result := 0;
End;

Function DLDAGetFormFieldCount(InstanceID, FileHandle: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetFormFieldCount(FileHandle);
  End
  Else
    Result := 0;
End;

Function DLDAGetFormFieldTitle(InstanceID, FileHandle, FieldIndex: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetFormFieldTitle(FileHandle, FieldIndex);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetFormFieldTitleA(InstanceID, FileHandle, FieldIndex: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetFormFieldTitle(FileHandle, FieldIndex);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetFormFieldValue(InstanceID, FileHandle, FieldIndex: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetFormFieldValue(FileHandle, FieldIndex);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetFormFieldValueA(InstanceID, FileHandle, FieldIndex: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetFormFieldValue(FileHandle, FieldIndex);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetImageDataToString(InstanceID, FileHandle, ImageListID, ImageIndex: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.DAGetImageDataToString(FileHandle, ImageListID, ImageIndex);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetImageDblProperty(InstanceID, FileHandle, ImageListID, ImageIndex, PropertyID: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetImageDblProperty(FileHandle, ImageListID, ImageIndex, PropertyID);
  End
  Else
    Result := 0;
End;

Function DLDAGetImageIntProperty(InstanceID, FileHandle, ImageListID, ImageIndex, PropertyID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetImageIntProperty(FileHandle, ImageListID, ImageIndex, PropertyID);
  End
  Else
    Result := 0;
End;

Function DLDAGetImageListCount(InstanceID, FileHandle, ImageListID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetImageListCount(FileHandle, ImageListID);
  End
  Else
    Result := 0;
End;

Function DLDAGetInformation(InstanceID, FileHandle: Integer; Key: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetInformation(FileHandle, InstanceList[I].GetWideString(Key));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetInformationA(InstanceID, FileHandle: Integer; Key: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetInformation(FileHandle, InstanceList[I].GetWideStringFromAnsi(Key));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetObjectCount(InstanceID, FileHandle: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetObjectCount(FileHandle);
  End
  Else
    Result := 0;
End;

Function DLDAGetObjectToString(InstanceID, FileHandle, ObjectNumber: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.DAGetObjectToString(FileHandle, ObjectNumber);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetPageBox(InstanceID, FileHandle, PageRef, BoxIndex, Dimension: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetPageBox(FileHandle, PageRef, BoxIndex, Dimension);
  End
  Else
    Result := 0;
End;

Function DLDAGetPageContentToString(InstanceID, FileHandle, PageRef: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.DAGetPageContentToString(FileHandle, PageRef);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetPageCount(InstanceID, FileHandle: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetPageCount(FileHandle);
  End
  Else
    Result := 0;
End;

Function DLDAGetPageHeight(InstanceID, FileHandle, PageRef: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetPageHeight(FileHandle, PageRef);
  End
  Else
    Result := 0;
End;

Function DLDAGetPageImageList(InstanceID, FileHandle, PageRef: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetPageImageList(FileHandle, PageRef);
  End
  Else
    Result := 0;
End;

Function DLDAGetPageWidth(InstanceID, FileHandle, PageRef: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetPageWidth(FileHandle, PageRef);
  End
  Else
    Result := 0;
End;

Function DLDAGetTextBlockAsString(InstanceID, TextBlockListID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetTextBlockAsString(TextBlockListID, Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetTextBlockAsStringA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetTextBlockAsString(TextBlockListID, Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetTextBlockBound(InstanceID, TextBlockListID, Index, BoundIndex: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetTextBlockBound(TextBlockListID, Index, BoundIndex);
  End
  Else
    Result := 0;
End;

Function DLDAGetTextBlockCharWidth(InstanceID, TextBlockListID, Index, CharIndex: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetTextBlockCharWidth(TextBlockListID, Index, CharIndex);
  End
  Else
    Result := 0;
End;

Function DLDAGetTextBlockColor(InstanceID, TextBlockListID, Index, ColorComponent: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetTextBlockColor(TextBlockListID, Index, ColorComponent);
  End
  Else
    Result := 0;
End;

Function DLDAGetTextBlockColorType(InstanceID, TextBlockListID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetTextBlockColorType(TextBlockListID, Index);
  End
  Else
    Result := 0;
End;

Function DLDAGetTextBlockCount(InstanceID, TextBlockListID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetTextBlockCount(TextBlockListID);
  End
  Else
    Result := 0;
End;

Function DLDAGetTextBlockFontName(InstanceID, TextBlockListID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetTextBlockFontName(TextBlockListID, Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetTextBlockFontNameA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetTextBlockFontName(TextBlockListID, Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetTextBlockFontSize(InstanceID, TextBlockListID, Index: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAGetTextBlockFontSize(TextBlockListID, Index);
  End
  Else
    Result := 0;
End;

Function DLDAGetTextBlockText(InstanceID, TextBlockListID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetTextBlockText(TextBlockListID, Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAGetTextBlockTextA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DAGetTextBlockText(TextBlockListID, Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDAHasPageBox(InstanceID, FileHandle, PageRef, BoxIndex: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAHasPageBox(FileHandle, PageRef, BoxIndex);
  End
  Else
    Result := 0;
End;

Function DLDAHidePage(InstanceID, FileHandle, PageRef: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAHidePage(FileHandle, PageRef);
  End
  Else
    Result := 0;
End;

Function DLDAMovePage(InstanceID, FileHandle, PageRef, TargetPageRef, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAMovePage(FileHandle, PageRef, TargetPageRef, Options);
  End
  Else
    Result := 0;
End;

Function DLDANewPage(InstanceID, FileHandle: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DANewPage(FileHandle);
  End
  Else
    Result := 0;
End;

Function DLDANewPages(InstanceID, FileHandle, PageCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DANewPages(FileHandle, PageCount);
  End
  Else
    Result := 0;
End;

Function DLDANormalizePage(InstanceID, FileHandle, PageRef, NormalizeOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DANormalizePage(FileHandle, PageRef, NormalizeOptions);
  End
  Else
    Result := 0;
End;

Function DLDAOpenFile(InstanceID: Integer; InputFileName, Password: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAOpenFile(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(Password));
  End
  Else
    Result := 0;
End;

Function DLDAOpenFileA(InstanceID: Integer; InputFileName, Password: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAOpenFile(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(Password));
  End
  Else
    Result := 0;
End;

Function DLDAOpenFileReadOnly(InstanceID: Integer; InputFileName, Password: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAOpenFileReadOnly(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(Password));
  End
  Else
    Result := 0;
End;

Function DLDAOpenFileReadOnlyA(InstanceID: Integer; InputFileName, Password: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAOpenFileReadOnly(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(Password));
  End
  Else
    Result := 0;
End;

Function DLDAPageRotation(InstanceID, FileHandle, PageRef: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAPageRotation(FileHandle, PageRef);
  End
  Else
    Result := 0;
End;

Function DLDAReleaseImageList(InstanceID, FileHandle, ImageListID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAReleaseImageList(FileHandle, ImageListID);
  End
  Else
    Result := 0;
End;

Function DLDAReleaseTextBlocks(InstanceID, TextBlockListID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAReleaseTextBlocks(TextBlockListID);
  End
  Else
    Result := 0;
End;

Function DLDARemoveUsageRights(InstanceID, FileHandle: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DARemoveUsageRights(FileHandle);
  End
  Else
    Result := 0;
End;

Function DLDARenderPageToDC(InstanceID, FileHandle, PageRef: Integer; DPI: Double; DC: HDC): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DARenderPageToDC(FileHandle, PageRef, DPI, DC);
  End
  Else
    Result := 0;
End;

Function DLDARenderPageToFile(InstanceID, FileHandle, PageRef, Options: Integer; DPI: Double; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DARenderPageToFile(FileHandle, PageRef, Options, DPI, InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLDARenderPageToFileA(InstanceID, FileHandle, PageRef, Options: Integer; DPI: Double; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DARenderPageToFile(FileHandle, PageRef, Options, DPI, InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLDARenderPageToString(InstanceID, FileHandle, PageRef, Options: Integer; DPI: Double): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.DARenderPageToString(FileHandle, PageRef, Options, DPI);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDARotatePage(InstanceID, FileHandle, PageRef, Angle, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DARotatePage(FileHandle, PageRef, Angle, Options);
  End
  Else
    Result := 0;
End;

Function DLDASaveAsFile(InstanceID, FileHandle: Integer; OutputFileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASaveAsFile(FileHandle, InstanceList[I].GetWideString(OutputFileName));
  End
  Else
    Result := 0;
End;

Function DLDASaveAsFileA(InstanceID, FileHandle: Integer; OutputFileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASaveAsFile(FileHandle, InstanceList[I].GetWideStringFromAnsi(OutputFileName));
  End
  Else
    Result := 0;
End;

Function DLDASaveImageDataToFile(InstanceID, FileHandle, ImageListID, ImageIndex: Integer; ImageFileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASaveImageDataToFile(FileHandle, ImageListID, ImageIndex, InstanceList[I].GetWideString(ImageFileName));
  End
  Else
    Result := 0;
End;

Function DLDASaveImageDataToFileA(InstanceID, FileHandle, ImageListID, ImageIndex: Integer; ImageFileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASaveImageDataToFile(FileHandle, ImageListID, ImageIndex, InstanceList[I].GetWideStringFromAnsi(ImageFileName));
  End
  Else
    Result := 0;
End;

Function DLDASetInformation(InstanceID, FileHandle: Integer; Key, NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASetInformation(FileHandle, InstanceList[I].GetWideString(Key), InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLDASetInformationA(InstanceID, FileHandle: Integer; Key, NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASetInformation(FileHandle, InstanceList[I].GetWideStringFromAnsi(Key), InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLDASetPageBox(InstanceID, FileHandle, PageRef, BoxIndex: Integer; X1, Y1, X2, Y2: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASetPageBox(FileHandle, PageRef, BoxIndex, X1, Y1, X2, Y2);
  End
  Else
    Result := 0;
End;

Function DLDASetPageLayout(InstanceID, FileHandle, NewPageLayout: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASetPageLayout(FileHandle, NewPageLayout);
  End
  Else
    Result := 0;
End;

Function DLDASetPageMode(InstanceID, FileHandle, NewPageMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASetPageMode(FileHandle, NewPageMode);
  End
  Else
    Result := 0;
End;

Function DLDASetPageSize(InstanceID, FileHandle, PageRef: Integer; PntWidth, PntHeight: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASetPageSize(FileHandle, PageRef, PntWidth, PntHeight);
  End
  Else
    Result := 0;
End;

Function DLDASetTextExtractionArea(InstanceID: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASetTextExtractionArea(Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLDASetTextExtractionOptions(InstanceID, OptionID, NewValue: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASetTextExtractionOptions(OptionID, NewValue);
  End
  Else
    Result := 0;
End;

Function DLDASetTextExtractionScaling(InstanceID, Options: Integer; Horizontal, Vertical: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASetTextExtractionScaling(Options, Horizontal, Vertical);
  End
  Else
    Result := 0;
End;

Function DLDASetTextExtractionWordGap(InstanceID: Integer; NewWordGap: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DASetTextExtractionWordGap(NewWordGap);
  End
  Else
    Result := 0;
End;

Function DLDAShiftedHeader(InstanceID, FileHandle: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DAShiftedHeader(FileHandle);
  End
  Else
    Result := 0;
End;

Function DLDecrypt(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.Decrypt;
  End
  Else
    Result := 0;
End;

Function DLDecryptFile(InstanceID: Integer; InputFileName, OutputFileName, Password: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DecryptFile(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(OutputFileName),
      InstanceList[I].GetWideString(Password));
  End
  Else
    Result := 0;
End;

Function DLDecryptFileA(InstanceID: Integer; InputFileName, OutputFileName, Password: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DecryptFile(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(OutputFileName),
      InstanceList[I].GetWideStringFromAnsi(Password));
  End
  Else
    Result := 0;
End;

Function DLDeleteAnalysis(InstanceID, AnalysisID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DeleteAnalysis(AnalysisID);
  End
  Else
    Result := 0;
End;

Function DLDeleteAnnotation(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DeleteAnnotation(Index);
  End
  Else
    Result := 0;
End;

Function DLDeleteContentStream(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DeleteContentStream;
  End
  Else
    Result := 0;
End;

Function DLDeleteFormField(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DeleteFormField(Index);
  End
  Else
    Result := 0;
End;

Function DLDeleteOptionalContentGroup(InstanceID, OptionalContentGroupID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DeleteOptionalContentGroup(OptionalContentGroupID);
  End
  Else
    Result := 0;
End;

Function DLDeletePageLGIDict(InstanceID, DictIndex: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DeletePageLGIDict(DictIndex);
  End
  Else
    Result := 0;
End;

Function DLDeletePages(InstanceID, StartPage, PageCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DeletePages(StartPage, PageCount);
  End
  Else
    Result := 0;
End;

Function DLDestroyRenderer(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DestroyRenderer;
  End
  Else
    Result := 0;
End;

Function DLDocJavaScriptAction(InstanceID: Integer; ActionType, JavaScript: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DocJavaScriptAction(InstanceList[I].GetWideString(ActionType), InstanceList[I].GetWideString(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLDocJavaScriptActionA(InstanceID: Integer; ActionType, JavaScript: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DocJavaScriptAction(InstanceList[I].GetWideStringFromAnsi(ActionType), InstanceList[I].GetWideStringFromAnsi(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLDocumentCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DocumentCount;
  End
  Else
    Result := 0;
End;

Function DLDrawArc(InstanceID: Integer; XPos, YPos, Radius, StartAngle, EndAngle: Double; Pie, DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawArc(XPos, YPos, Radius, StartAngle, EndAngle, Pie, DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawBarcode(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PWideChar; Barcode, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawBarcode(Left, Top, Width, Height, InstanceList[I].GetWideString(Text), Barcode, Options);
  End
  Else
    Result := 0;
End;

Function DLDrawBarcodeA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Barcode, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawBarcode(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(Text), Barcode, Options);
  End
  Else
    Result := 0;
End;

Function DLDrawBox(InstanceID: Integer; Left, Top, Width, Height: Double; DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawBox(Left, Top, Width, Height, DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawCapturedPage(InstanceID, CaptureID: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawCapturedPage(CaptureID, Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLDrawCapturedPageMatrix(InstanceID, CaptureID: Integer; M11, M12, M21, M22, MDX, MDY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawCapturedPageMatrix(CaptureID, M11, M12, M21, M22, MDX, MDY);
  End
  Else
    Result := 0;
End;

Function DLDrawCircle(InstanceID: Integer; XPos, YPos, Radius: Double; DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawCircle(XPos, YPos, Radius, DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawDataMatrixSymbol(InstanceID: Integer; Left, Top, ModuleSize: Double; Text: PWideChar; Encoding, SymbolSize, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawDataMatrixSymbol(Left, Top, ModuleSize, InstanceList[I].GetWideString(Text), Encoding, SymbolSize, Options);
  End
  Else
    Result := 0;
End;

Function DLDrawDataMatrixSymbolA(InstanceID: Integer; Left, Top, ModuleSize: Double; Text: PAnsiChar; Encoding, SymbolSize, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawDataMatrixSymbol(Left, Top, ModuleSize, InstanceList[I].GetWideStringFromAnsi(Text), Encoding, SymbolSize, Options);
  End
  Else
    Result := 0;
End;

Function DLDrawEllipse(InstanceID: Integer; XPos, YPos, Width, Height: Double; DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawEllipse(XPos, YPos, Width, Height, DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawEllipticArc(InstanceID: Integer; XPos, YPos, Width, Height, StartAngle, EndAngle: Double; Pie, DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawEllipticArc(XPos, YPos, Width, Height, StartAngle, EndAngle, Pie, DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawHTMLText(InstanceID: Integer; Left, Top, Width: Double; HTMLText: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawHTMLText(Left, Top, Width, InstanceList[I].GetWideString(HTMLText));
  End
  Else
    Result := 0;
End;

Function DLDrawHTMLTextA(InstanceID: Integer; Left, Top, Width: Double; HTMLText: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawHTMLText(Left, Top, Width, InstanceList[I].GetWideStringFromAnsi(HTMLText));
  End
  Else
    Result := 0;
End;

Function DLDrawHTMLTextBox(InstanceID: Integer; Left, Top, Width, Height: Double; HTMLText: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DrawHTMLTextBox(Left, Top, Width, Height, InstanceList[I].GetWideString(HTMLText));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDrawHTMLTextBoxA(InstanceID: Integer; Left, Top, Width, Height: Double; HTMLText: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DrawHTMLTextBox(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(HTMLText));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDrawHTMLTextBoxMatrix(InstanceID: Integer; Width, Height: Double; HTMLText: PWideChar; M11, M12, M21, M22, MDX, MDY: Double): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DrawHTMLTextBoxMatrix(Width, Height, InstanceList[I].GetWideString(HTMLText), M11, M12, M21, M22,
      MDX, MDY);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDrawHTMLTextBoxMatrixA(InstanceID: Integer; Width, Height: Double; HTMLText: PAnsiChar; M11, M12, M21, M22, MDX, MDY: Double): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.DrawHTMLTextBoxMatrix(Width, Height, InstanceList[I].GetWideStringFromAnsi(HTMLText), M11, M12,
      M21, M22, MDX, MDY);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLDrawHTMLTextMatrix(InstanceID: Integer; Width: Double; HTMLText: PWideChar; M11, M12, M21, M22, MDX, MDY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawHTMLTextMatrix(Width, InstanceList[I].GetWideString(HTMLText), M11, M12, M21, M22, MDX, MDY);
  End
  Else
    Result := 0;
End;

Function DLDrawHTMLTextMatrixA(InstanceID: Integer; Width: Double; HTMLText: PAnsiChar; M11, M12, M21, M22, MDX, MDY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawHTMLTextMatrix(Width, InstanceList[I].GetWideStringFromAnsi(HTMLText), M11, M12, M21, M22, MDX, MDY);
  End
  Else
    Result := 0;
End;

Function DLDrawImage(InstanceID: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawImage(Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLDrawImageMatrix(InstanceID: Integer; M11, M12, M21, M22, MDX, MDY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawImageMatrix(M11, M12, M21, M22, MDX, MDY);
  End
  Else
    Result := 0;
End;

Function DLDrawIntelligentMailBarcode(InstanceID: Integer; Left, Top, BarWidth, FullBarHeight, TrackerHeight, SpaceWidth: Double; BarcodeData: PWideChar;
  Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawIntelligentMailBarcode(Left, Top, BarWidth, FullBarHeight, TrackerHeight, SpaceWidth,
      InstanceList[I].GetWideString(BarcodeData), Options);
  End
  Else
    Result := 0;
End;

Function DLDrawIntelligentMailBarcodeA(InstanceID: Integer; Left, Top, BarWidth, FullBarHeight, TrackerHeight, SpaceWidth: Double; BarcodeData: PAnsiChar;
  Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawIntelligentMailBarcode(Left, Top, BarWidth, FullBarHeight, TrackerHeight, SpaceWidth,
      InstanceList[I].GetWideStringFromAnsi(BarcodeData), Options);
  End
  Else
    Result := 0;
End;

Function DLDrawLine(InstanceID: Integer; StartX, StartY, EndX, EndY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawLine(StartX, StartY, EndX, EndY);
  End
  Else
    Result := 0;
End;

Function DLDrawMultiLineText(InstanceID: Integer; XPos, YPos: Double; Delimiter, Text: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawMultiLineText(XPos, YPos, InstanceList[I].GetWideString(Delimiter), InstanceList[I].GetWideString(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawMultiLineTextA(InstanceID: Integer; XPos, YPos: Double; Delimiter, Text: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawMultiLineText(XPos, YPos, InstanceList[I].GetWideStringFromAnsi(Delimiter),
      InstanceList[I].GetWideStringFromAnsi(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawPDF417Symbol(InstanceID: Integer; Left, Top: Double; Text: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawPDF417Symbol(Left, Top, InstanceList[I].GetWideString(Text), Options);
  End
  Else
    Result := 0;
End;

Function DLDrawPDF417SymbolA(InstanceID: Integer; Left, Top: Double; Text: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawPDF417Symbol(Left, Top, InstanceList[I].GetWideStringFromAnsi(Text), Options);
  End
  Else
    Result := 0;
End;

Function DLDrawPDF417SymbolEx(InstanceID: Integer; Left, Top: Double; Text: PWideChar; Options, FixedColumns, FixedRows, ErrorLevel: Integer;
  ModuleSize, HeightWidthRatio: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawPDF417SymbolEx(Left, Top, InstanceList[I].GetWideString(Text), Options, FixedColumns, FixedRows, ErrorLevel,
      ModuleSize, HeightWidthRatio);
  End
  Else
    Result := 0;
End;

Function DLDrawPDF417SymbolExA(InstanceID: Integer; Left, Top: Double; Text: PAnsiChar; Options, FixedColumns, FixedRows, ErrorLevel: Integer;
  ModuleSize, HeightWidthRatio: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawPDF417SymbolEx(Left, Top, InstanceList[I].GetWideStringFromAnsi(Text), Options, FixedColumns, FixedRows, ErrorLevel,
      ModuleSize, HeightWidthRatio);
  End
  Else
    Result := 0;
End;

Function DLDrawPath(InstanceID, PathOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawPath(PathOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawPathEvenOdd(InstanceID, PathOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawPathEvenOdd(PathOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawPostScriptXObject(InstanceID, PSRef: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawPostScriptXObject(PSRef);
  End
  Else
    Result := 0;
End;

Function DLDrawQRCode(InstanceID: Integer; Left, Top, SymbolSize: Double; Text: PWideChar; EncodeOptions, DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawQRCode(Left, Top, SymbolSize, InstanceList[I].GetWideString(Text), EncodeOptions, DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawQRCodeA(InstanceID: Integer; Left, Top, SymbolSize: Double; Text: PAnsiChar; EncodeOptions, DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawQRCode(Left, Top, SymbolSize, InstanceList[I].GetWideStringFromAnsi(Text), EncodeOptions, DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedBox(InstanceID: Integer; Left, Bottom, Width, Height, Angle: Double; DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedBox(Left, Bottom, Width, Height, Angle, DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedCapturedPage(InstanceID, CaptureID: Integer; Left, Bottom, Width, Height, Angle: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedCapturedPage(CaptureID, Left, Bottom, Width, Height, Angle);
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedImage(InstanceID: Integer; Left, Bottom, Width, Height, Angle: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedImage(Left, Bottom, Width, Height, Angle);
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedMultiLineText(InstanceID: Integer; XPos, YPos, Angle: Double; Delimiter, Text: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedMultiLineText(XPos, YPos, Angle, InstanceList[I].GetWideString(Delimiter), InstanceList[I].GetWideString(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedMultiLineTextA(InstanceID: Integer; XPos, YPos, Angle: Double; Delimiter, Text: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedMultiLineText(XPos, YPos, Angle, InstanceList[I].GetWideStringFromAnsi(Delimiter),
      InstanceList[I].GetWideStringFromAnsi(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedText(InstanceID: Integer; XPos, YPos, Angle: Double; Text: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedText(XPos, YPos, Angle, InstanceList[I].GetWideString(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedTextA(InstanceID: Integer; XPos, YPos, Angle: Double; Text: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedText(XPos, YPos, Angle, InstanceList[I].GetWideStringFromAnsi(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedTextBox(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedTextBox(Left, Top, Width, Height, Angle, InstanceList[I].GetWideString(Text), Options);
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedTextBoxA(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedTextBox(Left, Top, Width, Height, Angle, InstanceList[I].GetWideStringFromAnsi(Text), Options);
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedTextBoxEx(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PWideChar;
  Options, Border, Radius, DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedTextBoxEx(Left, Top, Width, Height, Angle, InstanceList[I].GetWideString(Text), Options, Border, Radius,
      DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawRotatedTextBoxExA(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PAnsiChar;
  Options, Border, Radius, DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRotatedTextBoxEx(Left, Top, Width, Height, Angle, InstanceList[I].GetWideStringFromAnsi(Text), Options, Border, Radius,
      DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawRoundedBox(InstanceID: Integer; Left, Top, Width, Height, Radius: Double; DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRoundedBox(Left, Top, Width, Height, Radius, DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawRoundedRotatedBox(InstanceID: Integer; Left, Bottom, Width, Height, Radius, Angle: Double; DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawRoundedRotatedBox(Left, Bottom, Width, Height, Radius, Angle, DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawScaledImage(InstanceID: Integer; Left, Top, Scale: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawScaledImage(Left, Top, Scale);
  End
  Else
    Result := 0;
End;

Function DLDrawSpacedText(InstanceID: Integer; XPos, YPos, Spacing: Double; Text: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawSpacedText(XPos, YPos, Spacing, InstanceList[I].GetWideString(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawSpacedTextA(InstanceID: Integer; XPos, YPos, Spacing: Double; Text: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawSpacedText(XPos, YPos, Spacing, InstanceList[I].GetWideStringFromAnsi(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawTableRows(InstanceID, TableID: Integer; Left, Top, Height: Double; FirstRow, LastRow: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawTableRows(TableID, Left, Top, Height, FirstRow, LastRow);
  End
  Else
    Result := 0;
End;

Function DLDrawText(InstanceID: Integer; XPos, YPos: Double; Text: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawText(XPos, YPos, InstanceList[I].GetWideString(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawTextA(InstanceID: Integer; XPos, YPos: Double; Text: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawText(XPos, YPos, InstanceList[I].GetWideStringFromAnsi(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawTextArc(InstanceID: Integer; XPos, YPos, Radius, Angle: Double; Text: PWideChar; DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawTextArc(XPos, YPos, Radius, Angle, InstanceList[I].GetWideString(Text), DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawTextArcA(InstanceID: Integer; XPos, YPos, Radius, Angle: Double; Text: PAnsiChar; DrawOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawTextArc(XPos, YPos, Radius, Angle, InstanceList[I].GetWideStringFromAnsi(Text), DrawOptions);
  End
  Else
    Result := 0;
End;

Function DLDrawTextBox(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawTextBox(Left, Top, Width, Height, InstanceList[I].GetWideString(Text), Options);
  End
  Else
    Result := 0;
End;

Function DLDrawTextBoxA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawTextBox(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(Text), Options);
  End
  Else
    Result := 0;
End;

Function DLDrawTextBoxMatrix(InstanceID: Integer; Width, Height: Double; Text: PWideChar; Options: Integer; M11, M12, M21, M22, MDX, MDY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawTextBoxMatrix(Width, Height, InstanceList[I].GetWideString(Text), Options, M11, M12, M21, M22, MDX, MDY);
  End
  Else
    Result := 0;
End;

Function DLDrawTextBoxMatrixA(InstanceID: Integer; Width, Height: Double; Text: PAnsiChar; Options: Integer; M11, M12, M21, M22, MDX, MDY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawTextBoxMatrix(Width, Height, InstanceList[I].GetWideStringFromAnsi(Text), Options, M11, M12, M21, M22, MDX, MDY);
  End
  Else
    Result := 0;
End;

Function DLDrawWrappedText(InstanceID: Integer; XPos, YPos, Width: Double; Text: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawWrappedText(XPos, YPos, Width, InstanceList[I].GetWideString(Text));
  End
  Else
    Result := 0;
End;

Function DLDrawWrappedTextA(InstanceID: Integer; XPos, YPos, Width: Double; Text: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.DrawWrappedText(XPos, YPos, Width, InstanceList[I].GetWideStringFromAnsi(Text));
  End
  Else
    Result := 0;
End;

Function DLEditableContentStream(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EditableContentStream;
  End
  Else
    Result := 0;
End;

Function DLEmbedFile(InstanceID: Integer; Title, FileName, MIMEType: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EmbedFile(InstanceList[I].GetWideString(Title), InstanceList[I].GetWideString(FileName),
      InstanceList[I].GetWideString(MIMEType));
  End
  Else
    Result := 0;
End;

Function DLEmbedFileA(InstanceID: Integer; Title, FileName, MIMEType: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EmbedFile(InstanceList[I].GetWideStringFromAnsi(Title), InstanceList[I].GetWideStringFromAnsi(FileName),
      InstanceList[I].GetWideStringFromAnsi(MIMEType));
  End
  Else
    Result := 0;
End;

Function DLEmbeddedFileCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EmbeddedFileCount;
  End
  Else
    Result := 0;
End;

Function DLEncapsulateContentStream(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EncapsulateContentStream;
  End
  Else
    Result := 0;
End;

Function DLEncodePermissions(InstanceID, CanPrint, CanCopy, CanChange, CanAddNotes, CanFillFields, CanCopyAccess, CanAssemble, CanPrintFull: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EncodePermissions(CanPrint, CanCopy, CanChange, CanAddNotes, CanFillFields, CanCopyAccess, CanAssemble, CanPrintFull);
  End
  Else
    Result := 0;
End;

Function DLEncrypt(InstanceID: Integer; Owner, User: PWideChar; Strength, Permissions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.Encrypt(InstanceList[I].GetWideString(Owner), InstanceList[I].GetWideString(User), Strength, Permissions);
  End
  Else
    Result := 0;
End;

Function DLEncryptA(InstanceID: Integer; Owner, User: PAnsiChar; Strength, Permissions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.Encrypt(InstanceList[I].GetWideStringFromAnsi(Owner), InstanceList[I].GetWideStringFromAnsi(User), Strength, Permissions);
  End
  Else
    Result := 0;
End;

Function DLEncryptFile(InstanceID: Integer; InputFileName, OutputFileName, Owner, User: PWideChar; Strength, Permissions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EncryptFile(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(OutputFileName),
      InstanceList[I].GetWideString(Owner), InstanceList[I].GetWideString(User), Strength, Permissions);
  End
  Else
    Result := 0;
End;

Function DLEncryptFileA(InstanceID: Integer; InputFileName, OutputFileName, Owner, User: PAnsiChar; Strength, Permissions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EncryptFile(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(OutputFileName),
      InstanceList[I].GetWideStringFromAnsi(Owner), InstanceList[I].GetWideStringFromAnsi(User), Strength, Permissions);
  End
  Else
    Result := 0;
End;

Function DLEncryptWithFingerprint(InstanceID: Integer; Fingerprint: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EncryptWithFingerprint(InstanceList[I].GetWideString(Fingerprint));
  End
  Else
    Result := 0;
End;

Function DLEncryptWithFingerprintA(InstanceID: Integer; Fingerprint: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EncryptWithFingerprint(InstanceList[I].GetWideStringFromAnsi(Fingerprint));
  End
  Else
    Result := 0;
End;

Function DLEncryptionAlgorithm(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EncryptionAlgorithm;
  End
  Else
    Result := 0;
End;

Function DLEncryptionStatus(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EncryptionStatus;
  End
  Else
    Result := 0;
End;

Function DLEncryptionStrength(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EncryptionStrength;
  End
  Else
    Result := 0;
End;

Function DLEndPageUpdate(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EndPageUpdate;
  End
  Else
    Result := 0;
End;

Function DLEndSignProcessToFile(InstanceID, SignProcessID: Integer; OutputFile: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EndSignProcessToFile(SignProcessID, InstanceList[I].GetWideString(OutputFile));
  End
  Else
    Result := 0;
End;

Function DLEndSignProcessToFileA(InstanceID, SignProcessID: Integer; OutputFile: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.EndSignProcessToFile(SignProcessID, InstanceList[I].GetWideStringFromAnsi(OutputFile));
  End
  Else
    Result := 0;
End;

Function DLEndSignProcessToString(InstanceID, SignProcessID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.EndSignProcessToString(SignProcessID);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLExtractFilePageContentToString(InstanceID: Integer; InputFileName, Password: PWideChar; Page: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.ExtractFilePageContentToString(InstanceList[I].GetWideString(InputFileName),
      InstanceList[I].GetWideString(Password), Page);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLExtractFilePageContentToStringA(InstanceID: Integer; InputFileName, Password: PAnsiChar; Page: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.ExtractFilePageContentToString(InstanceList[I].GetWideStringFromAnsi(InputFileName),
      InstanceList[I].GetWideStringFromAnsi(Password), Page);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLExtractFilePageText(InstanceID: Integer; InputFileName, Password: PWideChar; Page, Options: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.ExtractFilePageText(InstanceList[I].GetWideString(InputFileName),
      InstanceList[I].GetWideString(Password), Page, Options);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLExtractFilePageTextA(InstanceID: Integer; InputFileName, Password: PAnsiChar; Page, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.ExtractFilePageText(InstanceList[I].GetWideStringFromAnsi(InputFileName),
      InstanceList[I].GetWideStringFromAnsi(Password), Page, Options);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLExtractFilePageTextBlocks(InstanceID: Integer; InputFileName, Password: PWideChar; Page, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ExtractFilePageTextBlocks(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(Password),
      Page, Options);
  End
  Else
    Result := 0;
End;

Function DLExtractFilePageTextBlocksA(InstanceID: Integer; InputFileName, Password: PAnsiChar; Page, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ExtractFilePageTextBlocks(InstanceList[I].GetWideStringFromAnsi(InputFileName),
      InstanceList[I].GetWideStringFromAnsi(Password), Page, Options);
  End
  Else
    Result := 0;
End;

Function DLExtractFilePages(InstanceID: Integer; InputFileName, Password, OutputFileName, RangeList: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ExtractFilePages(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(Password),
      InstanceList[I].GetWideString(OutputFileName), InstanceList[I].GetWideString(RangeList));
  End
  Else
    Result := 0;
End;

Function DLExtractFilePagesA(InstanceID: Integer; InputFileName, Password, OutputFileName, RangeList: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ExtractFilePages(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(Password),
      InstanceList[I].GetWideStringFromAnsi(OutputFileName), InstanceList[I].GetWideStringFromAnsi(RangeList));
  End
  Else
    Result := 0;
End;

Function DLExtractFilePagesEx(InstanceID: Integer; InputFileName, Password, OutputFileName, RangeList: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ExtractFilePagesEx(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(Password),
      InstanceList[I].GetWideString(OutputFileName), InstanceList[I].GetWideString(RangeList), Options);
  End
  Else
    Result := 0;
End;

Function DLExtractFilePagesExA(InstanceID: Integer; InputFileName, Password, OutputFileName, RangeList: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ExtractFilePagesEx(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(Password),
      InstanceList[I].GetWideStringFromAnsi(OutputFileName), InstanceList[I].GetWideStringFromAnsi(RangeList), Options);
  End
  Else
    Result := 0;
End;

Function DLExtractPageRanges(InstanceID: Integer; RangeList: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ExtractPageRanges(InstanceList[I].GetWideString(RangeList));
  End
  Else
    Result := 0;
End;

Function DLExtractPageRangesA(InstanceID: Integer; RangeList: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ExtractPageRanges(InstanceList[I].GetWideStringFromAnsi(RangeList));
  End
  Else
    Result := 0;
End;

Function DLExtractPageTextBlocks(InstanceID, ExtractOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ExtractPageTextBlocks(ExtractOptions);
  End
  Else
    Result := 0;
End;

Function DLExtractPages(InstanceID, StartPage, PageCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ExtractPages(StartPage, PageCount);
  End
  Else
    Result := 0;
End;

Function DLFileListCount(InstanceID: Integer; ListName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FileListCount(InstanceList[I].GetWideString(ListName));
  End
  Else
    Result := 0;
End;

Function DLFileListCountA(InstanceID: Integer; ListName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FileListCount(InstanceList[I].GetWideStringFromAnsi(ListName));
  End
  Else
    Result := 0;
End;

Function DLFileListItem(InstanceID: Integer; ListName: PWideChar; Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.FileListItem(InstanceList[I].GetWideString(ListName), Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLFileListItemA(InstanceID: Integer; ListName: PAnsiChar; Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.FileListItem(InstanceList[I].GetWideStringFromAnsi(ListName), Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLFindFonts(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FindFonts;
  End
  Else
    Result := 0;
End;

Function DLFindFormFieldByTitle(InstanceID: Integer; Title: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FindFormFieldByTitle(InstanceList[I].GetWideString(Title));
  End
  Else
    Result := 0;
End;

Function DLFindFormFieldByTitleA(InstanceID: Integer; Title: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FindFormFieldByTitle(InstanceList[I].GetWideStringFromAnsi(Title));
  End
  Else
    Result := 0;
End;

Function DLFindImages(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FindImages;
  End
  Else
    Result := 0;
End;

Function DLFitImage(InstanceID: Integer; Left, Top, Width, Height: Double; HAlign, VAlign, Rotate: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FitImage(Left, Top, Width, Height, HAlign, VAlign, Rotate);
  End
  Else
    Result := 0;
End;

Function DLFitRotatedTextBox(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FitRotatedTextBox(Left, Top, Width, Height, Angle, InstanceList[I].GetWideString(Text), Options);
  End
  Else
    Result := 0;
End;

Function DLFitRotatedTextBoxA(InstanceID: Integer; Left, Top, Width, Height, Angle: Double; Text: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FitRotatedTextBox(Left, Top, Width, Height, Angle, InstanceList[I].GetWideStringFromAnsi(Text), Options);
  End
  Else
    Result := 0;
End;

Function DLFitTextBox(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FitTextBox(Left, Top, Width, Height, InstanceList[I].GetWideString(Text), Options);
  End
  Else
    Result := 0;
End;

Function DLFitTextBoxA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FitTextBox(Left, Top, Width, Height, InstanceList[I].GetWideStringFromAnsi(Text), Options);
  End
  Else
    Result := 0;
End;

Function DLFlattenAnnot(InstanceID, Index, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FlattenAnnot(Index, Options);
  End
  Else
    Result := 0;
End;

Function DLFlattenFormField(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FlattenFormField(Index);
  End
  Else
    Result := 0;
End;

Function DLFontCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FontCount;
  End
  Else
    Result := 0;
End;

Function DLFontFamily(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.FontFamily;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLFontFamilyA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.FontFamily;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLFontHasKerning(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FontHasKerning;
  End
  Else
    Result := 0;
End;

Function DLFontName(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.FontName;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLFontNameA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.FontName;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLFontReference(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.FontReference;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLFontReferenceA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.FontReference;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLFontSize(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FontSize;
  End
  Else
    Result := 0;
End;

Function DLFontType(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FontType;
  End
  Else
    Result := 0;
End;

Function DLFormFieldCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FormFieldCount;
  End
  Else
    Result := 0;
End;

Function DLFormFieldHasParent(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FormFieldHasParent(Index);
  End
  Else
    Result := 0;
End;

Function DLFormFieldJavaScriptAction(InstanceID, Index: Integer; ActionType, JavaScript: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FormFieldJavaScriptAction(Index, InstanceList[I].GetWideString(ActionType), InstanceList[I].GetWideString(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLFormFieldJavaScriptActionA(InstanceID, Index: Integer; ActionType, JavaScript: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FormFieldJavaScriptAction(Index, InstanceList[I].GetWideStringFromAnsi(ActionType),
      InstanceList[I].GetWideStringFromAnsi(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLFormFieldWebLinkAction(InstanceID, Index: Integer; ActionType, Link: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FormFieldWebLinkAction(Index, InstanceList[I].GetWideString(ActionType), InstanceList[I].GetWideString(Link));
  End
  Else
    Result := 0;
End;

Function DLFormFieldWebLinkActionA(InstanceID, Index: Integer; ActionType, Link: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.FormFieldWebLinkAction(Index, InstanceList[I].GetWideStringFromAnsi(ActionType),
      InstanceList[I].GetWideStringFromAnsi(Link));
  End
  Else
    Result := 0;
End;

Function DLGetActionDest(InstanceID, ActionID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetActionDest(ActionID);
  End
  Else
    Result := 0;
End;

Function DLGetActionType(InstanceID, ActionID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetActionType(ActionID);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetActionTypeA(InstanceID, ActionID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetActionType(ActionID);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetActionURL(InstanceID, ActionID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetActionURL(ActionID);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetActionURLA(InstanceID, ActionID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetActionURL(ActionID);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetAnalysisInfo(InstanceID, AnalysisID, AnalysisItem: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetAnalysisInfo(AnalysisID, AnalysisItem);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetAnalysisInfoA(InstanceID, AnalysisID, AnalysisItem: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetAnalysisInfo(AnalysisID, AnalysisItem);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetAnnotActionID(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetAnnotActionID(Index);
  End
  Else
    Result := 0;
End;

Function DLGetAnnotDblProperty(InstanceID, Index, Tag: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetAnnotDblProperty(Index, Tag);
  End
  Else
    Result := 0;
End;

Function DLGetAnnotDest(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetAnnotDest(Index);
  End
  Else
    Result := 0;
End;

Function DLGetAnnotEmbeddedFileName(InstanceID, Index, Options: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetAnnotEmbeddedFileName(Index, Options);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetAnnotEmbeddedFileNameA(InstanceID, Index, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetAnnotEmbeddedFileName(Index, Options);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetAnnotEmbeddedFileToFile(InstanceID, Index, Options: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetAnnotEmbeddedFileToFile(Index, Options, InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLGetAnnotEmbeddedFileToFileA(InstanceID, Index, Options: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetAnnotEmbeddedFileToFile(Index, Options, InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLGetAnnotEmbeddedFileToString(InstanceID, Index, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetAnnotEmbeddedFileToString(Index, Options);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetAnnotIntProperty(InstanceID, Index, Tag: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetAnnotIntProperty(Index, Tag);
  End
  Else
    Result := 0;
End;

Function DLGetAnnotQuadCount(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetAnnotQuadCount(Index);
  End
  Else
    Result := 0;
End;

Function DLGetAnnotQuadPoints(InstanceID, Index, QuadNumber, PointNumber: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetAnnotQuadPoints(Index, QuadNumber, PointNumber);
  End
  Else
    Result := 0;
End;

Function DLGetAnnotSoundToFile(InstanceID, Index, Options: Integer; SoundFileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetAnnotSoundToFile(Index, Options, InstanceList[I].GetWideString(SoundFileName));
  End
  Else
    Result := 0;
End;

Function DLGetAnnotSoundToFileA(InstanceID, Index, Options: Integer; SoundFileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetAnnotSoundToFile(Index, Options, InstanceList[I].GetWideStringFromAnsi(SoundFileName));
  End
  Else
    Result := 0;
End;

Function DLGetAnnotSoundToString(InstanceID, Index, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetAnnotSoundToString(Index, Options);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetAnnotStrProperty(InstanceID, Index, Tag: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetAnnotStrProperty(Index, Tag);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetAnnotStrPropertyA(InstanceID, Index, Tag: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetAnnotStrProperty(Index, Tag);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetBarcodeWidth(InstanceID: Integer; NominalWidth: Double; Text: PWideChar; Barcode: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetBarcodeWidth(NominalWidth, InstanceList[I].GetWideString(Text), Barcode);
  End
  Else
    Result := 0;
End;

Function DLGetBarcodeWidthA(InstanceID: Integer; NominalWidth: Double; Text: PAnsiChar; Barcode: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetBarcodeWidth(NominalWidth, InstanceList[I].GetWideStringFromAnsi(Text), Barcode);
  End
  Else
    Result := 0;
End;

Function DLGetBaseURL(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetBaseURL;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetBaseURLA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetBaseURL;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetCSDictEPSG(InstanceID, CSDictID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetCSDictEPSG(CSDictID);
  End
  Else
    Result := 0;
End;

Function DLGetCSDictType(InstanceID, CSDictID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetCSDictType(CSDictID);
  End
  Else
    Result := 0;
End;

Function DLGetCSDictWKT(InstanceID, CSDictID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetCSDictWKT(CSDictID);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetCSDictWKTA(InstanceID, CSDictID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetCSDictWKT(CSDictID);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetCanvasDC(InstanceID, CanvasWidth, CanvasHeight: Integer): HDC;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetCanvasDC(CanvasWidth, CanvasHeight);
  End
  Else
    Result := 0;
End;

Function DLGetCanvasDCEx(InstanceID, CanvasWidth, CanvasHeight, ReferenceDC: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetCanvasDCEx(CanvasWidth, CanvasHeight, ReferenceDC);
  End
  Else
    Result := 0;
End;

Function DLGetCatalogInformation(InstanceID: Integer; Key: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetCatalogInformation(InstanceList[I].GetWideString(Key));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetCatalogInformationA(InstanceID: Integer; Key: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetCatalogInformation(InstanceList[I].GetWideStringFromAnsi(Key));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetContentStreamToString(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetContentStreamToString;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetCustomInformation(InstanceID: Integer; Key: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetCustomInformation(InstanceList[I].GetWideString(Key));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetCustomInformationA(InstanceID: Integer; Key: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetCustomInformation(InstanceList[I].GetWideStringFromAnsi(Key));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetCustomKeys(InstanceID, Location: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetCustomKeys(Location);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetCustomKeysA(InstanceID, Location: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetCustomKeys(Location);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDefaultPrinterName(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDefaultPrinterName;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDefaultPrinterNameA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDefaultPrinterName;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDestName(InstanceID, DestID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDestName(DestID);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDestNameA(InstanceID, DestID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDestName(DestID);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDestPage(InstanceID, DestID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetDestPage(DestID);
  End
  Else
    Result := 0;
End;

Function DLGetDestType(InstanceID, DestID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetDestType(DestID);
  End
  Else
    Result := 0;
End;

Function DLGetDestValue(InstanceID, DestID, ValueKey: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetDestValue(DestID, ValueKey);
  End
  Else
    Result := 0;
End;

Function DLGetDocJavaScript(InstanceID: Integer; ActionType: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDocJavaScript(InstanceList[I].GetWideString(ActionType));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDocJavaScriptA(InstanceID: Integer; ActionType: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDocJavaScript(InstanceList[I].GetWideStringFromAnsi(ActionType));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDocumentFileName(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDocumentFileName;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDocumentFileNameA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDocumentFileName;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDocumentFileSize(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetDocumentFileSize;
  End
  Else
    Result := 0;
End;

Function DLGetDocumentID(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetDocumentID(Index);
  End
  Else
    Result := 0;
End;

Function DLGetDocumentIdentifier(InstanceID, Part, Options: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDocumentIdentifier(Part, Options);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDocumentIdentifierA(InstanceID, Part, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDocumentIdentifier(Part, Options);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDocumentMetadata(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDocumentMetadata;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDocumentMetadataA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDocumentMetadata;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDocumentRepaired(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetDocumentRepaired;
  End
  Else
    Result := 0;
End;

Function DLGetDocumentResourceList(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDocumentResourceList;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetDocumentResourceListA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetDocumentResourceList;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetEmbeddedFileContentToFile(InstanceID, Index: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetEmbeddedFileContentToFile(Index, InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLGetEmbeddedFileContentToFileA(InstanceID, Index: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetEmbeddedFileContentToFile(Index, InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLGetEmbeddedFileContentToString(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetEmbeddedFileContentToString(Index);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetEmbeddedFileID(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetEmbeddedFileID(Index);
  End
  Else
    Result := 0;
End;

Function DLGetEmbeddedFileIntProperty(InstanceID, Index, Tag: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetEmbeddedFileIntProperty(Index, Tag);
  End
  Else
    Result := 0;
End;

Function DLGetEmbeddedFileStrProperty(InstanceID, Index, Tag: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetEmbeddedFileStrProperty(Index, Tag);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetEmbeddedFileStrPropertyA(InstanceID, Index, Tag: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetEmbeddedFileStrProperty(Index, Tag);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetEncryptionFingerprint(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetEncryptionFingerprint;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetEncryptionFingerprintA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetEncryptionFingerprint;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFileMetadata(InstanceID: Integer; InputFileName, Password: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFileMetadata(InstanceList[I].GetWideString(InputFileName),
      InstanceList[I].GetWideString(Password));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFileMetadataA(InstanceID: Integer; InputFileName, Password: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFileMetadata(InstanceList[I].GetWideStringFromAnsi(InputFileName),
      InstanceList[I].GetWideStringFromAnsi(Password));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFirstChildOutline(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFirstChildOutline(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLGetFirstOutline(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFirstOutline;
  End
  Else
    Result := 0;
End;

Function DLGetFontEncoding(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFontEncoding;
  End
  Else
    Result := 0;
End;

Function DLGetFontFlags(InstanceID, FontFlagItemID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFontFlags(FontFlagItemID);
  End
  Else
    Result := 0;
End;

Function DLGetFontID(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFontID(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFontIsEmbedded(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFontIsEmbedded;
  End
  Else
    Result := 0;
End;

Function DLGetFontIsSubsetted(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFontIsSubsetted;
  End
  Else
    Result := 0;
End;

Function DLGetFontMetrics(InstanceID, MetricType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFontMetrics(MetricType);
  End
  Else
    Result := 0;
End;

Function DLGetFontObjectNumber(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFontObjectNumber;
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldActionID(InstanceID, Index: Integer; TriggerEvent: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldActionID(Index, InstanceList[I].GetWideString(TriggerEvent));
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldActionIDA(InstanceID, Index: Integer; TriggerEvent: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldActionID(Index, InstanceList[I].GetWideStringFromAnsi(TriggerEvent));
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldAlignment(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldAlignment(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldAnnotFlags(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldAnnotFlags(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldBackgroundColor(InstanceID, Index, ColorComponent: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldBackgroundColor(Index, ColorComponent);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldBackgroundColorType(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldBackgroundColorType(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldBorderColor(InstanceID, Index, ColorComponent: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldBorderColor(Index, ColorComponent);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldBorderColorType(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldBorderColorType(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldBorderProperty(InstanceID, Index, PropKey: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldBorderProperty(Index, PropKey);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldBorderStyle(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldBorderStyle(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldBound(InstanceID, Index, Edge: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldBound(Index, Edge);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldCaption(InstanceID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldCaption(Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldCaptionA(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldCaption(Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldCaptionEx(InstanceID, Index, StringType: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldCaptionEx(Index, StringType);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldCaptionExA(InstanceID, Index, StringType: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldCaptionEx(Index, StringType);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldCheckStyle(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldCheckStyle(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldChildTitle(InstanceID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldChildTitle(Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldChildTitleA(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldChildTitle(Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldChoiceType(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldChoiceType(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldColor(InstanceID, Index, ColorComponent: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldColor(Index, ColorComponent);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldComb(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldComb(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldDefaultValue(InstanceID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldDefaultValue(Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldDefaultValueA(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldDefaultValue(Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldDescription(InstanceID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldDescription(Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldDescriptionA(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldDescription(Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldFlags(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldFlags(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldFontName(InstanceID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldFontName(Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldFontNameA(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldFontName(Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldJavaScript(InstanceID, Index: Integer; ActionType: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldJavaScript(Index, InstanceList[I].GetWideString(ActionType));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldJavaScriptA(InstanceID, Index: Integer; ActionType: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldJavaScript(Index, InstanceList[I].GetWideStringFromAnsi(ActionType));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldKidCount(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldKidCount(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldKidTempIndex(InstanceID, Index, SubIndex: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldKidTempIndex(Index, SubIndex);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldMaxLen(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldMaxLen(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldNoExport(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldNoExport(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldPage(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldPage(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldPrintable(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldPrintable(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldReadOnly(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldReadOnly(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldRequired(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldRequired(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldRichTextString(InstanceID, Index: Integer; Key: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldRichTextString(Index, InstanceList[I].GetWideString(Key));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldRichTextStringA(InstanceID, Index: Integer; Key: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldRichTextString(Index, InstanceList[I].GetWideStringFromAnsi(Key));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldRotation(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldRotation(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldSubCount(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldSubCount(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldSubDisplayName(InstanceID, Index, SubIndex: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldSubDisplayName(Index, SubIndex);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldSubDisplayNameA(InstanceID, Index, SubIndex: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldSubDisplayName(Index, SubIndex);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldSubName(InstanceID, Index, SubIndex: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldSubName(Index, SubIndex);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldSubNameA(InstanceID, Index, SubIndex: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldSubName(Index, SubIndex);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldSubmitActionString(InstanceID, Index: Integer; ActionType: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldSubmitActionString(Index, InstanceList[I].GetWideString(ActionType));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldSubmitActionStringA(InstanceID, Index: Integer; ActionType: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldSubmitActionString(Index, InstanceList[I].GetWideStringFromAnsi(ActionType));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldTabOrder(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldTabOrder(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldTabOrderEx(InstanceID, Index, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldTabOrderEx(Index, Options);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldTextFlags(InstanceID, Index, ValueKey: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldTextFlags(Index, ValueKey);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldTextSize(InstanceID, Index: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldTextSize(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldTitle(InstanceID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldTitle(Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldTitleA(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldTitle(Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldType(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldType(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldValue(InstanceID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldValue(Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldValueA(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldValue(Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldValueByTitle(InstanceID: Integer; Title: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldValueByTitle(InstanceList[I].GetWideString(Title));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldValueByTitleA(InstanceID: Integer; Title: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldValueByTitle(InstanceList[I].GetWideStringFromAnsi(Title));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldVisible(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFieldVisible(Index);
  End
  Else
    Result := 0;
End;

Function DLGetFormFieldWebLink(InstanceID, Index: Integer; ActionType: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldWebLink(Index, InstanceList[I].GetWideString(ActionType));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFieldWebLinkA(InstanceID, Index: Integer; ActionType: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFieldWebLink(Index, InstanceList[I].GetWideStringFromAnsi(ActionType));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFontCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetFormFontCount;
  End
  Else
    Result := 0;
End;

Function DLGetFormFontName(InstanceID, FontIndex: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFontName(FontIndex);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetFormFontNameA(InstanceID, FontIndex: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetFormFontName(FontIndex);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetGlobalJavaScript(InstanceID: Integer; PackageName: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetGlobalJavaScript(InstanceList[I].GetWideString(PackageName));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetGlobalJavaScriptA(InstanceID: Integer; PackageName: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetGlobalJavaScript(InstanceList[I].GetWideStringFromAnsi(PackageName));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetHTMLTextHeight(InstanceID: Integer; Width: Double; HTMLText: PWideChar): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetHTMLTextHeight(Width, InstanceList[I].GetWideString(HTMLText));
  End
  Else
    Result := 0;
End;

Function DLGetHTMLTextHeightA(InstanceID: Integer; Width: Double; HTMLText: PAnsiChar): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetHTMLTextHeight(Width, InstanceList[I].GetWideStringFromAnsi(HTMLText));
  End
  Else
    Result := 0;
End;

Function DLGetHTMLTextLineCount(InstanceID: Integer; Width: Double; HTMLText: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetHTMLTextLineCount(Width, InstanceList[I].GetWideString(HTMLText));
  End
  Else
    Result := 0;
End;

Function DLGetHTMLTextLineCountA(InstanceID: Integer; Width: Double; HTMLText: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetHTMLTextLineCount(Width, InstanceList[I].GetWideStringFromAnsi(HTMLText));
  End
  Else
    Result := 0;
End;

Function DLGetHTMLTextWidth(InstanceID: Integer; MaxWidth: Double; HTMLText: PWideChar): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetHTMLTextWidth(MaxWidth, InstanceList[I].GetWideString(HTMLText));
  End
  Else
    Result := 0;
End;

Function DLGetHTMLTextWidthA(InstanceID: Integer; MaxWidth: Double; HTMLText: PAnsiChar): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetHTMLTextWidth(MaxWidth, InstanceList[I].GetWideStringFromAnsi(HTMLText));
  End
  Else
    Result := 0;
End;

Function DLGetImageID(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetImageID(Index);
  End
  Else
    Result := 0;
End;

Function DLGetImageListCount(InstanceID, ImageListID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetImageListCount(ImageListID);
  End
  Else
    Result := 0;
End;

Function DLGetImageListItemDataToString(InstanceID, ImageListID, ImageIndex, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetImageListItemDataToString(ImageListID, ImageIndex, Options);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetImageListItemDblProperty(InstanceID, ImageListID, ImageIndex, PropertyID: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetImageListItemDblProperty(ImageListID, ImageIndex, PropertyID);
  End
  Else
    Result := 0;
End;

Function DLGetImageListItemFormatDesc(InstanceID, ImageListID, ImageIndex, Options: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetImageListItemFormatDesc(ImageListID, ImageIndex, Options);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetImageListItemFormatDescA(InstanceID, ImageListID, ImageIndex, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetImageListItemFormatDesc(ImageListID, ImageIndex, Options);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetImageListItemIntProperty(InstanceID, ImageListID, ImageIndex, PropertyID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetImageListItemIntProperty(ImageListID, ImageIndex, PropertyID);
  End
  Else
    Result := 0;
End;

Function DLGetImageMeasureDict(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetImageMeasureDict;
  End
  Else
    Result := 0;
End;

Function DLGetImagePageCount(InstanceID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetImagePageCount(InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLGetImagePageCountA(InstanceID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetImagePageCount(InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLGetImagePageCountFromString(InstanceID: Integer; Source: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetImagePageCountFromString(InstanceList[I].GetString(Source));
  End
  Else
    Result := 0;
End;

Function DLGetImagePtDataDict(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetImagePtDataDict;
  End
  Else
    Result := 0;
End;

Function DLGetInformation(InstanceID, Key: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetInformation(Key);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetInformationA(InstanceID, Key: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetInformation(Key);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetInstalledFontsByCharset(InstanceID, CharsetIndex, Options: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetInstalledFontsByCharset(CharsetIndex, Options);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetInstalledFontsByCharsetA(InstanceID, CharsetIndex, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetInstalledFontsByCharset(CharsetIndex, Options);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetInstalledFontsByCodePage(InstanceID, CodePage, Options: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetInstalledFontsByCodePage(CodePage, Options);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetInstalledFontsByCodePageA(InstanceID, CodePage, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetInstalledFontsByCodePage(CodePage, Options);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetKerning(InstanceID: Integer; CharPair: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetKerning(InstanceList[I].GetWideString(CharPair));
  End
  Else
    Result := 0;
End;

Function DLGetKerningA(InstanceID: Integer; CharPair: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetKerning(InstanceList[I].GetWideStringFromAnsi(CharPair));
  End
  Else
    Result := 0;
End;

Function DLGetLatestPrinterNames(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetLatestPrinterNames;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetLatestPrinterNamesA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetLatestPrinterNames;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetMaxObjectNumber(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMaxObjectNumber;
  End
  Else
    Result := 0;
End;

Function DLGetMeasureDictBoundsCount(InstanceID, MeasureDictID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMeasureDictBoundsCount(MeasureDictID);
  End
  Else
    Result := 0;
End;

Function DLGetMeasureDictBoundsItem(InstanceID, MeasureDictID, ItemIndex: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMeasureDictBoundsItem(MeasureDictID, ItemIndex);
  End
  Else
    Result := 0;
End;

Function DLGetMeasureDictCoordinateSystem(InstanceID, MeasureDictID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMeasureDictCoordinateSystem(MeasureDictID);
  End
  Else
    Result := 0;
End;

Function DLGetMeasureDictDCSDict(InstanceID, MeasureDictID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMeasureDictDCSDict(MeasureDictID);
  End
  Else
    Result := 0;
End;

Function DLGetMeasureDictGCSDict(InstanceID, MeasureDictID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMeasureDictGCSDict(MeasureDictID);
  End
  Else
    Result := 0;
End;

Function DLGetMeasureDictGPTSCount(InstanceID, MeasureDictID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMeasureDictGPTSCount(MeasureDictID);
  End
  Else
    Result := 0;
End;

Function DLGetMeasureDictGPTSItem(InstanceID, MeasureDictID, ItemIndex: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMeasureDictGPTSItem(MeasureDictID, ItemIndex);
  End
  Else
    Result := 0;
End;

Function DLGetMeasureDictLPTSCount(InstanceID, MeasureDictID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMeasureDictLPTSCount(MeasureDictID);
  End
  Else
    Result := 0;
End;

Function DLGetMeasureDictLPTSItem(InstanceID, MeasureDictID, ItemIndex: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMeasureDictLPTSItem(MeasureDictID, ItemIndex);
  End
  Else
    Result := 0;
End;

Function DLGetMeasureDictPDU(InstanceID, MeasureDictID, UnitIndex: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetMeasureDictPDU(MeasureDictID, UnitIndex);
  End
  Else
    Result := 0;
End;

Function DLGetNamedDestination(InstanceID: Integer; DestName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetNamedDestination(InstanceList[I].GetWideString(DestName));
  End
  Else
    Result := 0;
End;

Function DLGetNamedDestinationA(InstanceID: Integer; DestName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetNamedDestination(InstanceList[I].GetWideStringFromAnsi(DestName));
  End
  Else
    Result := 0;
End;

Function DLGetNextOutline(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetNextOutline(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLGetObjectCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetObjectCount;
  End
  Else
    Result := 0;
End;

Function DLGetObjectDecodeError(InstanceID, ObjectNumber: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetObjectDecodeError(ObjectNumber);
  End
  Else
    Result := 0;
End;

Function DLGetObjectToString(InstanceID, ObjectNumber: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetObjectToString(ObjectNumber);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOpenActionDestination(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOpenActionDestination;
  End
  Else
    Result := 0;
End;

Function DLGetOpenActionJavaScript(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOpenActionJavaScript;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOpenActionJavaScriptA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOpenActionJavaScript;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOptionalContentConfigCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOptionalContentConfigCount;
  End
  Else
    Result := 0;
End;

Function DLGetOptionalContentConfigLocked(InstanceID, OptionalContentConfigID, OptionalContentGroupID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOptionalContentConfigLocked(OptionalContentConfigID, OptionalContentGroupID);
  End
  Else
    Result := 0;
End;

Function DLGetOptionalContentConfigOrderCount(InstanceID, OptionalContentConfigID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOptionalContentConfigOrderCount(OptionalContentConfigID);
  End
  Else
    Result := 0;
End;

Function DLGetOptionalContentConfigOrderItemID(InstanceID, OptionalContentConfigID, ItemIndex: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOptionalContentConfigOrderItemID(OptionalContentConfigID, ItemIndex);
  End
  Else
    Result := 0;
End;

Function DLGetOptionalContentConfigOrderItemLabel(InstanceID, OptionalContentConfigID, ItemIndex: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOptionalContentConfigOrderItemLabel(OptionalContentConfigID, ItemIndex);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOptionalContentConfigOrderItemLabelA(InstanceID, OptionalContentConfigID, ItemIndex: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOptionalContentConfigOrderItemLabel(OptionalContentConfigID, ItemIndex);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOptionalContentConfigOrderItemLevel(InstanceID, OptionalContentConfigID, ItemIndex: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOptionalContentConfigOrderItemLevel(OptionalContentConfigID, ItemIndex);
  End
  Else
    Result := 0;
End;

Function DLGetOptionalContentConfigOrderItemType(InstanceID, OptionalContentConfigID, ItemIndex: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOptionalContentConfigOrderItemType(OptionalContentConfigID, ItemIndex);
  End
  Else
    Result := 0;
End;

Function DLGetOptionalContentConfigState(InstanceID, OptionalContentConfigID, OptionalContentGroupID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOptionalContentConfigState(OptionalContentConfigID, OptionalContentGroupID);
  End
  Else
    Result := 0;
End;

Function DLGetOptionalContentGroupID(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOptionalContentGroupID(Index);
  End
  Else
    Result := 0;
End;

Function DLGetOptionalContentGroupName(InstanceID, OptionalContentGroupID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOptionalContentGroupName(OptionalContentGroupID);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOptionalContentGroupNameA(InstanceID, OptionalContentGroupID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOptionalContentGroupName(OptionalContentGroupID);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOptionalContentGroupPrintable(InstanceID, OptionalContentGroupID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOptionalContentGroupPrintable(OptionalContentGroupID);
  End
  Else
    Result := 0;
End;

Function DLGetOptionalContentGroupVisible(InstanceID, OptionalContentGroupID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOptionalContentGroupVisible(OptionalContentGroupID);
  End
  Else
    Result := 0;
End;

Function DLGetOrigin(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOrigin;
  End
  Else
    Result := 0;
End;

Function DLGetOutlineActionID(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOutlineActionID(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLGetOutlineColor(InstanceID, OutlineID, ColorComponent: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOutlineColor(OutlineID, ColorComponent);
  End
  Else
    Result := 0;
End;

Function DLGetOutlineDest(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOutlineDest(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLGetOutlineID(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOutlineID(Index);
  End
  Else
    Result := 0;
End;

Function DLGetOutlineJavaScript(InstanceID, OutlineID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOutlineJavaScript(OutlineID);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOutlineJavaScriptA(InstanceID, OutlineID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOutlineJavaScript(OutlineID);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOutlineObjectNumber(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOutlineObjectNumber(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLGetOutlineOpenFile(InstanceID, OutlineID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOutlineOpenFile(OutlineID);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOutlineOpenFileA(InstanceID, OutlineID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOutlineOpenFile(OutlineID);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOutlinePage(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOutlinePage(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLGetOutlineStyle(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetOutlineStyle(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLGetOutlineWebLink(InstanceID, OutlineID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOutlineWebLink(OutlineID);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetOutlineWebLinkA(InstanceID, OutlineID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetOutlineWebLink(OutlineID);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageBox(InstanceID, BoxType, Dimension: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetPageBox(BoxType, Dimension);
  End
  Else
    Result := 0;
End;

Function DLGetPageColorSpaces(InstanceID, Options: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPageColorSpaces(Options);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageColorSpacesA(InstanceID, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPageColorSpaces(Options);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageContentToString(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetPageContentToString;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageImageList(InstanceID, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetPageImageList(Options);
  End
  Else
    Result := 0;
End;

Function DLGetPageJavaScript(InstanceID: Integer; ActionType: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPageJavaScript(InstanceList[I].GetWideString(ActionType));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageJavaScriptA(InstanceID: Integer; ActionType: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPageJavaScript(InstanceList[I].GetWideStringFromAnsi(ActionType));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageLGIDictContent(InstanceID, DictIndex: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPageLGIDictContent(DictIndex);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageLGIDictContentA(InstanceID, DictIndex: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPageLGIDictContent(DictIndex);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageLGIDictCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetPageLGIDictCount;
  End
  Else
    Result := 0;
End;

Function DLGetPageLabel(InstanceID, Page: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPageLabel(Page);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageLabelA(InstanceID, Page: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPageLabel(Page);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageLayout(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetPageLayout;
  End
  Else
    Result := 0;
End;

Function DLGetPageMetricsToString(InstanceID, StartPage, EndPage, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetPageMetricsToString(StartPage, EndPage, Options);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageMode(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetPageMode;
  End
  Else
    Result := 0;
End;

Function DLGetPageText(InstanceID, ExtractOptions: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPageText(ExtractOptions);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageTextA(InstanceID, ExtractOptions: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPageText(ExtractOptions);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPageUserUnit(InstanceID: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetPageUserUnit;
  End
  Else
    Result := 0;
End;

Function DLGetPageViewPortCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetPageViewPortCount;
  End
  Else
    Result := 0;
End;

Function DLGetPageViewPortID(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetPageViewPortID(Index);
  End
  Else
    Result := 0;
End;

Function DLGetParentOutline(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetParentOutline(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLGetPrevOutline(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetPrevOutline(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLGetPrintPreviewBitmapToString(InstanceID: Integer; PrinterName: PWideChar; PreviewPage, PrintOptions, MaxDimension, PreviewOptions: Integer)
  : PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetPrintPreviewBitmapToString(InstanceList[I].GetWideString(PrinterName), PreviewPage, PrintOptions,
      MaxDimension, PreviewOptions);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPrintPreviewBitmapToStringA(InstanceID: Integer; PrinterName: PAnsiChar; PreviewPage, PrintOptions, MaxDimension, PreviewOptions: Integer)
  : PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetPrintPreviewBitmapToString(InstanceList[I].GetWideStringFromAnsi(PrinterName), PreviewPage,
      PrintOptions, MaxDimension, PreviewOptions);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPrinterBins(InstanceID: Integer; PrinterName: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPrinterBins(InstanceList[I].GetWideString(PrinterName));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPrinterBinsA(InstanceID: Integer; PrinterName: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPrinterBins(InstanceList[I].GetWideStringFromAnsi(PrinterName));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPrinterDevModeToString(InstanceID: Integer; PrinterName: PWideChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetPrinterDevModeToString(InstanceList[I].GetWideString(PrinterName));
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPrinterDevModeToStringA(InstanceID: Integer; PrinterName: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetPrinterDevModeToString(InstanceList[I].GetWideStringFromAnsi(PrinterName));
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPrinterMediaTypes(InstanceID: Integer; PrinterName: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPrinterMediaTypes(InstanceList[I].GetWideString(PrinterName));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPrinterMediaTypesA(InstanceID: Integer; PrinterName: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPrinterMediaTypes(InstanceList[I].GetWideStringFromAnsi(PrinterName));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPrinterNames(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPrinterNames;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetPrinterNamesA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetPrinterNames;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetRenderScale(InstanceID: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetRenderScale;
  End
  Else
    Result := 0;
End;

Function DLGetSignProcessByteRange(InstanceID, SignProcessID, ArrayPosition: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetSignProcessByteRange(SignProcessID, ArrayPosition);
  End
  Else
    Result := 0;
End;

Function DLGetSignProcessResult(InstanceID, SignProcessID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetSignProcessResult(SignProcessID);
  End
  Else
    Result := 0;
End;

Function DLGetStringListCount(InstanceID, StringListID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetStringListCount(StringListID);
  End
  Else
    Result := 0;
End;

Function DLGetStringListItem(InstanceID, StringListID, ItemIndex: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetStringListItem(StringListID, ItemIndex);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetStringListItemA(InstanceID, StringListID, ItemIndex: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetStringListItem(StringListID, ItemIndex);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTabOrderMode(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTabOrderMode;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTabOrderModeA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTabOrderMode;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTableCellDblProperty(InstanceID, TableID, RowNumber, ColumnNumber, Tag: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTableCellDblProperty(TableID, RowNumber, ColumnNumber, Tag);
  End
  Else
    Result := 0;
End;

Function DLGetTableCellIntProperty(InstanceID, TableID, RowNumber, ColumnNumber, Tag: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTableCellIntProperty(TableID, RowNumber, ColumnNumber, Tag);
  End
  Else
    Result := 0;
End;

Function DLGetTableCellStrProperty(InstanceID, TableID, RowNumber, ColumnNumber, Tag: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTableCellStrProperty(TableID, RowNumber, ColumnNumber, Tag);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTableCellStrPropertyA(InstanceID, TableID, RowNumber, ColumnNumber, Tag: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTableCellStrProperty(TableID, RowNumber, ColumnNumber, Tag);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTableColumnCount(InstanceID, TableID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTableColumnCount(TableID);
  End
  Else
    Result := 0;
End;

Function DLGetTableLastDrawnRow(InstanceID, TableID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTableLastDrawnRow(TableID);
  End
  Else
    Result := 0;
End;

Function DLGetTableRowCount(InstanceID, TableID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTableRowCount(TableID);
  End
  Else
    Result := 0;
End;

Function DLGetTempPath(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTempPath;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTempPathA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTempPath;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTextAscent(InstanceID: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextAscent;
  End
  Else
    Result := 0;
End;

Function DLGetTextBlockAsString(InstanceID, TextBlockListID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTextBlockAsString(TextBlockListID, Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTextBlockAsStringA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTextBlockAsString(TextBlockListID, Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTextBlockBound(InstanceID, TextBlockListID, Index, BoundIndex: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextBlockBound(TextBlockListID, Index, BoundIndex);
  End
  Else
    Result := 0;
End;

Function DLGetTextBlockCharWidth(InstanceID, TextBlockListID, Index, CharIndex: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextBlockCharWidth(TextBlockListID, Index, CharIndex);
  End
  Else
    Result := 0;
End;

Function DLGetTextBlockColor(InstanceID, TextBlockListID, Index, ColorComponent: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextBlockColor(TextBlockListID, Index, ColorComponent);
  End
  Else
    Result := 0;
End;

Function DLGetTextBlockColorType(InstanceID, TextBlockListID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextBlockColorType(TextBlockListID, Index);
  End
  Else
    Result := 0;
End;

Function DLGetTextBlockCount(InstanceID, TextBlockListID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextBlockCount(TextBlockListID);
  End
  Else
    Result := 0;
End;

Function DLGetTextBlockFontName(InstanceID, TextBlockListID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTextBlockFontName(TextBlockListID, Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTextBlockFontNameA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTextBlockFontName(TextBlockListID, Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTextBlockFontSize(InstanceID, TextBlockListID, Index: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextBlockFontSize(TextBlockListID, Index);
  End
  Else
    Result := 0;
End;

Function DLGetTextBlockText(InstanceID, TextBlockListID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTextBlockText(TextBlockListID, Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTextBlockTextA(InstanceID, TextBlockListID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetTextBlockText(TextBlockListID, Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetTextBound(InstanceID, Edge: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextBound(Edge);
  End
  Else
    Result := 0;
End;

Function DLGetTextDescent(InstanceID: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextDescent;
  End
  Else
    Result := 0;
End;

Function DLGetTextHeight(InstanceID: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextHeight;
  End
  Else
    Result := 0;
End;

Function DLGetTextSize(InstanceID: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextSize;
  End
  Else
    Result := 0;
End;

Function DLGetTextWidth(InstanceID: Integer; Text: PWideChar): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextWidth(InstanceList[I].GetWideString(Text));
  End
  Else
    Result := 0;
End;

Function DLGetTextWidthA(InstanceID: Integer; Text: PAnsiChar): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetTextWidth(InstanceList[I].GetWideStringFromAnsi(Text));
  End
  Else
    Result := 0;
End;

Function DLGetUnicodeCharactersFromEncoding(InstanceID, Encoding: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetUnicodeCharactersFromEncoding(Encoding);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetUnicodeCharactersFromEncodingA(InstanceID, Encoding: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetUnicodeCharactersFromEncoding(Encoding);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetViewPortBBox(InstanceID, ViewPortID, Dimension: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetViewPortBBox(ViewPortID, Dimension);
  End
  Else
    Result := 0;
End;

Function DLGetViewPortMeasureDict(InstanceID, ViewPortID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetViewPortMeasureDict(ViewPortID);
  End
  Else
    Result := 0;
End;

Function DLGetViewPortName(InstanceID, ViewPortID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetViewPortName(ViewPortID);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetViewPortNameA(InstanceID, ViewPortID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetViewPortName(ViewPortID);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetViewPortPtDataDict(InstanceID, ViewPortID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetViewPortPtDataDict(ViewPortID);
  End
  Else
    Result := 0;
End;

Function DLGetViewerPreferences(InstanceID, Option: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetViewerPreferences(Option);
  End
  Else
    Result := 0;
End;

Function DLGetWrappedText(InstanceID: Integer; Width: Double; Delimiter, Text: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetWrappedText(Width, InstanceList[I].GetWideString(Delimiter),
      InstanceList[I].GetWideString(Text));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetWrappedTextA(InstanceID: Integer; Width: Double; Delimiter, Text: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetWrappedText(Width, InstanceList[I].GetWideStringFromAnsi(Delimiter),
      InstanceList[I].GetWideStringFromAnsi(Text));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetWrappedTextBreakString(InstanceID: Integer; Width: Double; Delimiter, Text: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetWrappedTextBreakString(Width, InstanceList[I].GetWideString(Delimiter),
      InstanceList[I].GetWideString(Text));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetWrappedTextBreakStringA(InstanceID: Integer; Width: Double; Delimiter, Text: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetWrappedTextBreakString(Width, InstanceList[I].GetWideStringFromAnsi(Delimiter),
      InstanceList[I].GetWideStringFromAnsi(Text));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetWrappedTextHeight(InstanceID: Integer; Width: Double; Text: PWideChar): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetWrappedTextHeight(Width, InstanceList[I].GetWideString(Text));
  End
  Else
    Result := 0;
End;

Function DLGetWrappedTextHeightA(InstanceID: Integer; Width: Double; Text: PAnsiChar): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetWrappedTextHeight(Width, InstanceList[I].GetWideStringFromAnsi(Text));
  End
  Else
    Result := 0;
End;

Function DLGetWrappedTextLineCount(InstanceID: Integer; Width: Double; Text: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetWrappedTextLineCount(Width, InstanceList[I].GetWideString(Text));
  End
  Else
    Result := 0;
End;

Function DLGetWrappedTextLineCountA(InstanceID: Integer; Width: Double; Text: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetWrappedTextLineCount(Width, InstanceList[I].GetWideStringFromAnsi(Text));
  End
  Else
    Result := 0;
End;

Function DLGetXFAFormFieldCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GetXFAFormFieldCount;
  End
  Else
    Result := 0;
End;

Function DLGetXFAFormFieldName(InstanceID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetXFAFormFieldName(Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetXFAFormFieldNameA(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetXFAFormFieldName(Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetXFAFormFieldNames(InstanceID: Integer; Delimiter: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetXFAFormFieldNames(InstanceList[I].GetWideString(Delimiter));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetXFAFormFieldNamesA(InstanceID: Integer; Delimiter: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetXFAFormFieldNames(InstanceList[I].GetWideStringFromAnsi(Delimiter));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetXFAFormFieldValue(InstanceID: Integer; XFAFieldName: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetXFAFormFieldValue(InstanceList[I].GetWideString(XFAFieldName));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetXFAFormFieldValueA(InstanceID: Integer; XFAFieldName: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GetXFAFormFieldValue(InstanceList[I].GetWideStringFromAnsi(XFAFieldName));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGetXFAToString(InstanceID, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.GetXFAToString(Options);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGlobalJavaScriptCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.GlobalJavaScriptCount;
  End
  Else
    Result := 0;
End;

Function DLGlobalJavaScriptPackageName(InstanceID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GlobalJavaScriptPackageName(Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLGlobalJavaScriptPackageNameA(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.GlobalJavaScriptPackageName(Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLHasFontResources(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.HasFontResources;
  End
  Else
    Result := 0;
End;

Function DLHasPageBox(InstanceID, BoxType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.HasPageBox(BoxType);
  End
  Else
    Result := 0;
End;

Function DLHidePage(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.HidePage;
  End
  Else
    Result := 0;
End;

Function DLImageCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ImageCount;
  End
  Else
    Result := 0;
End;

Function DLImageFillColor(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ImageFillColor;
  End
  Else
    Result := 0;
End;

Function DLImageHeight(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ImageHeight;
  End
  Else
    Result := 0;
End;

Function DLImageHorizontalResolution(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ImageHorizontalResolution;
  End
  Else
    Result := 0;
End;

Function DLImageResolutionUnits(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ImageResolutionUnits;
  End
  Else
    Result := 0;
End;

Function DLImageType(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ImageType;
  End
  Else
    Result := 0;
End;

Function DLImageVerticalResolution(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ImageVerticalResolution;
  End
  Else
    Result := 0;
End;

Function DLImageWidth(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ImageWidth;
  End
  Else
    Result := 0;
End;

Function DLImportEMFFromFile(InstanceID: Integer; FileName: PWideChar; FontOptions, GeneralOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ImportEMFFromFile(InstanceList[I].GetWideString(FileName), FontOptions, GeneralOptions);
  End
  Else
    Result := 0;
End;

Function DLImportEMFFromFileA(InstanceID: Integer; FileName: PAnsiChar; FontOptions, GeneralOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ImportEMFFromFile(InstanceList[I].GetWideStringFromAnsi(FileName), FontOptions, GeneralOptions);
  End
  Else
    Result := 0;
End;

Function DLInsertPages(InstanceID, StartPage, PageCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.InsertPages(StartPage, PageCount);
  End
  Else
    Result := 0;
End;

Function DLInsertTableColumns(InstanceID, TableID, Position, NewColumnCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.InsertTableColumns(TableID, Position, NewColumnCount);
  End
  Else
    Result := 0;
End;

Function DLInsertTableRows(InstanceID, TableID, Position, NewRowCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.InsertTableRows(TableID, Position, NewRowCount);
  End
  Else
    Result := 0;
End;

Function DLIsAnnotFormField(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.IsAnnotFormField(Index);
  End
  Else
    Result := 0;
End;

Function DLIsLinearized(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.IsLinearized;
  End
  Else
    Result := 0;
End;

Function DLIsTaggedPDF(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.IsTaggedPDF;
  End
  Else
    Result := 0;
End;

Function DLLastErrorCode(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.LastErrorCode;
  End
  Else
    Result := 0;
End;

Function DLLastRenderError(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.LastRenderError;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLLastRenderErrorA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.LastRenderError;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLLibraryVersion(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.LibraryVersion;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLLibraryVersionA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.LibraryVersion;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLLibraryVersionEx(InstanceID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.LibraryVersionEx;
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLLibraryVersionExA(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.LibraryVersionEx;
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLLinearizeFile(InstanceID: Integer; InputFileName, Password, OutputFileName: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.LinearizeFile(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(Password),
      InstanceList[I].GetWideString(OutputFileName), Options);
  End
  Else
    Result := 0;
End;

Function DLLinearizeFileA(InstanceID: Integer; InputFileName, Password, OutputFileName: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.LinearizeFile(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(Password),
      InstanceList[I].GetWideStringFromAnsi(OutputFileName), Options);
  End
  Else
    Result := 0;
End;

Function DLLoadFromCanvasDC(InstanceID: Integer; DPI: Double; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.LoadFromCanvasDC(DPI, Options);
  End
  Else
    Result := 0;
End;

Function DLLoadFromFile(InstanceID: Integer; FileName, Password: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.LoadFromFile(InstanceList[I].GetWideString(FileName), InstanceList[I].GetWideString(Password));
  End
  Else
    Result := 0;
End;

Function DLLoadFromFileA(InstanceID: Integer; FileName, Password: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.LoadFromFile(InstanceList[I].GetWideStringFromAnsi(FileName), InstanceList[I].GetWideStringFromAnsi(Password));
  End
  Else
    Result := 0;
End;

Function DLLoadFromString(InstanceID: Integer; Source: PAnsiChar; Password: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.LoadFromString(InstanceList[I].GetString(Source), InstanceList[I].GetWideString(Password));
  End
  Else
    Result := 0;
End;

Function DLLoadFromStringA(InstanceID: Integer; Source: PAnsiChar; Password: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.LoadFromString(InstanceList[I].GetString(Source), InstanceList[I].GetWideStringFromAnsi(Password));
  End
  Else
    Result := 0;
End;

Function DLLoadState(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.LoadState;
  End
  Else
    Result := 0;
End;

Function DLMergeDocument(InstanceID, DocumentID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MergeDocument(DocumentID);
  End
  Else
    Result := 0;
End;

Function DLMergeFileList(InstanceID: Integer; ListName, OutputFileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MergeFileList(InstanceList[I].GetWideString(ListName), InstanceList[I].GetWideString(OutputFileName));
  End
  Else
    Result := 0;
End;

Function DLMergeFileListA(InstanceID: Integer; ListName, OutputFileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MergeFileList(InstanceList[I].GetWideStringFromAnsi(ListName), InstanceList[I].GetWideStringFromAnsi(OutputFileName));
  End
  Else
    Result := 0;
End;

Function DLMergeFileListFast(InstanceID: Integer; ListName, OutputFileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MergeFileListFast(InstanceList[I].GetWideString(ListName), InstanceList[I].GetWideString(OutputFileName));
  End
  Else
    Result := 0;
End;

Function DLMergeFileListFastA(InstanceID: Integer; ListName, OutputFileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MergeFileListFast(InstanceList[I].GetWideStringFromAnsi(ListName), InstanceList[I].GetWideStringFromAnsi(OutputFileName));
  End
  Else
    Result := 0;
End;

Function DLMergeFiles(InstanceID: Integer; FirstFileName, SecondFileName, OutputFileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MergeFiles(InstanceList[I].GetWideString(FirstFileName), InstanceList[I].GetWideString(SecondFileName),
      InstanceList[I].GetWideString(OutputFileName));
  End
  Else
    Result := 0;
End;

Function DLMergeFilesA(InstanceID: Integer; FirstFileName, SecondFileName, OutputFileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MergeFiles(InstanceList[I].GetWideStringFromAnsi(FirstFileName), InstanceList[I].GetWideStringFromAnsi(SecondFileName),
      InstanceList[I].GetWideStringFromAnsi(OutputFileName));
  End
  Else
    Result := 0;
End;

Function DLMergeTableCells(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MergeTableCells(TableID, FirstRow, FirstColumn, LastRow, LastColumn);
  End
  Else
    Result := 0;
End;

Function DLMoveContentStream(InstanceID, FromPosition, ToPosition: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MoveContentStream(FromPosition, ToPosition);
  End
  Else
    Result := 0;
End;

Function DLMoveOutlineAfter(InstanceID, OutlineID, SiblingID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MoveOutlineAfter(OutlineID, SiblingID);
  End
  Else
    Result := 0;
End;

Function DLMoveOutlineBefore(InstanceID, OutlineID, SiblingID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MoveOutlineBefore(OutlineID, SiblingID);
  End
  Else
    Result := 0;
End;

Function DLMovePage(InstanceID, NewPosition: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MovePage(NewPosition);
  End
  Else
    Result := 0;
End;

Function DLMovePath(InstanceID: Integer; NewX, NewY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MovePath(NewX, NewY);
  End
  Else
    Result := 0;
End;

Function DLMultiplyScale(InstanceID: Integer; MultScaleBy: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.MultiplyScale(MultScaleBy);
  End
  Else
    Result := 0;
End;

Function DLNewChildFormField(InstanceID, Index: Integer; Title: PWideChar; FieldType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewChildFormField(Index, InstanceList[I].GetWideString(Title), FieldType);
  End
  Else
    Result := 0;
End;

Function DLNewChildFormFieldA(InstanceID, Index: Integer; Title: PAnsiChar; FieldType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewChildFormField(Index, InstanceList[I].GetWideStringFromAnsi(Title), FieldType);
  End
  Else
    Result := 0;
End;

Function DLNewContentStream(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewContentStream;
  End
  Else
    Result := 0;
End;

Function DLNewCustomPrinter(InstanceID: Integer; OriginalPrinterName: PWideChar): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.NewCustomPrinter(InstanceList[I].GetWideString(OriginalPrinterName));
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLNewCustomPrinterA(InstanceID: Integer; OriginalPrinterName: PAnsiChar): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.NewCustomPrinter(InstanceList[I].GetWideStringFromAnsi(OriginalPrinterName));
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLNewDestination(InstanceID, DestPage, Zoom, DestType: Integer; Left, Top, Right, Bottom: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewDestination(DestPage, Zoom, DestType, Left, Top, Right, Bottom);
  End
  Else
    Result := 0;
End;

Function DLNewDocument(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewDocument;
  End
  Else
    Result := 0;
End;

Function DLNewFormField(InstanceID: Integer; Title: PWideChar; FieldType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewFormField(InstanceList[I].GetWideString(Title), FieldType);
  End
  Else
    Result := 0;
End;

Function DLNewFormFieldA(InstanceID: Integer; Title: PAnsiChar; FieldType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewFormField(InstanceList[I].GetWideStringFromAnsi(Title), FieldType);
  End
  Else
    Result := 0;
End;

Function DLNewInternalPrinterObject(InstanceID, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewInternalPrinterObject(Options);
  End
  Else
    Result := 0;
End;

Function DLNewNamedDestination(InstanceID: Integer; DestName: PWideChar; DestID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewNamedDestination(InstanceList[I].GetWideString(DestName), DestID);
  End
  Else
    Result := 0;
End;

Function DLNewNamedDestinationA(InstanceID: Integer; DestName: PAnsiChar; DestID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewNamedDestination(InstanceList[I].GetWideStringFromAnsi(DestName), DestID);
  End
  Else
    Result := 0;
End;

Function DLNewOptionalContentGroup(InstanceID: Integer; GroupName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewOptionalContentGroup(InstanceList[I].GetWideString(GroupName));
  End
  Else
    Result := 0;
End;

Function DLNewOptionalContentGroupA(InstanceID: Integer; GroupName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewOptionalContentGroup(InstanceList[I].GetWideStringFromAnsi(GroupName));
  End
  Else
    Result := 0;
End;

Function DLNewOutline(InstanceID, Parent: Integer; Title: PWideChar; DestPage: Integer; DestPosition: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewOutline(Parent, InstanceList[I].GetWideString(Title), DestPage, DestPosition);
  End
  Else
    Result := 0;
End;

Function DLNewOutlineA(InstanceID, Parent: Integer; Title: PAnsiChar; DestPage: Integer; DestPosition: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewOutline(Parent, InstanceList[I].GetWideStringFromAnsi(Title), DestPage, DestPosition);
  End
  Else
    Result := 0;
End;

Function DLNewPage(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewPage;
  End
  Else
    Result := 0;
End;

Function DLNewPageFromCanvasDC(InstanceID: Integer; DPI: Double; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewPageFromCanvasDC(DPI, Options);
  End
  Else
    Result := 0;
End;

Function DLNewPages(InstanceID, PageCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewPages(PageCount);
  End
  Else
    Result := 0;
End;

Function DLNewPostScriptXObject(InstanceID: Integer; PS: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewPostScriptXObject(InstanceList[I].GetWideString(PS));
  End
  Else
    Result := 0;
End;

Function DLNewPostScriptXObjectA(InstanceID: Integer; PS: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewPostScriptXObject(InstanceList[I].GetWideStringFromAnsi(PS));
  End
  Else
    Result := 0;
End;

Function DLNewRGBAxialShader(InstanceID: Integer; ShaderName: PWideChar; StartX, StartY, StartRed, StartGreen, StartBlue, EndX, EndY, EndRed, EndGreen,
  EndBlue: Double; Extend: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewRGBAxialShader(InstanceList[I].GetWideString(ShaderName), StartX, StartY, StartRed, StartGreen, StartBlue, EndX, EndY,
      EndRed, EndGreen, EndBlue, Extend);
  End
  Else
    Result := 0;
End;

Function DLNewRGBAxialShaderA(InstanceID: Integer; ShaderName: PAnsiChar; StartX, StartY, StartRed, StartGreen, StartBlue, EndX, EndY, EndRed, EndGreen,
  EndBlue: Double; Extend: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewRGBAxialShader(InstanceList[I].GetWideStringFromAnsi(ShaderName), StartX, StartY, StartRed, StartGreen, StartBlue, EndX,
      EndY, EndRed, EndGreen, EndBlue, Extend);
  End
  Else
    Result := 0;
End;

Function DLNewSignProcessFromFile(InstanceID: Integer; InputFile, Password: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewSignProcessFromFile(InstanceList[I].GetWideString(InputFile), InstanceList[I].GetWideString(Password));
  End
  Else
    Result := 0;
End;

Function DLNewSignProcessFromFileA(InstanceID: Integer; InputFile, Password: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewSignProcessFromFile(InstanceList[I].GetWideStringFromAnsi(InputFile), InstanceList[I].GetWideStringFromAnsi(Password));
  End
  Else
    Result := 0;
End;

Function DLNewSignProcessFromString(InstanceID: Integer; Source: PAnsiChar; Password: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewSignProcessFromString(InstanceList[I].GetString(Source), InstanceList[I].GetWideString(Password));
  End
  Else
    Result := 0;
End;

Function DLNewSignProcessFromStringA(InstanceID: Integer; Source: PAnsiChar; Password: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewSignProcessFromString(InstanceList[I].GetString(Source), InstanceList[I].GetWideStringFromAnsi(Password));
  End
  Else
    Result := 0;
End;

Function DLNewStaticOutline(InstanceID, Parent: Integer; Title: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewStaticOutline(Parent, InstanceList[I].GetWideString(Title));
  End
  Else
    Result := 0;
End;

Function DLNewStaticOutlineA(InstanceID, Parent: Integer; Title: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewStaticOutline(Parent, InstanceList[I].GetWideStringFromAnsi(Title));
  End
  Else
    Result := 0;
End;

Function DLNewTilingPatternFromCapturedPage(InstanceID: Integer; PatternName: PWideChar; CaptureID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewTilingPatternFromCapturedPage(InstanceList[I].GetWideString(PatternName), CaptureID);
  End
  Else
    Result := 0;
End;

Function DLNewTilingPatternFromCapturedPageA(InstanceID: Integer; PatternName: PAnsiChar; CaptureID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NewTilingPatternFromCapturedPage(InstanceList[I].GetWideStringFromAnsi(PatternName), CaptureID);
  End
  Else
    Result := 0;
End;

Function DLNoEmbedFontListAdd(InstanceID: Integer; FontName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NoEmbedFontListAdd(InstanceList[I].GetWideString(FontName));
  End
  Else
    Result := 0;
End;

Function DLNoEmbedFontListAddA(InstanceID: Integer; FontName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NoEmbedFontListAdd(InstanceList[I].GetWideStringFromAnsi(FontName));
  End
  Else
    Result := 0;
End;

Function DLNoEmbedFontListCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NoEmbedFontListCount;
  End
  Else
    Result := 0;
End;

Function DLNoEmbedFontListGet(InstanceID, Index: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.NoEmbedFontListGet(Index);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLNoEmbedFontListGetA(InstanceID, Index: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.NoEmbedFontListGet(Index);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLNoEmbedFontListRemoveAll(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NoEmbedFontListRemoveAll;
  End
  Else
    Result := 0;
End;

Function DLNoEmbedFontListRemoveIndex(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NoEmbedFontListRemoveIndex(Index);
  End
  Else
    Result := 0;
End;

Function DLNoEmbedFontListRemoveName(InstanceID: Integer; FontName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NoEmbedFontListRemoveName(InstanceList[I].GetWideString(FontName));
  End
  Else
    Result := 0;
End;

Function DLNoEmbedFontListRemoveNameA(InstanceID: Integer; FontName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NoEmbedFontListRemoveName(InstanceList[I].GetWideStringFromAnsi(FontName));
  End
  Else
    Result := 0;
End;

Function DLNormalizePage(InstanceID, NormalizeOptions: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.NormalizePage(NormalizeOptions);
  End
  Else
    Result := 0;
End;

Function DLOpenOutline(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.OpenOutline(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLOptionalContentGroupCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.OptionalContentGroupCount;
  End
  Else
    Result := 0;
End;

Function DLOutlineCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.OutlineCount;
  End
  Else
    Result := 0;
End;

Function DLOutlineTitle(InstanceID, OutlineID: Integer): PWideChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.OutlineTitle(OutlineID);
    Result := PWideChar(InstanceList[I].WideReturnString);
  End
  Else
    Result := Nil;
End;

Function DLOutlineTitleA(InstanceID, OutlineID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].WideReturnString := InstanceList[I].PDFlib.OutlineTitle(OutlineID);
    If (InstanceList[I].AnsiMode = 0) Then
    Begin
      InstanceList[I].ReturnString := AnsiString(InstanceList[I].WideReturnString);
    End
    Else If (InstanceList[I].AnsiMode = 1) Then
    Begin
      InstanceList[I].ReturnString := PLUTF8Encode(InstanceList[I].WideReturnString);
    End
    Else
    Begin
      InstanceList[I].ReturnString := '';
    End;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLPageCount(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PageCount;
  End
  Else
    Result := 0;
End;

Function DLPageHasFontResources(InstanceID, PageNumber: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PageHasFontResources(PageNumber);
  End
  Else
    Result := 0;
End;

Function DLPageHeight(InstanceID: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PageHeight;
  End
  Else
    Result := 0;
End;

Function DLPageJavaScriptAction(InstanceID: Integer; ActionType, JavaScript: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PageJavaScriptAction(InstanceList[I].GetWideString(ActionType), InstanceList[I].GetWideString(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLPageJavaScriptActionA(InstanceID: Integer; ActionType, JavaScript: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PageJavaScriptAction(InstanceList[I].GetWideStringFromAnsi(ActionType), InstanceList[I].GetWideStringFromAnsi(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLPageRotation(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PageRotation;
  End
  Else
    Result := 0;
End;

Function DLPageWidth(InstanceID: Integer): Double;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PageWidth;
  End
  Else
    Result := 0;
End;

Function DLPrintDocument(InstanceID: Integer; PrinterName: PWideChar; StartPage, EndPage, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintDocument(InstanceList[I].GetWideString(PrinterName), StartPage, EndPage, Options);
  End
  Else
    Result := 0;
End;

Function DLPrintDocumentA(InstanceID: Integer; PrinterName: PAnsiChar; StartPage, EndPage, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintDocument(InstanceList[I].GetWideStringFromAnsi(PrinterName), StartPage, EndPage, Options);
  End
  Else
    Result := 0;
End;

Function DLPrintDocumentToFile(InstanceID: Integer; PrinterName: PWideChar; StartPage, EndPage, Options: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintDocumentToFile(InstanceList[I].GetWideString(PrinterName), StartPage, EndPage, Options,
      InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLPrintDocumentToFileA(InstanceID: Integer; PrinterName: PAnsiChar; StartPage, EndPage, Options: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintDocumentToFile(InstanceList[I].GetWideStringFromAnsi(PrinterName), StartPage, EndPage, Options,
      InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLPrintMode(InstanceID, Mode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintMode(Mode);
  End
  Else
    Result := 0;
End;

Function DLPrintOptions(InstanceID, PageScaling, AutoRotateCenter: Integer; Title: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintOptions(PageScaling, AutoRotateCenter, InstanceList[I].GetWideString(Title));
  End
  Else
    Result := 0;
End;

Function DLPrintOptionsA(InstanceID, PageScaling, AutoRotateCenter: Integer; Title: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintOptions(PageScaling, AutoRotateCenter, InstanceList[I].GetWideStringFromAnsi(Title));
  End
  Else
    Result := 0;
End;

Function DLPrintPages(InstanceID: Integer; PrinterName, PageRanges: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintPages(InstanceList[I].GetWideString(PrinterName), InstanceList[I].GetWideString(PageRanges), Options);
  End
  Else
    Result := 0;
End;

Function DLPrintPagesA(InstanceID: Integer; PrinterName, PageRanges: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintPages(InstanceList[I].GetWideStringFromAnsi(PrinterName), InstanceList[I].GetWideStringFromAnsi(PageRanges), Options);
  End
  Else
    Result := 0;
End;

Function DLPrintPagesToFile(InstanceID: Integer; PrinterName, PageRanges: PWideChar; Options: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintPagesToFile(InstanceList[I].GetWideString(PrinterName), InstanceList[I].GetWideString(PageRanges), Options,
      InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLPrintPagesToFileA(InstanceID: Integer; PrinterName, PageRanges: PAnsiChar; Options: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.PrintPagesToFile(InstanceList[I].GetWideStringFromAnsi(PrinterName), InstanceList[I].GetWideStringFromAnsi(PageRanges),
      Options, InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLReleaseBuffer(InstanceID: Integer; Buffer: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  Result := 0;
  If FindInstance(InstanceID, I) Then
  Begin
    If InstanceList[I].ReleaseBuffer(Buffer) Then
      Result := 1;
  End;
End;

Function DLReleaseImage(InstanceID, ImageID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ReleaseImage(ImageID);
  End
  Else
    Result := 0;
End;

Function DLReleaseImageList(InstanceID, ImageListID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ReleaseImageList(ImageListID);
  End
  Else
    Result := 0;
End;

Function DLReleaseLibrary(InstanceID: Integer): Integer;
Var
  I: Integer;
  X: Integer;
Begin
  CriticalSection.Enter;
  Try
    X := 0;
    I := -1;
    While (I < 0) and (X < Length(InstanceList)) Do
      If Assigned(InstanceList[X]) and (InstanceList[X].InstanceID = InstanceID) Then
        I := X
      Else
        Inc(X);
    If I >= 0 Then
    Begin
      Result := 1;
      InstanceList[X].Free;
      InstanceList[X] := Nil;
    End
    Else
      Result := 0;
  Finally
    CriticalSection.Leave;
  End;
End;

Function DLReleaseSignProcess(InstanceID, SignProcessID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ReleaseSignProcess(SignProcessID);
  End
  Else
    Result := 0;
End;

Function DLReleaseStringList(InstanceID, StringListID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ReleaseStringList(StringListID);
  End
  Else
    Result := 0;
End;

Function DLReleaseTextBlocks(InstanceID, TextBlockListID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ReleaseTextBlocks(TextBlockListID);
  End
  Else
    Result := 0;
End;

Function DLRemoveAppearanceStream(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveAppearanceStream(Index);
  End
  Else
    Result := 0;
End;

Function DLRemoveCustomInformation(InstanceID: Integer; Key: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveCustomInformation(InstanceList[I].GetWideString(Key));
  End
  Else
    Result := 0;
End;

Function DLRemoveCustomInformationA(InstanceID: Integer; Key: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveCustomInformation(InstanceList[I].GetWideStringFromAnsi(Key));
  End
  Else
    Result := 0;
End;

Function DLRemoveDocument(InstanceID, DocumentID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveDocument(DocumentID);
  End
  Else
    Result := 0;
End;

Function DLRemoveEmbeddedFile(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveEmbeddedFile(Index);
  End
  Else
    Result := 0;
End;

Function DLRemoveFormFieldBackgroundColor(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveFormFieldBackgroundColor(Index);
  End
  Else
    Result := 0;
End;

Function DLRemoveFormFieldBorderColor(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveFormFieldBorderColor(Index);
  End
  Else
    Result := 0;
End;

Function DLRemoveFormFieldChoiceSub(InstanceID, Index: Integer; SubName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveFormFieldChoiceSub(Index, InstanceList[I].GetWideString(SubName));
  End
  Else
    Result := 0;
End;

Function DLRemoveFormFieldChoiceSubA(InstanceID, Index: Integer; SubName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveFormFieldChoiceSub(Index, InstanceList[I].GetWideStringFromAnsi(SubName));
  End
  Else
    Result := 0;
End;

Function DLRemoveGlobalJavaScript(InstanceID: Integer; PackageName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveGlobalJavaScript(InstanceList[I].GetWideString(PackageName));
  End
  Else
    Result := 0;
End;

Function DLRemoveGlobalJavaScriptA(InstanceID: Integer; PackageName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveGlobalJavaScript(InstanceList[I].GetWideStringFromAnsi(PackageName));
  End
  Else
    Result := 0;
End;

Function DLRemoveOpenAction(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveOpenAction;
  End
  Else
    Result := 0;
End;

Function DLRemoveOutline(InstanceID, OutlineID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveOutline(OutlineID);
  End
  Else
    Result := 0;
End;

Function DLRemovePageBox(InstanceID, BoxType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemovePageBox(BoxType);
  End
  Else
    Result := 0;
End;

Function DLRemoveSharedContentStreams(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveSharedContentStreams;
  End
  Else
    Result := 0;
End;

Function DLRemoveStyle(InstanceID: Integer; StyleName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveStyle(InstanceList[I].GetWideString(StyleName));
  End
  Else
    Result := 0;
End;

Function DLRemoveStyleA(InstanceID: Integer; StyleName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveStyle(InstanceList[I].GetWideStringFromAnsi(StyleName));
  End
  Else
    Result := 0;
End;

Function DLRemoveUsageRights(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveUsageRights;
  End
  Else
    Result := 0;
End;

Function DLRemoveXFAEntries(InstanceID, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RemoveXFAEntries(Options);
  End
  Else
    Result := 0;
End;

Function DLRenderAsMultipageTIFFToFile(InstanceID: Integer; DPI: Double; PageRanges: PWideChar; ImageOptions, OutputOptions: Integer;
  FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RenderAsMultipageTIFFToFile(DPI, InstanceList[I].GetWideString(PageRanges), ImageOptions, OutputOptions,
      InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLRenderAsMultipageTIFFToFileA(InstanceID: Integer; DPI: Double; PageRanges: PAnsiChar; ImageOptions, OutputOptions: Integer;
  FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RenderAsMultipageTIFFToFile(DPI, InstanceList[I].GetWideStringFromAnsi(PageRanges), ImageOptions, OutputOptions,
      InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLRenderDocumentToFile(InstanceID: Integer; DPI: Double; StartPage, EndPage, Options: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RenderDocumentToFile(DPI, StartPage, EndPage, Options, InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLRenderDocumentToFileA(InstanceID: Integer; DPI: Double; StartPage, EndPage, Options: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RenderDocumentToFile(DPI, StartPage, EndPage, Options, InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLRenderPageToDC(InstanceID: Integer; DPI: Double; Page: Integer; DC: HDC): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RenderPageToDC(DPI, Page, DC);
  End
  Else
    Result := 0;
End;

Function DLRenderPageToDCClip(InstanceID: Integer; DPI: Double; Page, DC: Integer; Clip: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RenderPageToDCClip(DPI, Page, DC, InstanceList[I].GetString(Clip));
  End
  Else
    Result := 0;
End;

Function DLRenderPageToFile(InstanceID: Integer; DPI: Double; Page, Options: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RenderPageToFile(DPI, Page, Options, InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLRenderPageToFileA(InstanceID: Integer; DPI: Double; Page, Options: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RenderPageToFile(DPI, Page, Options, InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLRenderPageToString(InstanceID: Integer; DPI: Double; Page, Options: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.RenderPageToString(DPI, Page, Options);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLReplaceFonts(InstanceID, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ReplaceFonts(Options);
  End
  Else
    Result := 0;
End;

Function DLReplaceImage(InstanceID, OriginalImageID, NewImageID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ReplaceImage(OriginalImageID, NewImageID);
  End
  Else
    Result := 0;
End;

Function DLReplaceTag(InstanceID: Integer; Tag, NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ReplaceTag(InstanceList[I].GetWideString(Tag), InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLReplaceTagA(InstanceID: Integer; Tag, NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ReplaceTag(InstanceList[I].GetWideStringFromAnsi(Tag), InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLRequestPrinterStatus(InstanceID, StatusCommand: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RequestPrinterStatus(StatusCommand);
  End
  Else
    Result := 0;
End;

Function DLRetrieveCustomDataToFile(InstanceID: Integer; Key, FileName: PWideChar; Location: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RetrieveCustomDataToFile(InstanceList[I].GetWideString(Key), InstanceList[I].GetWideString(FileName), Location);
  End
  Else
    Result := 0;
End;

Function DLRetrieveCustomDataToFileA(InstanceID: Integer; Key, FileName: PAnsiChar; Location: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RetrieveCustomDataToFile(InstanceList[I].GetWideStringFromAnsi(Key), InstanceList[I].GetWideStringFromAnsi(FileName),
      Location);
  End
  Else
    Result := 0;
End;

Function DLRetrieveCustomDataToString(InstanceID: Integer; Key: PAnsiChar; Location: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.RetrieveCustomDataToString(InstanceList[I].GetString(Key), Location);
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLReverseImage(InstanceID, Reset: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.ReverseImage(Reset);
  End
  Else
    Result := 0;
End;

Function DLRotatePage(InstanceID, PageRotation: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.RotatePage(PageRotation);
  End
  Else
    Result := 0;
End;

Function DLSaveFontToFile(InstanceID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveFontToFile(InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLSaveFontToFileA(InstanceID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveFontToFile(InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLSaveImageListItemDataToFile(InstanceID, ImageListID, ImageIndex, Options: Integer; ImageFileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveImageListItemDataToFile(ImageListID, ImageIndex, Options, InstanceList[I].GetWideString(ImageFileName));
  End
  Else
    Result := 0;
End;

Function DLSaveImageListItemDataToFileA(InstanceID, ImageListID, ImageIndex, Options: Integer; ImageFileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveImageListItemDataToFile(ImageListID, ImageIndex, Options, InstanceList[I].GetWideStringFromAnsi(ImageFileName));
  End
  Else
    Result := 0;
End;

Function DLSaveImageToFile(InstanceID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveImageToFile(InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLSaveImageToFileA(InstanceID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveImageToFile(InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLSaveImageToString(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.SaveImageToString;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLSaveState(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveState;
  End
  Else
    Result := 0;
End;

Function DLSaveStyle(InstanceID: Integer; StyleName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveStyle(InstanceList[I].GetWideString(StyleName));
  End
  Else
    Result := 0;
End;

Function DLSaveStyleA(InstanceID: Integer; StyleName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveStyle(InstanceList[I].GetWideStringFromAnsi(StyleName));
  End
  Else
    Result := 0;
End;

Function DLSaveToFile(InstanceID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveToFile(InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLSaveToFileA(InstanceID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SaveToFile(InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLSaveToString(InstanceID: Integer): PAnsiChar;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    InstanceList[I].ReturnString := InstanceList[I].PDFlib.SaveToString;
    Result := PAnsiChar(InstanceList[I].ReturnString);
  End
  Else
    Result := Nil;
End;

Function DLSecurityInfo(InstanceID, SecurityItem: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SecurityInfo(SecurityItem);
  End
  Else
    Result := 0;
End;

Function DLSelectContentStream(InstanceID, NewIndex: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectContentStream(NewIndex);
  End
  Else
    Result := 0;
End;

Function DLSelectDocument(InstanceID, DocumentID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectDocument(DocumentID);
  End
  Else
    Result := 0;
End;

Function DLSelectFont(InstanceID, FontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectFont(FontID);
  End
  Else
    Result := 0;
End;

Function DLSelectImage(InstanceID, ImageID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectImage(ImageID);
  End
  Else
    Result := 0;
End;

Function DLSelectPage(InstanceID, PageNumber: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectPage(PageNumber);
  End
  Else
    Result := 0;
End;

Function DLSelectRenderer(InstanceID, RendererID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectRenderer(RendererID);
  End
  Else
    Result := 0;
End;

Function DLSelectedDocument(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectedDocument;
  End
  Else
    Result := 0;
End;

Function DLSelectedFont(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectedFont;
  End
  Else
    Result := 0;
End;

Function DLSelectedImage(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectedImage;
  End
  Else
    Result := 0;
End;

Function DLSelectedPage(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectedPage;
  End
  Else
    Result := 0;
End;

Function DLSelectedRenderer(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SelectedRenderer;
  End
  Else
    Result := 0;
End;

Function DLSetActionURL(InstanceID, ActionID: Integer; NewURL: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetActionURL(ActionID, InstanceList[I].GetWideString(NewURL));
  End
  Else
    Result := 0;
End;

Function DLSetActionURLA(InstanceID, ActionID: Integer; NewURL: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetActionURL(ActionID, InstanceList[I].GetWideStringFromAnsi(NewURL));
  End
  Else
    Result := 0;
End;

Function DLSetAnnotBorderColor(InstanceID, Index: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotBorderColor(Index, Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetAnnotBorderStyle(InstanceID, Index: Integer; Width: Double; Style: Integer; DashOn, DashOff: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotBorderStyle(Index, Width, Style, DashOn, DashOff);
  End
  Else
    Result := 0;
End;

Function DLSetAnnotContents(InstanceID, Index: Integer; NewContents: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotContents(Index, InstanceList[I].GetWideString(NewContents));
  End
  Else
    Result := 0;
End;

Function DLSetAnnotContentsA(InstanceID, Index: Integer; NewContents: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotContents(Index, InstanceList[I].GetWideStringFromAnsi(NewContents));
  End
  Else
    Result := 0;
End;

Function DLSetAnnotDblProperty(InstanceID, Index, Tag: Integer; NewValue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotDblProperty(Index, Tag, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetAnnotIntProperty(InstanceID, Index, Tag, NewValue: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotIntProperty(Index, Tag, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetAnnotOptional(InstanceID, Index, OptionalContentGroupID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotOptional(Index, OptionalContentGroupID);
  End
  Else
    Result := 0;
End;

Function DLSetAnnotQuadPoints(InstanceID, Index, QuadNumber: Integer; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotQuadPoints(Index, QuadNumber, X1, Y1, X2, Y2, X3, Y3, X4, Y4);
  End
  Else
    Result := 0;
End;

Function DLSetAnnotRect(InstanceID, Index: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotRect(Index, Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLSetAnnotStrProperty(InstanceID, Index, Tag: Integer; NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotStrProperty(Index, Tag, InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetAnnotStrPropertyA(InstanceID, Index, Tag: Integer; NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAnnotStrProperty(Index, Tag, InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetAnsiMode(InstanceID, NewAnsiMode: Integer): Integer;
Var
  I: Integer;
Begin
  Result := 0;
  If FindInstance(InstanceID, I) Then
  Begin
    If ((NewAnsiMode = 0) or (NewAnsiMode = 1)) Then
    Begin
      InstanceList[I].AnsiMode := NewAnsiMode;
      Result := 1;
    End;
  End;
End;

Function DLSetAppendInputFromString(InstanceID: Integer; Source: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetAppendInputFromString(InstanceList[I].GetString(Source));
  End
  Else
    Result := 0;
End;

Function DLSetBaseURL(InstanceID: Integer; NewBaseURL: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetBaseURL(InstanceList[I].GetWideString(NewBaseURL));
  End
  Else
    Result := 0;
End;

Function DLSetBaseURLA(InstanceID: Integer; NewBaseURL: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetBaseURL(InstanceList[I].GetWideStringFromAnsi(NewBaseURL));
  End
  Else
    Result := 0;
End;

Function DLSetBlendMode(InstanceID, BlendMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetBlendMode(BlendMode);
  End
  Else
    Result := 0;
End;

Function DLSetBreakString(InstanceID: Integer; NewBreakString: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetBreakString(InstanceList[I].GetWideString(NewBreakString));
  End
  Else
    Result := 0;
End;

Function DLSetBreakStringA(InstanceID: Integer; NewBreakString: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetBreakString(InstanceList[I].GetWideStringFromAnsi(NewBreakString));
  End
  Else
    Result := 0;
End;

Function DLSetCSDictEPSG(InstanceID, CSDictID, NewEPSG: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCSDictEPSG(CSDictID, NewEPSG);
  End
  Else
    Result := 0;
End;

Function DLSetCSDictType(InstanceID, CSDictID, NewDictType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCSDictType(CSDictID, NewDictType);
  End
  Else
    Result := 0;
End;

Function DLSetCSDictWKT(InstanceID, CSDictID: Integer; NewWKT: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCSDictWKT(CSDictID, InstanceList[I].GetWideString(NewWKT));
  End
  Else
    Result := 0;
End;

Function DLSetCSDictWKTA(InstanceID, CSDictID: Integer; NewWKT: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCSDictWKT(CSDictID, InstanceList[I].GetWideStringFromAnsi(NewWKT));
  End
  Else
    Result := 0;
End;

Function DLSetCairoFileName(InstanceID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCairoFileName(InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLSetCairoFileNameA(InstanceID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCairoFileName(InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLSetCapturedPageOptional(InstanceID, CaptureID, OptionalContentGroupID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCapturedPageOptional(CaptureID, OptionalContentGroupID);
  End
  Else
    Result := 0;
End;

Function DLSetCapturedPageTransparencyGroup(InstanceID, CaptureID, CS, Isolate, Knockout: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCapturedPageTransparencyGroup(CaptureID, CS, Isolate, Knockout);
  End
  Else
    Result := 0;
End;

Function DLSetCatalogInformation(InstanceID: Integer; Key, NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCatalogInformation(InstanceList[I].GetWideString(Key), InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetCatalogInformationA(InstanceID: Integer; Key, NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCatalogInformation(InstanceList[I].GetWideStringFromAnsi(Key), InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetCharWidth(InstanceID, CharCode, NewWidth: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCharWidth(CharCode, NewWidth);
  End
  Else
    Result := 0;
End;

Function DLSetClippingPath(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetClippingPath;
  End
  Else
    Result := 0;
End;

Function DLSetClippingPathEvenOdd(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetClippingPathEvenOdd;
  End
  Else
    Result := 0;
End;

Function DLSetCompatibility(InstanceID, CompatibilityItem, CompatibilityMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCompatibility(CompatibilityItem, CompatibilityMode);
  End
  Else
    Result := 0;
End;

Function DLSetContentStreamFromString(InstanceID: Integer; Source: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetContentStreamFromString(InstanceList[I].GetString(Source));
  End
  Else
    Result := 0;
End;

Function DLSetContentStreamOptional(InstanceID, OptionalContentGroupID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetContentStreamOptional(OptionalContentGroupID);
  End
  Else
    Result := 0;
End;

Function DLSetCropBox(InstanceID: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCropBox(Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLSetCustomInformation(InstanceID: Integer; Key, NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCustomInformation(InstanceList[I].GetWideString(Key), InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetCustomInformationA(InstanceID: Integer; Key, NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCustomInformation(InstanceList[I].GetWideStringFromAnsi(Key), InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetCustomLineDash(InstanceID: Integer; DashPattern: PWideChar; DashPhase: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCustomLineDash(InstanceList[I].GetWideString(DashPattern), DashPhase);
  End
  Else
    Result := 0;
End;

Function DLSetCustomLineDashA(InstanceID: Integer; DashPattern: PAnsiChar; DashPhase: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetCustomLineDash(InstanceList[I].GetWideStringFromAnsi(DashPattern), DashPhase);
  End
  Else
    Result := 0;
End;

Function DLSetPDFiumFileName(InstanceID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPDFiumFileName(InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLSetPDFiumFileNameA(InstanceID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPDFiumFileName(InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLSetDecodeMode(InstanceID, NewDecodeMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetDecodeMode(NewDecodeMode);
  End
  Else
    Result := 0;
End;

Function DLSetDestProperties(InstanceID, DestID, Zoom, DestType: Integer; Left, Top, Right, Bottom: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetDestProperties(DestID, Zoom, DestType, Left, Top, Right, Bottom);
  End
  Else
    Result := 0;
End;

Function DLSetDestValue(InstanceID, DestID, ValueKey: Integer; NewValue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetDestValue(DestID, ValueKey, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetDocumentMetadata(InstanceID: Integer; XMP: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetDocumentMetadata(InstanceList[I].GetWideString(XMP));
  End
  Else
    Result := 0;
End;

Function DLSetDocumentMetadataA(InstanceID: Integer; XMP: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetDocumentMetadata(InstanceList[I].GetWideStringFromAnsi(XMP));
  End
  Else
    Result := 0;
End;

Function DLSetEmbeddedFileStrProperty(InstanceID, Index, Tag: Integer; NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetEmbeddedFileStrProperty(Index, Tag, InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetEmbeddedFileStrPropertyA(InstanceID, Index, Tag: Integer; NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetEmbeddedFileStrProperty(Index, Tag, InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetFillColor(InstanceID: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFillColor(Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetFillColorCMYK(InstanceID: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFillColorCMYK(C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetFillColorSep(InstanceID: Integer; ColorName: PWideChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFillColorSep(InstanceList[I].GetWideString(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetFillColorSepA(InstanceID: Integer; ColorName: PAnsiChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFillColorSep(InstanceList[I].GetWideStringFromAnsi(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetFillShader(InstanceID: Integer; ShaderName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFillShader(InstanceList[I].GetWideString(ShaderName));
  End
  Else
    Result := 0;
End;

Function DLSetFillShaderA(InstanceID: Integer; ShaderName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFillShader(InstanceList[I].GetWideStringFromAnsi(ShaderName));
  End
  Else
    Result := 0;
End;

Function DLSetFillTilingPattern(InstanceID: Integer; PatternName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFillTilingPattern(InstanceList[I].GetWideString(PatternName));
  End
  Else
    Result := 0;
End;

Function DLSetFillTilingPatternA(InstanceID: Integer; PatternName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFillTilingPattern(InstanceList[I].GetWideStringFromAnsi(PatternName));
  End
  Else
    Result := 0;
End;

Function DLSetFindImagesMode(InstanceID, NewFindImagesMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFindImagesMode(NewFindImagesMode);
  End
  Else
    Result := 0;
End;

Function DLSetFontEncoding(InstanceID, Encoding: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFontEncoding(Encoding);
  End
  Else
    Result := 0;
End;

Function DLSetFontFlags(InstanceID, Fixed, Serif, Symbolic, Script, Italic, AllCap, SmallCap, ForceBold: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFontFlags(Fixed, Serif, Symbolic, Script, Italic, AllCap, SmallCap, ForceBold);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldAlignment(InstanceID, Index, Alignment: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldAlignment(Index, Alignment);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldAnnotFlags(InstanceID, Index, NewFlags: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldAnnotFlags(Index, NewFlags);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBackgroundColor(InstanceID, Index: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBackgroundColor(Index, Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBackgroundColorCMYK(InstanceID, Index: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBackgroundColorCMYK(Index, C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBackgroundColorGray(InstanceID, Index: Integer; Gray: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBackgroundColorGray(Index, Gray);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBackgroundColorSep(InstanceID, Index: Integer; ColorName: PWideChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBackgroundColorSep(Index, InstanceList[I].GetWideString(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBackgroundColorSepA(InstanceID, Index: Integer; ColorName: PAnsiChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBackgroundColorSep(Index, InstanceList[I].GetWideStringFromAnsi(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBorderColor(InstanceID, Index: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBorderColor(Index, Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBorderColorCMYK(InstanceID, Index: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBorderColorCMYK(Index, C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBorderColorGray(InstanceID, Index: Integer; Gray: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBorderColorGray(Index, Gray);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBorderColorSep(InstanceID, Index: Integer; ColorName: PWideChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBorderColorSep(Index, InstanceList[I].GetWideString(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBorderColorSepA(InstanceID, Index: Integer; ColorName: PAnsiChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBorderColorSep(Index, InstanceList[I].GetWideStringFromAnsi(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBorderStyle(InstanceID, Index: Integer; Width: Double; Style: Integer; DashOn, DashOff: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBorderStyle(Index, Width, Style, DashOn, DashOff);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldBounds(InstanceID, Index: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldBounds(Index, Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldCalcOrder(InstanceID, Index, Order: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldCalcOrder(Index, Order);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldCaption(InstanceID, Index: Integer; NewCaption: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldCaption(Index, InstanceList[I].GetWideString(NewCaption));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldCaptionA(InstanceID, Index: Integer; NewCaption: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldCaption(Index, InstanceList[I].GetWideStringFromAnsi(NewCaption));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldCheckStyle(InstanceID, Index, CheckStyle, Position: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldCheckStyle(Index, CheckStyle, Position);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldChildTitle(InstanceID, Index: Integer; NewTitle: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldChildTitle(Index, InstanceList[I].GetWideString(NewTitle));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldChildTitleA(InstanceID, Index: Integer; NewTitle: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldChildTitle(Index, InstanceList[I].GetWideStringFromAnsi(NewTitle));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldChoiceSub(InstanceID, Index, SubIndex: Integer; SubName, DisplayName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldChoiceSub(Index, SubIndex, InstanceList[I].GetWideString(SubName), InstanceList[I].GetWideString(DisplayName));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldChoiceSubA(InstanceID, Index, SubIndex: Integer; SubName, DisplayName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldChoiceSub(Index, SubIndex, InstanceList[I].GetWideStringFromAnsi(SubName),
      InstanceList[I].GetWideStringFromAnsi(DisplayName));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldChoiceType(InstanceID, Index, ChoiceType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldChoiceType(Index, ChoiceType);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldColor(InstanceID, Index: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldColor(Index, Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldColorCMYK(InstanceID, Index: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldColorCMYK(Index, C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldColorSep(InstanceID, Index: Integer; ColorName: PWideChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldColorSep(Index, InstanceList[I].GetWideString(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldColorSepA(InstanceID, Index: Integer; ColorName: PAnsiChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldColorSep(Index, InstanceList[I].GetWideStringFromAnsi(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldComb(InstanceID, Index, Comb: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldComb(Index, Comb);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldDefaultValue(InstanceID, Index: Integer; NewDefaultValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldDefaultValue(Index, InstanceList[I].GetWideString(NewDefaultValue));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldDefaultValueA(InstanceID, Index: Integer; NewDefaultValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldDefaultValue(Index, InstanceList[I].GetWideStringFromAnsi(NewDefaultValue));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldDescription(InstanceID, Index: Integer; NewDescription: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldDescription(Index, InstanceList[I].GetWideString(NewDescription));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldDescriptionA(InstanceID, Index: Integer; NewDescription: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldDescription(Index, InstanceList[I].GetWideStringFromAnsi(NewDescription));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldFlags(InstanceID, Index, NewFlags: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldFlags(Index, NewFlags);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldFont(InstanceID, Index, FontIndex: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldFont(Index, FontIndex);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldHighlightMode(InstanceID, Index, NewMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldHighlightMode(Index, NewMode);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldIcon(InstanceID, Index, IconType, CaptureID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldIcon(Index, IconType, CaptureID);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldIconStyle(InstanceID, Index, Placement, Scale, ScaleType, HorizontalShift, VerticalShift: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldIconStyle(Index, Placement, Scale, ScaleType, HorizontalShift, VerticalShift);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldMaxLen(InstanceID, Index, NewMaxLen: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldMaxLen(Index, NewMaxLen);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldNoExport(InstanceID, Index, NoExport: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldNoExport(Index, NoExport);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldOptional(InstanceID, Index, OptionalContentGroupID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldOptional(Index, OptionalContentGroupID);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldPage(InstanceID, Index, NewPage: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldPage(Index, NewPage);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldPrintable(InstanceID, Index, Printable: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldPrintable(Index, Printable);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldReadOnly(InstanceID, Index, ReadOnly: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldReadOnly(Index, ReadOnly);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldRequired(InstanceID, Index, Required: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldRequired(Index, Required);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldResetAction(InstanceID, Index: Integer; ActionType: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldResetAction(Index, InstanceList[I].GetWideString(ActionType));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldResetActionA(InstanceID, Index: Integer; ActionType: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldResetAction(Index, InstanceList[I].GetWideStringFromAnsi(ActionType));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldRichTextString(InstanceID, Index: Integer; Key, NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldRichTextString(Index, InstanceList[I].GetWideString(Key), InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldRichTextStringA(InstanceID, Index: Integer; Key, NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldRichTextString(Index, InstanceList[I].GetWideStringFromAnsi(Key),
      InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldRotation(InstanceID, Index, Angle: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldRotation(Index, Angle);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldSignatureImage(InstanceID, Index, ImageID, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldSignatureImage(Index, ImageID, Options);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldStandardFont(InstanceID, Index, StandardFontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldStandardFont(Index, StandardFontID);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldSubmitAction(InstanceID, Index: Integer; ActionType, Link: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldSubmitAction(Index, InstanceList[I].GetWideString(ActionType), InstanceList[I].GetWideString(Link));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldSubmitActionA(InstanceID, Index: Integer; ActionType, Link: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldSubmitAction(Index, InstanceList[I].GetWideStringFromAnsi(ActionType),
      InstanceList[I].GetWideStringFromAnsi(Link));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldSubmitActionEx(InstanceID, Index: Integer; ActionType, Link: PWideChar; Flags: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldSubmitActionEx(Index, InstanceList[I].GetWideString(ActionType), InstanceList[I].GetWideString(Link), Flags);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldSubmitActionExA(InstanceID, Index: Integer; ActionType, Link: PAnsiChar; Flags: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldSubmitActionEx(Index, InstanceList[I].GetWideStringFromAnsi(ActionType),
      InstanceList[I].GetWideStringFromAnsi(Link), Flags);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldTabOrder(InstanceID, Index, Order: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldTabOrder(Index, Order);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldTextFlags(InstanceID, Index, Multiline, Password, FileSelect, DoNotSpellCheck, DoNotScroll: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldTextFlags(Index, Multiline, Password, FileSelect, DoNotSpellCheck, DoNotScroll);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldTextSize(InstanceID, Index: Integer; NewTextSize: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldTextSize(Index, NewTextSize);
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldTitle(InstanceID, Index: Integer; NewTitle: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldTitle(Index, InstanceList[I].GetWideString(NewTitle));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldTitleA(InstanceID, Index: Integer; NewTitle: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldTitle(Index, InstanceList[I].GetWideStringFromAnsi(NewTitle));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldValue(InstanceID, Index: Integer; NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldValue(Index, InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldValueA(InstanceID, Index: Integer; NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldValue(Index, InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldValueByTitle(InstanceID: Integer; Title, NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldValueByTitle(InstanceList[I].GetWideString(Title), InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldValueByTitleA(InstanceID: Integer; Title, NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldValueByTitle(InstanceList[I].GetWideStringFromAnsi(Title), InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetFormFieldVisible(InstanceID, Index, Visible: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetFormFieldVisible(Index, Visible);
  End
  Else
    Result := 0;
End;

Function DLSetGDIPlusFileName(InstanceID: Integer; DLLFileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetGDIPlusFileName(InstanceList[I].GetWideString(DLLFileName));
  End
  Else
    Result := 0;
End;

Function DLSetGDIPlusFileNameA(InstanceID: Integer; DLLFileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetGDIPlusFileName(InstanceList[I].GetWideStringFromAnsi(DLLFileName));
  End
  Else
    Result := 0;
End;

Function DLSetGDIPlusOptions(InstanceID, OptionID, NewValue: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetGDIPlusOptions(OptionID, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetHTMLBoldFont(InstanceID: Integer; FontSet: PWideChar; FontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetHTMLBoldFont(InstanceList[I].GetWideString(FontSet), FontID);
  End
  Else
    Result := 0;
End;

Function DLSetHTMLBoldFontA(InstanceID: Integer; FontSet: PAnsiChar; FontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetHTMLBoldFont(InstanceList[I].GetWideStringFromAnsi(FontSet), FontID);
  End
  Else
    Result := 0;
End;

Function DLSetHTMLBoldItalicFont(InstanceID: Integer; FontSet: PWideChar; FontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetHTMLBoldItalicFont(InstanceList[I].GetWideString(FontSet), FontID);
  End
  Else
    Result := 0;
End;

Function DLSetHTMLBoldItalicFontA(InstanceID: Integer; FontSet: PAnsiChar; FontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetHTMLBoldItalicFont(InstanceList[I].GetWideStringFromAnsi(FontSet), FontID);
  End
  Else
    Result := 0;
End;

Function DLSetHTMLItalicFont(InstanceID: Integer; FontSet: PWideChar; FontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetHTMLItalicFont(InstanceList[I].GetWideString(FontSet), FontID);
  End
  Else
    Result := 0;
End;

Function DLSetHTMLItalicFontA(InstanceID: Integer; FontSet: PAnsiChar; FontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetHTMLItalicFont(InstanceList[I].GetWideStringFromAnsi(FontSet), FontID);
  End
  Else
    Result := 0;
End;

Function DLSetHTMLNormalFont(InstanceID: Integer; FontSet: PWideChar; FontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetHTMLNormalFont(InstanceList[I].GetWideString(FontSet), FontID);
  End
  Else
    Result := 0;
End;

Function DLSetHTMLNormalFontA(InstanceID: Integer; FontSet: PAnsiChar; FontID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetHTMLNormalFont(InstanceList[I].GetWideStringFromAnsi(FontSet), FontID);
  End
  Else
    Result := 0;
End;

Function DLSetHeaderCommentsFromString(InstanceID: Integer; Source: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetHeaderCommentsFromString(InstanceList[I].GetString(Source));
  End
  Else
    Result := 0;
End;

Function DLSetImageAsMask(InstanceID, MaskType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetImageAsMask(MaskType);
  End
  Else
    Result := 0;
End;

Function DLSetImageMask(InstanceID: Integer; FromRed, FromGreen, FromBlue, ToRed, ToGreen, ToBlue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetImageMask(FromRed, FromGreen, FromBlue, ToRed, ToGreen, ToBlue);
  End
  Else
    Result := 0;
End;

Function DLSetImageMaskCMYK(InstanceID: Integer; FromC, FromM, FromY, FromK, ToC, ToM, ToY, ToK: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetImageMaskCMYK(FromC, FromM, FromY, FromK, ToC, ToM, ToY, ToK);
  End
  Else
    Result := 0;
End;

Function DLSetImageMaskFromImage(InstanceID, ImageID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetImageMaskFromImage(ImageID);
  End
  Else
    Result := 0;
End;

Function DLSetImageOptional(InstanceID, OptionalContentGroupID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetImageOptional(OptionalContentGroupID);
  End
  Else
    Result := 0;
End;

Function DLSetImageResolution(InstanceID, Horizontal, Vertical, Units: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetImageResolution(Horizontal, Vertical, Units);
  End
  Else
    Result := 0;
End;

Function DLSetInformation(InstanceID, Key: Integer; NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetInformation(Key, InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetInformationA(InstanceID, Key: Integer; NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetInformation(Key, InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetJPEGQuality(InstanceID, Quality: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetJPEGQuality(Quality);
  End
  Else
    Result := 0;
End;

Function DLSetJavaScriptMode(InstanceID, JSMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetJavaScriptMode(JSMode);
  End
  Else
    Result := 0;
End;

Function DLSetKerning(InstanceID: Integer; CharPair: PWideChar; Adjustment: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetKerning(InstanceList[I].GetWideString(CharPair), Adjustment);
  End
  Else
    Result := 0;
End;

Function DLSetKerningA(InstanceID: Integer; CharPair: PAnsiChar; Adjustment: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetKerning(InstanceList[I].GetWideStringFromAnsi(CharPair), Adjustment);
  End
  Else
    Result := 0;
End;

Function DLSetLineCap(InstanceID, LineCap: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineCap(LineCap);
  End
  Else
    Result := 0;
End;

Function DLSetLineColor(InstanceID: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineColor(Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetLineColorCMYK(InstanceID: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineColorCMYK(C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetLineColorSep(InstanceID: Integer; ColorName: PWideChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineColorSep(InstanceList[I].GetWideString(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetLineColorSepA(InstanceID: Integer; ColorName: PAnsiChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineColorSep(InstanceList[I].GetWideStringFromAnsi(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetLineDash(InstanceID: Integer; DashOn, DashOff: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineDash(DashOn, DashOff);
  End
  Else
    Result := 0;
End;

Function DLSetLineDashEx(InstanceID: Integer; DashValues: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineDashEx(InstanceList[I].GetWideString(DashValues));
  End
  Else
    Result := 0;
End;

Function DLSetLineDashExA(InstanceID: Integer; DashValues: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineDashEx(InstanceList[I].GetWideStringFromAnsi(DashValues));
  End
  Else
    Result := 0;
End;

Function DLSetLineJoin(InstanceID, LineJoin: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineJoin(LineJoin);
  End
  Else
    Result := 0;
End;

Function DLSetLineShader(InstanceID: Integer; ShaderName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineShader(InstanceList[I].GetWideString(ShaderName));
  End
  Else
    Result := 0;
End;

Function DLSetLineShaderA(InstanceID: Integer; ShaderName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineShader(InstanceList[I].GetWideStringFromAnsi(ShaderName));
  End
  Else
    Result := 0;
End;

Function DLSetLineWidth(InstanceID: Integer; LineWidth: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetLineWidth(LineWidth);
  End
  Else
    Result := 0;
End;

Function DLSetMarkupAnnotStyle(InstanceID, Index: Integer; Red, Green, Blue, Transparency: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetMarkupAnnotStyle(Index, Red, Green, Blue, Transparency);
  End
  Else
    Result := 0;
End;

Function DLSetMeasureDictBoundsCount(InstanceID, MeasureDictID, NewCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetMeasureDictBoundsCount(MeasureDictID, NewCount);
  End
  Else
    Result := 0;
End;

Function DLSetMeasureDictBoundsItem(InstanceID, MeasureDictID, ItemIndex: Integer; NewValue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetMeasureDictBoundsItem(MeasureDictID, ItemIndex, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetMeasureDictCoordinateSystem(InstanceID, MeasureDictID, CoordinateSystemID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetMeasureDictCoordinateSystem(MeasureDictID, CoordinateSystemID);
  End
  Else
    Result := 0;
End;

Function DLSetMeasureDictGPTSCount(InstanceID, MeasureDictID, NewCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetMeasureDictGPTSCount(MeasureDictID, NewCount);
  End
  Else
    Result := 0;
End;

Function DLSetMeasureDictGPTSItem(InstanceID, MeasureDictID, ItemIndex: Integer; NewValue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetMeasureDictGPTSItem(MeasureDictID, ItemIndex, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetMeasureDictLPTSCount(InstanceID, MeasureDictID, NewCount: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetMeasureDictLPTSCount(MeasureDictID, NewCount);
  End
  Else
    Result := 0;
End;

Function DLSetMeasureDictLPTSItem(InstanceID, MeasureDictID, ItemIndex: Integer; NewValue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetMeasureDictLPTSItem(MeasureDictID, ItemIndex, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetMeasureDictPDU(InstanceID, MeasureDictID, LinearUnit, AreaUnit, AngularUnit: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetMeasureDictPDU(MeasureDictID, LinearUnit, AreaUnit, AngularUnit);
  End
  Else
    Result := 0;
End;

Function DLSetMeasurementUnits(InstanceID, MeasurementUnits: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetMeasurementUnits(MeasurementUnits);
  End
  Else
    Result := 0;
End;

Function DLSetNeedAppearances(InstanceID, NewValue: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetNeedAppearances(NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetObjectFromString(InstanceID, ObjectNumber: Integer; Source: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetObjectFromString(ObjectNumber, InstanceList[I].GetString(Source));
  End
  Else
    Result := 0;
End;

Function DLSetOpenActionDestination(InstanceID, OpenPage, Zoom: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOpenActionDestination(OpenPage, Zoom);
  End
  Else
    Result := 0;
End;

Function DLSetOpenActionDestinationFull(InstanceID, OpenPage, Zoom, DestType: Integer; Left, Top, Right, Bottom: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOpenActionDestinationFull(OpenPage, Zoom, DestType, Left, Top, Right, Bottom);
  End
  Else
    Result := 0;
End;

Function DLSetOpenActionJavaScript(InstanceID: Integer; JavaScript: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOpenActionJavaScript(InstanceList[I].GetWideString(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLSetOpenActionJavaScriptA(InstanceID: Integer; JavaScript: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOpenActionJavaScript(InstanceList[I].GetWideStringFromAnsi(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLSetOpenActionMenu(InstanceID: Integer; MenuItem: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOpenActionMenu(InstanceList[I].GetWideString(MenuItem));
  End
  Else
    Result := 0;
End;

Function DLSetOpenActionMenuA(InstanceID: Integer; MenuItem: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOpenActionMenu(InstanceList[I].GetWideStringFromAnsi(MenuItem));
  End
  Else
    Result := 0;
End;

Function DLSetOptionalContentConfigLocked(InstanceID, OptionalContentConfigID, OptionalContentGroupID, NewLocked: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOptionalContentConfigLocked(OptionalContentConfigID, OptionalContentGroupID, NewLocked);
  End
  Else
    Result := 0;
End;

Function DLSetOptionalContentConfigState(InstanceID, OptionalContentConfigID, OptionalContentGroupID, NewState: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOptionalContentConfigState(OptionalContentConfigID, OptionalContentGroupID, NewState);
  End
  Else
    Result := 0;
End;

Function DLSetOptionalContentGroupName(InstanceID, OptionalContentGroupID: Integer; NewGroupName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOptionalContentGroupName(OptionalContentGroupID, InstanceList[I].GetWideString(NewGroupName));
  End
  Else
    Result := 0;
End;

Function DLSetOptionalContentGroupNameA(InstanceID, OptionalContentGroupID: Integer; NewGroupName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOptionalContentGroupName(OptionalContentGroupID, InstanceList[I].GetWideStringFromAnsi(NewGroupName));
  End
  Else
    Result := 0;
End;

Function DLSetOptionalContentGroupPrintable(InstanceID, OptionalContentGroupID, Printable: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOptionalContentGroupPrintable(OptionalContentGroupID, Printable);
  End
  Else
    Result := 0;
End;

Function DLSetOptionalContentGroupVisible(InstanceID, OptionalContentGroupID, Visible: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOptionalContentGroupVisible(OptionalContentGroupID, Visible);
  End
  Else
    Result := 0;
End;

Function DLSetOrigin(InstanceID, Origin: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOrigin(Origin);
  End
  Else
    Result := 0;
End;

Function DLSetOutlineColor(InstanceID, OutlineID: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineColor(OutlineID, Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetOutlineDestination(InstanceID, OutlineID, DestPage: Integer; DestPosition: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineDestination(OutlineID, DestPage, DestPosition);
  End
  Else
    Result := 0;
End;

Function DLSetOutlineDestinationFull(InstanceID, OutlineID, DestPage, Zoom, DestType: Integer; Left, Top, Right, Bottom: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineDestinationFull(OutlineID, DestPage, Zoom, DestType, Left, Top, Right, Bottom);
  End
  Else
    Result := 0;
End;

Function DLSetOutlineDestinationZoom(InstanceID, OutlineID, DestPage: Integer; DestPosition: Double; Zoom: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineDestinationZoom(OutlineID, DestPage, DestPosition, Zoom);
  End
  Else
    Result := 0;
End;

Function DLSetOutlineJavaScript(InstanceID, OutlineID: Integer; JavaScript: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineJavaScript(OutlineID, InstanceList[I].GetWideString(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLSetOutlineJavaScriptA(InstanceID, OutlineID: Integer; JavaScript: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineJavaScript(OutlineID, InstanceList[I].GetWideStringFromAnsi(JavaScript));
  End
  Else
    Result := 0;
End;

Function DLSetOutlineNamedDestination(InstanceID, OutlineID: Integer; DestName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineNamedDestination(OutlineID, InstanceList[I].GetWideString(DestName));
  End
  Else
    Result := 0;
End;

Function DLSetOutlineNamedDestinationA(InstanceID, OutlineID: Integer; DestName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineNamedDestination(OutlineID, InstanceList[I].GetWideStringFromAnsi(DestName));
  End
  Else
    Result := 0;
End;

Function DLSetOutlineOpenFile(InstanceID, OutlineID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineOpenFile(OutlineID, InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLSetOutlineOpenFileA(InstanceID, OutlineID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineOpenFile(OutlineID, InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLSetOutlineRemoteDestination(InstanceID, OutlineID: Integer; FileName: PWideChar; OpenPage, Zoom, DestType: Integer;
  PntLeft, PntTop, PntRight, PntBottom: Double; NewWindow: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineRemoteDestination(OutlineID, InstanceList[I].GetWideString(FileName), OpenPage, Zoom, DestType, PntLeft, PntTop,
      PntRight, PntBottom, NewWindow);
  End
  Else
    Result := 0;
End;

Function DLSetOutlineRemoteDestinationA(InstanceID, OutlineID: Integer; FileName: PAnsiChar; OpenPage, Zoom, DestType: Integer;
  PntLeft, PntTop, PntRight, PntBottom: Double; NewWindow: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineRemoteDestination(OutlineID, InstanceList[I].GetWideStringFromAnsi(FileName), OpenPage, Zoom, DestType, PntLeft,
      PntTop, PntRight, PntBottom, NewWindow);
  End
  Else
    Result := 0;
End;

Function DLSetOutlineStyle(InstanceID, OutlineID, SetItalic, SetBold: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineStyle(OutlineID, SetItalic, SetBold);
  End
  Else
    Result := 0;
End;

Function DLSetOutlineTitle(InstanceID, OutlineID: Integer; NewTitle: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineTitle(OutlineID, InstanceList[I].GetWideString(NewTitle));
  End
  Else
    Result := 0;
End;

Function DLSetOutlineTitleA(InstanceID, OutlineID: Integer; NewTitle: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineTitle(OutlineID, InstanceList[I].GetWideStringFromAnsi(NewTitle));
  End
  Else
    Result := 0;
End;

Function DLSetOutlineWebLink(InstanceID, OutlineID: Integer; Link: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineWebLink(OutlineID, InstanceList[I].GetWideString(Link));
  End
  Else
    Result := 0;
End;

Function DLSetOutlineWebLinkA(InstanceID, OutlineID: Integer; Link: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOutlineWebLink(OutlineID, InstanceList[I].GetWideStringFromAnsi(Link));
  End
  Else
    Result := 0;
End;

Function DLSetOverprint(InstanceID, StrokingOverprint, OtherOverprint, OverprintMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetOverprint(StrokingOverprint, OtherOverprint, OverprintMode);
  End
  Else
    Result := 0;
End;

Function DLSetPDFAMode(InstanceID, NewMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPDFAMode(NewMode);
  End
  Else
    Result := 0;
End;

Function DLSetPNGTransparencyColor(InstanceID, RedByte, GreenByte, BlueByte: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPNGTransparencyColor(RedByte, GreenByte, BlueByte);
  End
  Else
    Result := 0;
End;

Function DLSetPageActionMenu(InstanceID: Integer; MenuItem: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageActionMenu(InstanceList[I].GetWideString(MenuItem));
  End
  Else
    Result := 0;
End;

Function DLSetPageActionMenuA(InstanceID: Integer; MenuItem: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageActionMenu(InstanceList[I].GetWideStringFromAnsi(MenuItem));
  End
  Else
    Result := 0;
End;

Function DLSetPageBox(InstanceID, BoxType: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageBox(BoxType, Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLSetPageContentFromString(InstanceID: Integer; Source: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageContentFromString(InstanceList[I].GetString(Source));
  End
  Else
    Result := 0;
End;

Function DLSetPageDimensions(InstanceID: Integer; NewPageWidth, NewPageHeight: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageDimensions(NewPageWidth, NewPageHeight);
  End
  Else
    Result := 0;
End;

Function DLSetPageLayout(InstanceID, NewPageLayout: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageLayout(NewPageLayout);
  End
  Else
    Result := 0;
End;

Function DLSetPageMode(InstanceID, NewPageMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageMode(NewPageMode);
  End
  Else
    Result := 0;
End;

Function DLSetPageSize(InstanceID: Integer; PaperName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageSize(InstanceList[I].GetWideString(PaperName));
  End
  Else
    Result := 0;
End;

Function DLSetPageSizeA(InstanceID: Integer; PaperName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageSize(InstanceList[I].GetWideStringFromAnsi(PaperName));
  End
  Else
    Result := 0;
End;

Function DLSetPageThumbnail(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageThumbnail;
  End
  Else
    Result := 0;
End;

Function DLSetPageTransparencyGroup(InstanceID, CS, Isolate, Knockout: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageTransparencyGroup(CS, Isolate, Knockout);
  End
  Else
    Result := 0;
End;

Function DLSetPageUserUnit(InstanceID: Integer; UserUnit: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPageUserUnit(UserUnit);
  End
  Else
    Result := 0;
End;

Function DLSetPrecision(InstanceID, NewPrecision: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPrecision(NewPrecision);
  End
  Else
    Result := 0;
End;

Function DLSetPrinterDevModeFromString(InstanceID: Integer; Source: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetPrinterDevModeFromString(InstanceList[I].GetString(Source));
  End
  Else
    Result := 0;
End;

Function DLSetRenderCropType(InstanceID, NewCropType: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetRenderCropType(NewCropType);
  End
  Else
    Result := 0;
End;

Function DLSetRenderDCErasePage(InstanceID, NewErasePage: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetRenderDCErasePage(NewErasePage);
  End
  Else
    Result := 0;
End;

Function DLSetRenderDCOffset(InstanceID, NewOffsetX, NewOffsetY: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetRenderDCOffset(NewOffsetX, NewOffsetY);
  End
  Else
    Result := 0;
End;

Function DLSetRenderOptions(InstanceID, OptionID, NewValue: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetRenderOptions(OptionID, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetRenderScale(InstanceID: Integer; NewScale: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetRenderScale(NewScale);
  End
  Else
    Result := 0;
End;

Function DLSetScale(InstanceID: Integer; NewScale: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetScale(NewScale);
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessCustomSubFilter(InstanceID, SignProcessID: Integer; SubFilterStr: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessCustomSubFilter(SignProcessID, InstanceList[I].GetWideString(SubFilterStr));
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessCustomSubFilterA(InstanceID, SignProcessID: Integer; SubFilterStr: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessCustomSubFilter(SignProcessID, InstanceList[I].GetWideStringFromAnsi(SubFilterStr));
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessField(InstanceID, SignProcessID: Integer; SignatureFieldName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessField(SignProcessID, InstanceList[I].GetWideString(SignatureFieldName));
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessFieldA(InstanceID, SignProcessID: Integer; SignatureFieldName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessField(SignProcessID, InstanceList[I].GetWideStringFromAnsi(SignatureFieldName));
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessFieldBounds(InstanceID, SignProcessID: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessFieldBounds(SignProcessID, Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessFieldImageFromFile(InstanceID, SignProcessID: Integer; ImageFileName: PWideChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessFieldImageFromFile(SignProcessID, InstanceList[I].GetWideString(ImageFileName), Options);
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessFieldImageFromFileA(InstanceID, SignProcessID: Integer; ImageFileName: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessFieldImageFromFile(SignProcessID, InstanceList[I].GetWideStringFromAnsi(ImageFileName), Options);
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessFieldPage(InstanceID, SignProcessID, SignaturePage: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessFieldPage(SignProcessID, SignaturePage);
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessInfo(InstanceID, SignProcessID: Integer; Reason, Location, ContactInfo: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessInfo(SignProcessID, InstanceList[I].GetWideString(Reason), InstanceList[I].GetWideString(Location),
      InstanceList[I].GetWideString(ContactInfo));
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessInfoA(InstanceID, SignProcessID: Integer; Reason, Location, ContactInfo: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessInfo(SignProcessID, InstanceList[I].GetWideStringFromAnsi(Reason),
      InstanceList[I].GetWideStringFromAnsi(Location), InstanceList[I].GetWideStringFromAnsi(ContactInfo));
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessKeyset(InstanceID, SignProcessID, KeysetID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessKeyset(SignProcessID, KeysetID);
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessPFXFromFile(InstanceID, SignProcessID: Integer; PFXFileName, PFXPassword: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessPFXFromFile(SignProcessID, InstanceList[I].GetWideString(PFXFileName),
      InstanceList[I].GetWideString(PFXPassword));
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessPFXFromFileA(InstanceID, SignProcessID: Integer; PFXFileName, PFXPassword: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessPFXFromFile(SignProcessID, InstanceList[I].GetWideStringFromAnsi(PFXFileName),
      InstanceList[I].GetWideStringFromAnsi(PFXPassword));
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessPassthrough(InstanceID, SignProcessID, SignatureLength: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessPassthrough(SignProcessID, SignatureLength);
  End
  Else
    Result := 0;
End;

Function DLSetSignProcessSubFilter(InstanceID, SignProcessID, SubFilter: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetSignProcessSubFilter(SignProcessID, SubFilter);
  End
  Else
    Result := 0;
End;

Function DLSetTabOrderMode(InstanceID: Integer; Mode: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTabOrderMode(InstanceList[I].GetWideString(Mode));
  End
  Else
    Result := 0;
End;

Function DLSetTabOrderModeA(InstanceID: Integer; Mode: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTabOrderMode(InstanceList[I].GetWideStringFromAnsi(Mode));
  End
  Else
    Result := 0;
End;

Function DLSetTableBorderColor(InstanceID, TableID, BorderIndex: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableBorderColor(TableID, BorderIndex, Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetTableBorderColorCMYK(InstanceID, TableID, BorderIndex: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableBorderColorCMYK(TableID, BorderIndex, C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetTableBorderWidth(InstanceID, TableID, BorderIndex: Integer; NewWidth: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableBorderWidth(TableID, BorderIndex, NewWidth);
  End
  Else
    Result := 0;
End;

Function DLSetTableCellAlignment(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn, NewCellAlignment: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellAlignment(TableID, FirstRow, FirstColumn, LastRow, LastColumn, NewCellAlignment);
  End
  Else
    Result := 0;
End;

Function DLSetTableCellBackgroundColor(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellBackgroundColor(TableID, FirstRow, FirstColumn, LastRow, LastColumn, Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetTableCellBackgroundColorCMYK(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellBackgroundColorCMYK(TableID, FirstRow, FirstColumn, LastRow, LastColumn, C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetTableCellBorderColor(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellBorderColor(TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex, Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetTableCellBorderColorCMYK(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellBorderColorCMYK(TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex, C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetTableCellBorderWidth(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex: Integer; NewWidth: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellBorderWidth(TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex, NewWidth);
  End
  Else
    Result := 0;
End;

Function DLSetTableCellContent(InstanceID, TableID, RowNumber, ColumnNumber: Integer; HTMLText: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellContent(TableID, RowNumber, ColumnNumber, InstanceList[I].GetWideString(HTMLText));
  End
  Else
    Result := 0;
End;

Function DLSetTableCellContentA(InstanceID, TableID, RowNumber, ColumnNumber: Integer; HTMLText: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellContent(TableID, RowNumber, ColumnNumber, InstanceList[I].GetWideStringFromAnsi(HTMLText));
  End
  Else
    Result := 0;
End;

Function DLSetTableCellPadding(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex: Integer; NewPadding: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellPadding(TableID, FirstRow, FirstColumn, LastRow, LastColumn, BorderIndex, NewPadding);
  End
  Else
    Result := 0;
End;

Function DLSetTableCellTextColor(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellTextColor(TableID, FirstRow, FirstColumn, LastRow, LastColumn, Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetTableCellTextColorCMYK(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellTextColorCMYK(TableID, FirstRow, FirstColumn, LastRow, LastColumn, C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetTableCellTextSize(InstanceID, TableID, FirstRow, FirstColumn, LastRow, LastColumn: Integer; NewTextSize: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableCellTextSize(TableID, FirstRow, FirstColumn, LastRow, LastColumn, NewTextSize);
  End
  Else
    Result := 0;
End;

Function DLSetTableColumnWidth(InstanceID, TableID, FirstColumn, LastColumn: Integer; NewWidth: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableColumnWidth(TableID, FirstColumn, LastColumn, NewWidth);
  End
  Else
    Result := 0;
End;

Function DLSetTableRowHeight(InstanceID, TableID, FirstRow, LastRow: Integer; NewHeight: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableRowHeight(TableID, FirstRow, LastRow, NewHeight);
  End
  Else
    Result := 0;
End;

Function DLSetTableThinBorders(InstanceID, TableID, ThinBorders: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableThinBorders(TableID, ThinBorders, Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetTableThinBordersCMYK(InstanceID, TableID, ThinBorders: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTableThinBordersCMYK(TableID, ThinBorders, C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetTempFile(InstanceID: Integer; FileName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTempFile(InstanceList[I].GetWideString(FileName));
  End
  Else
    Result := 0;
End;

Function DLSetTempFileA(InstanceID: Integer; FileName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTempFile(InstanceList[I].GetWideStringFromAnsi(FileName));
  End
  Else
    Result := 0;
End;

Function DLSetTempPath(InstanceID: Integer; NewPath: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTempPath(InstanceList[I].GetWideString(NewPath));
  End
  Else
    Result := 0;
End;

Function DLSetTempPathA(InstanceID: Integer; NewPath: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTempPath(InstanceList[I].GetWideStringFromAnsi(NewPath));
  End
  Else
    Result := 0;
End;

Function DLSetTextAlign(InstanceID, TextAlign: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextAlign(TextAlign);
  End
  Else
    Result := 0;
End;

Function DLSetTextCharSpacing(InstanceID: Integer; CharSpacing: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextCharSpacing(CharSpacing);
  End
  Else
    Result := 0;
End;

Function DLSetTextColor(InstanceID: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextColor(Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetTextColorCMYK(InstanceID: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextColorCMYK(C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetTextColorSep(InstanceID: Integer; ColorName: PWideChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextColorSep(InstanceList[I].GetWideString(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetTextColorSepA(InstanceID: Integer; ColorName: PAnsiChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextColorSep(InstanceList[I].GetWideStringFromAnsi(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetTextExtractionArea(InstanceID: Integer; Left, Top, Width, Height: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextExtractionArea(Left, Top, Width, Height);
  End
  Else
    Result := 0;
End;

Function DLSetTextExtractionOptions(InstanceID, OptionID, NewValue: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextExtractionOptions(OptionID, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetTextExtractionScaling(InstanceID, Options: Integer; Horizontal, Vertical: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextExtractionScaling(Options, Horizontal, Vertical);
  End
  Else
    Result := 0;
End;

Function DLSetTextExtractionWordGap(InstanceID: Integer; NewWordGap: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextExtractionWordGap(NewWordGap);
  End
  Else
    Result := 0;
End;

Function DLSetTextHighlight(InstanceID, Highlight: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextHighlight(Highlight);
  End
  Else
    Result := 0;
End;

Function DLSetTextHighlightColor(InstanceID: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextHighlightColor(Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetTextHighlightColorCMYK(InstanceID: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextHighlightColorCMYK(C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetTextHighlightColorSep(InstanceID: Integer; ColorName: PWideChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextHighlightColorSep(InstanceList[I].GetWideString(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetTextHighlightColorSepA(InstanceID: Integer; ColorName: PAnsiChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextHighlightColorSep(InstanceList[I].GetWideStringFromAnsi(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetTextMode(InstanceID, TextMode: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextMode(TextMode);
  End
  Else
    Result := 0;
End;

Function DLSetTextRise(InstanceID: Integer; Rise: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextRise(Rise);
  End
  Else
    Result := 0;
End;

Function DLSetTextScaling(InstanceID: Integer; ScalePercentage: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextScaling(ScalePercentage);
  End
  Else
    Result := 0;
End;

Function DLSetTextShader(InstanceID: Integer; ShaderName: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextShader(InstanceList[I].GetWideString(ShaderName));
  End
  Else
    Result := 0;
End;

Function DLSetTextShaderA(InstanceID: Integer; ShaderName: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextShader(InstanceList[I].GetWideStringFromAnsi(ShaderName));
  End
  Else
    Result := 0;
End;

Function DLSetTextSize(InstanceID: Integer; TextSize: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextSize(TextSize);
  End
  Else
    Result := 0;
End;

Function DLSetTextSpacing(InstanceID: Integer; Spacing: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextSpacing(Spacing);
  End
  Else
    Result := 0;
End;

Function DLSetTextUnderline(InstanceID, Underline: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextUnderline(Underline);
  End
  Else
    Result := 0;
End;

Function DLSetTextUnderlineColor(InstanceID: Integer; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextUnderlineColor(Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetTextUnderlineColorCMYK(InstanceID: Integer; C, M, Y, K: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextUnderlineColorCMYK(C, M, Y, K);
  End
  Else
    Result := 0;
End;

Function DLSetTextUnderlineColorSep(InstanceID: Integer; ColorName: PWideChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextUnderlineColorSep(InstanceList[I].GetWideString(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetTextUnderlineColorSepA(InstanceID: Integer; ColorName: PAnsiChar; Tint: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextUnderlineColorSep(InstanceList[I].GetWideStringFromAnsi(ColorName), Tint);
  End
  Else
    Result := 0;
End;

Function DLSetTextUnderlineCustomDash(InstanceID: Integer; DashPattern: PWideChar; DashPhase: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextUnderlineCustomDash(InstanceList[I].GetWideString(DashPattern), DashPhase);
  End
  Else
    Result := 0;
End;

Function DLSetTextUnderlineCustomDashA(InstanceID: Integer; DashPattern: PAnsiChar; DashPhase: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextUnderlineCustomDash(InstanceList[I].GetWideStringFromAnsi(DashPattern), DashPhase);
  End
  Else
    Result := 0;
End;

Function DLSetTextUnderlineDash(InstanceID: Integer; DashOn, DashOff: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextUnderlineDash(DashOn, DashOff);
  End
  Else
    Result := 0;
End;

Function DLSetTextUnderlineDistance(InstanceID: Integer; UnderlineDistance: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextUnderlineDistance(UnderlineDistance);
  End
  Else
    Result := 0;
End;

Function DLSetTextUnderlineWidth(InstanceID: Integer; UnderlineWidth: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextUnderlineWidth(UnderlineWidth);
  End
  Else
    Result := 0;
End;

Function DLSetTextWordSpacing(InstanceID: Integer; WordSpacing: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTextWordSpacing(WordSpacing);
  End
  Else
    Result := 0;
End;

Function DLSetTransparency(InstanceID, Transparency: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetTransparency(Transparency);
  End
  Else
    Result := 0;
End;

Function DLSetViewerPreferences(InstanceID, Option, NewValue: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetViewerPreferences(Option, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetXFAFormFieldAccess(InstanceID: Integer; XFAFieldName: PWideChar; NewAccess: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFormFieldAccess(InstanceList[I].GetWideString(XFAFieldName), NewAccess);
  End
  Else
    Result := 0;
End;

Function DLSetXFAFormFieldAccessA(InstanceID: Integer; XFAFieldName: PAnsiChar; NewAccess: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFormFieldAccess(InstanceList[I].GetWideStringFromAnsi(XFAFieldName), NewAccess);
  End
  Else
    Result := 0;
End;

Function DLSetXFAFormFieldBorderColor(InstanceID: Integer; XFAFieldName: PWideChar; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFormFieldBorderColor(InstanceList[I].GetWideString(XFAFieldName), Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetXFAFormFieldBorderColorA(InstanceID: Integer; XFAFieldName: PAnsiChar; Red, Green, Blue: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFormFieldBorderColor(InstanceList[I].GetWideStringFromAnsi(XFAFieldName), Red, Green, Blue);
  End
  Else
    Result := 0;
End;

Function DLSetXFAFormFieldBorderPresence(InstanceID: Integer; XFAFieldName: PWideChar; NewPresence: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFormFieldBorderPresence(InstanceList[I].GetWideString(XFAFieldName), NewPresence);
  End
  Else
    Result := 0;
End;

Function DLSetXFAFormFieldBorderPresenceA(InstanceID: Integer; XFAFieldName: PAnsiChar; NewPresence: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFormFieldBorderPresence(InstanceList[I].GetWideStringFromAnsi(XFAFieldName), NewPresence);
  End
  Else
    Result := 0;
End;

Function DLSetXFAFormFieldBorderWidth(InstanceID: Integer; XFAFieldName: PWideChar; BorderWidth: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFormFieldBorderWidth(InstanceList[I].GetWideString(XFAFieldName), BorderWidth);
  End
  Else
    Result := 0;
End;

Function DLSetXFAFormFieldBorderWidthA(InstanceID: Integer; XFAFieldName: PAnsiChar; BorderWidth: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFormFieldBorderWidth(InstanceList[I].GetWideStringFromAnsi(XFAFieldName), BorderWidth);
  End
  Else
    Result := 0;
End;

Function DLSetXFAFormFieldValue(InstanceID: Integer; XFAFieldName, NewValue: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFormFieldValue(InstanceList[I].GetWideString(XFAFieldName), InstanceList[I].GetWideString(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetXFAFormFieldValueA(InstanceID: Integer; XFAFieldName, NewValue: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFormFieldValue(InstanceList[I].GetWideStringFromAnsi(XFAFieldName), InstanceList[I].GetWideStringFromAnsi(NewValue));
  End
  Else
    Result := 0;
End;

Function DLSetXFAFromString(InstanceID: Integer; Source: PAnsiChar; Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetXFAFromString(InstanceList[I].GetString(Source), Options);
  End
  Else
    Result := 0;
End;

Function DLSetupPrinter(InstanceID: Integer; CustomPrinterName: PWideChar; Setting, NewValue: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetupPrinter(InstanceList[I].GetWideString(CustomPrinterName), Setting, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSetupPrinterA(InstanceID: Integer; CustomPrinterName: PAnsiChar; Setting, NewValue: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SetupPrinter(InstanceList[I].GetWideStringFromAnsi(CustomPrinterName), Setting, NewValue);
  End
  Else
    Result := 0;
End;

Function DLSignFile(InstanceID: Integer; InputFileName, OpenPassword, SignatureFieldName, OutputFileName, PFXFileName, PFXPassword, Reason, Location,
  ContactInfo: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SignFile(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(OpenPassword),
      InstanceList[I].GetWideString(SignatureFieldName), InstanceList[I].GetWideString(OutputFileName), InstanceList[I].GetWideString(PFXFileName),
      InstanceList[I].GetWideString(PFXPassword), InstanceList[I].GetWideString(Reason), InstanceList[I].GetWideString(Location),
      InstanceList[I].GetWideString(ContactInfo));
  End
  Else
    Result := 0;
End;

Function DLSignFileA(InstanceID: Integer; InputFileName, OpenPassword, SignatureFieldName, OutputFileName, PFXFileName, PFXPassword, Reason, Location,
  ContactInfo: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SignFile(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(OpenPassword),
      InstanceList[I].GetWideStringFromAnsi(SignatureFieldName), InstanceList[I].GetWideStringFromAnsi(OutputFileName),
      InstanceList[I].GetWideStringFromAnsi(PFXFileName), InstanceList[I].GetWideStringFromAnsi(PFXPassword), InstanceList[I].GetWideStringFromAnsi(Reason),
      InstanceList[I].GetWideStringFromAnsi(Location), InstanceList[I].GetWideStringFromAnsi(ContactInfo));
  End
  Else
    Result := 0;
End;

Function DLSplitPageText(InstanceID, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.SplitPageText(Options);
  End
  Else
    Result := 0;
End;

Function DLStartPath(InstanceID: Integer; StartX, StartY: Double): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.StartPath(StartX, StartY);
  End
  Else
    Result := 0;
End;

Function DLStoreCustomDataFromFile(InstanceID: Integer; Key, FileName: PWideChar; Location, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.StoreCustomDataFromFile(InstanceList[I].GetWideString(Key), InstanceList[I].GetWideString(FileName), Location, Options);
  End
  Else
    Result := 0;
End;

Function DLStoreCustomDataFromFileA(InstanceID: Integer; Key, FileName: PAnsiChar; Location, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.StoreCustomDataFromFile(InstanceList[I].GetWideStringFromAnsi(Key), InstanceList[I].GetWideStringFromAnsi(FileName),
      Location, Options);
  End
  Else
    Result := 0;
End;

Function DLStoreCustomDataFromString(InstanceID: Integer; Key, NewValue: PAnsiChar; Location, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.StoreCustomDataFromString(InstanceList[I].GetString(Key), InstanceList[I].GetString(NewValue), Location, Options);
  End
  Else
    Result := 0;
End;

Function DLStringResultLength(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := Length(InstanceList[I].WideReturnString);
  End
  Else
    Result := 0;
End;

Function DLTestTempPath(InstanceID: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.TestTempPath;
  End
  Else
    Result := 0;
End;

Function DLTransformFile(InstanceID: Integer; InputFileName, Password, OutputFileName: PWideChar; TransformType, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.TransformFile(InstanceList[I].GetWideString(InputFileName), InstanceList[I].GetWideString(Password),
      InstanceList[I].GetWideString(OutputFileName), TransformType, Options);
  End
  Else
    Result := 0;
End;

Function DLTransformFileA(InstanceID: Integer; InputFileName, Password, OutputFileName: PAnsiChar; TransformType, Options: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.TransformFile(InstanceList[I].GetWideStringFromAnsi(InputFileName), InstanceList[I].GetWideStringFromAnsi(Password),
      InstanceList[I].GetWideStringFromAnsi(OutputFileName), TransformType, Options);
  End
  Else
    Result := 0;
End;

Function DLUpdateAndFlattenFormField(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.UpdateAndFlattenFormField(Index);
  End
  Else
    Result := 0;
End;

Function DLUpdateAppearanceStream(InstanceID, Index: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.UpdateAppearanceStream(Index);
  End
  Else
    Result := 0;
End;

Function DLUpdateTrueTypeSubsettedFont(InstanceID: Integer; SubsetChars: PWideChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.UpdateTrueTypeSubsettedFont(InstanceList[I].GetWideString(SubsetChars));
  End
  Else
    Result := 0;
End;

Function DLUpdateTrueTypeSubsettedFontA(InstanceID: Integer; SubsetChars: PAnsiChar): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.UpdateTrueTypeSubsettedFont(InstanceList[I].GetWideStringFromAnsi(SubsetChars));
  End
  Else
    Result := 0;
End;

Function DLUseKerning(InstanceID, Kern: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.UseKerning(Kern);
  End
  Else
    Result := 0;
End;

Function DLUseUnsafeContentStreams(InstanceID, SafetyLevel: Integer): Integer;
Var
  I: Integer;
Begin
  If FindInstance(InstanceID, I) Then
  Begin
    Result := InstanceList[I].PDFlib.UseUnsafeContentStreams(SafetyLevel);
  End
  Else
    Result := 0;
End;

Procedure InitLibrary;
Begin
  CriticalSection := TCriticalSection.Create;
  CriticalSection.Enter;
  Try
    SetLength(InstanceList, 0);
  Finally
    CriticalSection.Leave;
  End;
End;

Procedure FinalizeLibrary;
Begin
  CriticalSection.Enter;
  Try
    While Length(InstanceList) > 0 Do
    Begin
      If Assigned(InstanceList[Length(InstanceList) - 1]) Then
        InstanceList[Length(InstanceList) - 1].Free;
      SetLength(InstanceList, Length(InstanceList) - 1);
    End;
  Finally
    CriticalSection.Leave;
  End;
  CriticalSection.Free;
End;

End.
