forum-msg-id-131977-edit

Original date:2018-02-21 11:48:58 Edited by: ghaberek Subject: wrapper for pdfium

hi, my second wrapper. it is for pdfium?- you can get the dll (32/64) easy, if you make an vs c project and import them with nuget. i use that for creating and reading pdf's. the libs are also available for linux etc. as far as i know.

i left the ugly comments in there, so that one has kind of a reference. my be some can use that.

include std/dll.e 
include std/machine.e 
include std/math.e 
 
-- CCopyright 2014 PDFium Authors. All rights reserved. 
-- Use of this source code is governed by a BSD-style license that can be 
-- found in the LICENSE file. 
-- Original code copyright 2014 Foxit Software Inc. http:--www.foxitsoftware.com 
-- NOTE: External docs refer to this file as "fpdfview.h", so do not rename 
-- despite lack of consistency with other public files. 
 
/* 
Macro FPDF_ARGB(a, r, g, b) 
    ((((b) & 0xff) | (((g) & 0xff) << 8) | (((r) & 0xff) << 16) | (((a) & 0xff) << 24))) 
EndMacro 
 
Macro  FPDF_GetBValue(argb)  
  argb 
EndMacro 
Macro FPDF_GetGValue(argb)  
  ((argb)) >> 8) 
EndMacro 
Macro FPDF_GetRValue(argb)  
  ((argb) >> 16) 
EndMacro 
Macro FPDF_GetAValue(argb)  
  ((argb) >> 24) 
EndMacro 
*/ 
 
 
-- PDF_USE_XFA is set in confirmation that this version of PDFium can support 
-- XFA forms as requested by the PDF_ENABLE_XFA setting. 
public constant PDF_USE_XFA = 1 
-- Policy for accessing the local machine time. 
public constant FPDF_POLICY_MACHINETIME_ACCESS = 0 
public constant FPDF_ERR_SUCCESS = 0    -- No error. 
public constant FPDF_ERR_UNKNOWN = 1    -- Unknown error. 
public constant FPDF_ERR_FILE    = 2    -- File not found or could not be opened. 
public constant FPDF_ERR_FORMAT  = 3    -- File not in PDF format or corrupted. 
public constant FPDF_ERR_PASSWORD = 4   -- Password required or incorrect password. 
public constant FPDF_ERR_SECURITY = 5   -- Unsupported security scheme. 
public constant FPDF_ERR_PAGE    = 6    -- Page not found or content error. 
public constant FPDF_ERR_XFALOAD = 7    -- Load XFA error. 
public constant FPDF_ERR_XFALAYOUT = 8  -- Layout XFA error. 
-- Page rendering flags. They can be combined with bit-wise OR. 
-- 
-- Set if annotations are to be rendered. 
public constant FPDF_ANNOT = 0x01 
-- Set if using text rendering optimized for LCD display. 
public constant FPDF_LCD_TEXT = 0x02 
-- Don't use the native text output available on some platforms 
public constant FPDF_NO_NATIVETEXT = 0x04 
-- Grayscale output. 
public constant FPDF_GRAYSCALE = 0x08 
-- Set if you want to get some debug info. 
public constant FPDF_DEBUG_INFO = 0x80 
-- Set if you don't want to catch exceptions. 
public constant FPDF_NO_CATCH = 0x100 
-- Limit image cache size. 
public constant FPDF_RENDER_LIMITEDIMAGECACHE = 0x200 
-- Always use halftone for image stretching. 
public constant FPDF_RENDER_FORCEHALFTONE = 0x400 
-- Render for printing. 
public constant FPDF_PRINTING = 0x800 
-- Set to disable anti-aliasing on text. 
public constant FPDF_RENDER_NO_SMOOTHTEXT = 0x1000 
-- Set to disable anti-aliasing on images. 
public constant FPDF_RENDER_NO_SMOOTHIMAGE = 0x2000 
-- Set to disable anti-aliasing on paths. 
public constant FPDF_RENDER_NO_SMOOTHPATH = 0x4000 
-- Set whether to render in a reverse Byte order, this flag is only used when rendering to a bitmap. 
public constant FPDF_REVERSE_BYTE_ORDER = 0x10 
 
-- More DIB formats 
-- Gray scale bitmap, one byte per pixel. 
public constant FPDFBitmap_Gray = 1 
-- 3 bytes per pixel, byte order: blue, green, red. 
public constant FPDFBitmap_BGR = 2 
-- 4 bytes per pixel, byte order: blue, green, red, unused. 
public constant FPDFBitmap_BGRx = 3 
-- 4 bytes per pixel, byte order: blue, green, red, alpha. 
public constant FPDFBitmap_BGRA = 4 
 
public constant PDF_LINEARIZATION_UNKNOWN = -1 
public constant PDF_NOT_LINEARIZED = 0 
public constant PDF_LINEARIZED = 1 
 
public constant PDF_DATA_ERROR = -1 
public constant PDF_DATA_NOTAVAIL = 0 
public constant PDF_DATA_AVAIL = 1 
 
public constant PDF_FORM_ERROR = -1 
public constant PDF_FORM_NOTAVAIL = 0 
public constant PDF_FORM_AVAIL = 1 
public constant PDF_FORM_NOTEXIST = 2 
 
-- Unsupported action type. 
public constant PDFACTION_UNSUPPORTED = 0 
-- Go to a destination within current document. 
public constant PDFACTION_GOTO = 1 
-- Go to a destination within another document. 
public constant PDFACTION_REMOTEGOTO = 2 
-- URI, including web pages and other Internet resources. 
public constant PDFACTION_URI = 3 
-- Launch an application or open a file. 
public constant PDFACTION_LAUNCH = 4 
 
-- The page object constants. 
public constant FPDF_PAGEOBJ_TEXT = 1 
public constant FPDF_PAGEOBJ_PATH = 2 
public constant FPDF_PAGEOBJ_IMAGE = 3 
public constant FPDF_PAGEOBJ_SHADING = 4 
public constant FPDF_PAGEOBJ_FORM = 5 
 
-- Unsupported XFA form. 
public constant FPDF_UNSP_DOC_XFAFORM = 1 
-- Unsupported portable collection. 
public constant FPDF_UNSP_DOC_PORTABLECOLLECTION = 2 
-- Unsupported attachment. 
public constant FPDF_UNSP_DOC_ATTACHMENT = 3 
-- Unsupported security. 
public constant FPDF_UNSP_DOC_SECURITY = 4 
-- Unsupported shared review. 
public constant FPDF_UNSP_DOC_SHAREDREVIEW = 5 
-- Unsupported shared form, acrobat. 
public constant FPDF_UNSP_DOC_SHAREDFORM_ACROBAT = 6 
-- Unsupported shared form, filesystem. 
public constant FPDF_UNSP_DOC_SHAREDFORM_FILESYSTEM = 7 
-- Unsupported shared form, email. 
public constant FPDF_UNSP_DOC_SHAREDFORM_EMAIL = 8 
-- Unsupported 3D annotation. 
public constant FPDF_UNSP_ANNOT_3DANNOT = 11 
-- Unsupported movie annotation. 
public constant FPDF_UNSP_ANNOT_MOVIE = 12 
-- Unsupported sound annotation. 
public constant FPDF_UNSP_ANNOT_SOUND = 13 
-- Unsupported screen media annotation. 
public constant FPDF_UNSP_ANNOT_SCREEN_MEDIA = 14 
-- Unsupported screen rich media annotation. 
public constant FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA = 15 
-- Unsupported attachment annotation. 
public constant FPDF_UNSP_ANNOT_ATTACHMENT = 16 
-- Unsupported signature annotation. 
public constant FPDF_UNSP_ANNOT_SIG = 17 
 
-- Unknown page mode. 
public constant PAGEMODE_UNKNOWN = -1 
-- Document outline, and thumbnails hidden. 
public constant PAGEMODE_USENONE = 0 
-- Document outline visible. 
public constant PAGEMODE_USEOUTLINES = 1 
-- Thumbnail images visible. 
public constant PAGEMODE_USETHUMBS = 2 
-- Full-screen mode, no menu bar, window controls, or other decorations visible. 
public constant PAGEMODE_FULLSCREEN = 3 
-- Optional content group panel visible. 
public constant PAGEMODE_USEOC = 4 
-- Attachments panel visible. 
public constant PAGEMODE_USEATTACHMENTS = 5 
 
-- Flatten operation failed. 
public constant FLATTEN_FAIL = 0 
-- Flatten operation succeed. 
public constant FLATTEN_SUCCESS = 1 
-- Nothing to be flattened. 
public constant FLATTEN_NOTHINGTODO = 2 
 
-- Flatten for normal display. 
public constant FLAT_NORMALDISPLAY = 0 
-- Flatten for print. 
public constant FLAT_PRINT = 1 
 
public constant DOCTYPE_PDF = 0          -- Normal pdf Document 
public constant DOCTYPE_DYNAMIC_XFA = 1  -- Dynamic xfa Document Type 
public constant DOCTYPE_STATIC_XFA = 2   -- Static xfa Document Type 
 
-- Flags for Cursor type 
public constant FXCT_ARROW = 0 
public constant FXCT_NESW = 1 
public constant FXCT_NWSE = 2 
public constant FXCT_VBEAM = 3 
public constant FXCT_HBEAM = 4 
public constant FXCT_HAND = 5 
 
-- XFA 
-- Pageview  event flags 
-- After a new pageview is added. 
public constant FXFA_PAGEVIEWEVENT_POSTADDED = 1 
-- After a pageview is removed. 
public constant FXFA_PAGEVIEWEVENT_POSTREMOVED = 3 
 
-- menu 
-- Macro Definitions For Right Context Menu Features Of XFA Fields 
public constant FXFA_MENU_COPY = 1 
public constant FXFA_MENU_CUT = 2 
public constant FXFA_MENU_SELECTALL = 4 
public constant FXFA_MENU_UNDO = 8 
public constant FXFA_MENU_REDO = 16 
public constant FXFA_MENU_PASTE = 32 
 
-- file type 
-- Macro Definitions For File Type. 
public constant FXFA_SAVEAS_XML = 1 
public constant FXFA_SAVEAS_XDP = 2 
 
-- additional actions type of document. 
public constant FPDFDOC_AACTION_WC = 0x10  -- WC, before closing document, JavaScript action. 
public constant FPDFDOC_AACTION_WS = 0x11  -- WS, before saving document, JavaScript action. 
public constant FPDFDOC_AACTION_DS = 0x12  -- DS, after saving document, JavaScript action. 
public constant FPDFDOC_AACTION_WP = 0x13  -- WP, before printing document, JavaScript action. 
public constant FPDFDOC_AACTION_DP = 0x14  -- DP, after printing document, JavaScript action. 
 
-- Additional-action types of page object 
public constant FPDFPAGE_AACTION_OPEN = 0  -- /O -- An action to be performed when the page is opened 
public constant FPDFPAGE_AACTION_CLOSE = 1 -- /C -- An action to be performed when the page is closed 
 
-- Field Types 
public constant FPDF_FORMFIELD_UNKNOWN = 0      -- Unknown. 
public constant FPDF_FORMFIELD_PUSHBUTTON = 1   -- push button type. 
public constant FPDF_FORMFIELD_CHECKBOX = 2     -- check box type. 
public constant FPDF_FORMFIELD_RADIOBUTTON = 3  -- radio button type. 
public constant FPDF_FORMFIELD_COMBOBOX = 4     -- combo box type. 
public constant FPDF_FORMFIELD_LISTBOX = 5      -- list box type. 
public constant FPDF_FORMFIELD_TEXTFIELD = 6    -- text field type. 
public constant FPDF_FORMFIELD_XFA = 7          -- text field type. 
 
-- Flags for progressive process status. 
public constant FPDF_RENDER_READER = 0 
public constant FPDF_RENDER_TOBECOUNTINUED = 1 
public constant FPDF_RENDER_DONE = 2 
public constant FPDF_RENDER_FAILED = 3 
 
-- Incremental. 
public constant FPDF_INCREMENTAL = 1 
-- No Incremental. 
public constant FPDF_NO_INCREMENTAL = 2 
-- Remove security. 
public constant FPDF_REMOVE_SECURITY = 3 
 
-- Character sets For the font 
public constant FXFONT_ANSI_CHARSET = 0 
public constant FXFONT_DEFAULT_CHARSET = 1 
public constant FXFONT_SYMBOL_CHARSET = 2 
public constant FXFONT_SHIFTJIS_CHARSET = 128 
public constant FXFONT_HANGEUL_CHARSET = 129 
public constant FXFONT_GB2312_CHARSET = 134 
public constant FXFONT_CHINESEBIG5_CHARSET = 136 
 
-- Font pitch And family flags 
public constant FXFONT_FF_FIXEDPITCH = 1 
public constant FXFONT_FF_ROMAN = shift_bits(1, -4) 
public constant FXFONT_FF_SCRIPT = shift_bits(4, -4) 
 
-- Typical weight values 
public constant FXFONT_FW_NORMAL = 400 
public constant FXFONT_FW_BOLD = 700 
 
-- Flags used by FPDFText_FindStart function. 
public constant FPDF_MATCHCASE = 0x00000001  -- If not set, it will not match case by default. 
public constant FPDF_MATCHWHOLEWORD = 0x00000002  -- If not set, it will not match the whole word by default. 
 
 
-- PDF types 
-- typedef void* FPDF_ACTION-- 
-- typedef void* FPDF_BITMAP-- 
-- typedef void* FPDF_BOOKMARK-- 
-- typedef void* FPDF_CLIPPATH-- 
-- typedef void* FPDF_DEST-- 
-- typedef void* FPDF_DOCSCHHANDLE-- 
-- typedef void* FPDF_DOCUMENT-- 
-- typedef void* FPDF_FONT-- 
-- typedef void* FPDF_HMODULE-- 
-- typedef void* FPDF_LINK-- 
-- typedef void* FPDF_MODULEMGR-- 
-- typedef void* FPDF_PAGE-- 
-- typedef void* FPDF_PAGELINK-- 
-- typedef void* FPDF_PAGEOBJECT--  -- Page object(text, path, etc) 
-- typedef void* FPDF_PAGERANGE-- 
-- typedef void* FPDF_PATH-- 
-- typedef void* FPDF_RECORDER-- 
-- typedef void* FPDF_SCHHANDLE-- 
-- typedef void* FPDF_TEXTPAGE-- 
-- typedef void* FPDF_STRINGHANDLE-- 
-- typedef void* FPDF_WIDGET-- 
 
-- Basic data types 
-- typedef int FPDF_BOOL-- 
-- typedef int FPDF_ERROR-- 
-- typedef unsigned long FPDF_DWORD-- 
-- typedef float FS_FLOAT-- 
-- typedef void* FPDF_LPVOID-- 
-- typedef void const* FPDF_LPCVOID-- 
-- typedef char const* FPDF_LPCSTR-- 
-- typedef int FPDF_RESULT-- 
 
-- Duplex types 
enum type FPDF_DUPLEXTYPE 
  DuplexUndefined = 0, 
  Simplex, 
  DuplexFlipShortEdge, 
  DuplexFlipLongEdge 
end type 
 
-- String types 
--typedef unsigned short FPDF_WCHAR-- 
--typedef unsigned char const* FPDF_LPCBYTE-- 
 
-- FPDFSDK may use three types of strings: byte string, wide string (UTF-16LE 
-- encoded), and platform dependent string 
--typedef const char* FPDF_BYTESTRING-- 
 
-- FPDFSDK always uses UTF-16LE encoded wide strings, each character uses 2 
-- bytes (except surrogation), with the low byte first. 
--typedef const unsigned short* FPDF_WIDESTRING-- 
 
-- Structure for a byte string. 
-- Note, a byte string commonly means a UTF-16LE formated string. 
/*************************************************************** 
Structure FPDF_BSTR 
  -- String buffer. 
  *str 
  -- Length of the string, in bytes. 
  len.l 
EndStructure 
***************************************************************/ 
public constant SizeOf_FPDF_BSTR = 12 
 
-- For Windows programmers: In most cases it's OK to treat FPDF_WIDESTRING as a 
-- Windows unicode string, however, special care needs to be taken if you 
-- expect to process Unicode larger than 0xffff. 
-- 
-- For Linux/Unix programmers: most compiler/library environments use 4 bytes 
-- for a Unicode character, and you have to convert between FPDF_WIDESTRING and 
-- system wide string by yourself. 
--typedef const char* FPDF_STRING-- 
 
-- Matrix for transformation. 
/*************************************************************** 
Structure FS_MATRIX 
  a.f 
  b.f 
  c.f 
  d.f 
  e.f 
  f.f 
EndStructure 
***************************************************************/ 
public constant SizeOf_FS_MATRIX = 24 
 
-- Rectangle area(float) in device or page coordinate system. 
/*************************************************************** 
Structure FS_RECTF 
  -- The x-coordinate of the left-top corner. 
  left.f 
  -- The y-coordinate of the left-top corner. 
  top.f 
  -- The x-coordinate of the right-bottom corner. 
  right.f 
  -- The y-coordinate of the right-bottom corner. 
  bottom.f 
EndStructure --* FS_LPRECTF, FS_RECTF 
***************************************************************/ 
public constant SizeOf_FS_RECTF = 16 
 
-- Const Pointer to FS_RECTF structure. 
--typedef const FS_RECTF* FS_LPCRECTF-- 
 
-- Process-wide options for initializing the library. 
/*************************************************************** 
Structure FPDF_LIBRARY_CONFIG 
  -- Version number of the interface. Currently must be 2. 
  version.l 
 
  -- Array of paths to scan in place of the defaults when using built-in 
  -- FXGE font loading code. The array is terminated by a NULL pointer. 
  -- The Array may be NULL itself to use the default paths. May be ignored 
  -- entirely depending upon the platform. 
  --*m_pUserFontPaths 
 
  -- Version 2. 
 
  -- pointer to the v8::Isolate to use, or NULL to force PDFium to create one. 
  --m_pIsolate-- 
 
  -- The embedder data slot to use in the v8::Isolate to store PDFium's 
  -- per-isolate data. The value needs to be between 0 and 
  -- v8::Internals::kNumIsolateDataLots (exclusive). Note that 0 is fine 
  -- for most embedders. 
  m_v8EmbedderSlot.l-- 
EndStructure 
***************************************************************/ 
public constant SizeOf_FPDF_LIBRARY_CONFIG = 8 
 
 
-- Prototype.i m_GetBlock(*param, position.i, *pBuf, size.i) 
 
 
-- Structure for custom file access. 
/*************************************************************** 
Structure FPDF_FILEACCESS 
  -- File length, in bytes. 
  m_FileLen.i 
 
  -- A function pointer for getting a block of data from a specific position. 
  -- Position is specified by byte offset from the beginning of the file. 
  -- The position and size will never go out of range of the file length. 
  -- It may be possible for FPDFSDK to call this function multiple times for 
  -- the same position. 
  -- Return value: should be non-zero if successful, zero for error. 
  fptr.m_GetBlock --Int (*m_GetBlock)(void* param, unsigned long position, unsigned char* pBuf, unsigned long size)-- 
 
  -- A custom pointer for all implementation specific data.  This pointer will 
  -- be used as the first parameter to the m_GetBlock callback. 
  *m_Param-- 
EndStructure 
***************************************************************/ 
public constant SizeOf_FPDF_FILEACCESS = 24 
 
 
 
-- Prototype   Release(*clientData) 
-- Prototype.l GetSize(*clientData) 
-- Prototype.l ReadBlock(*clientData, offset.i, *buffer, size.i) 
-- Prototype.l WriteBlock(*clientData, offset.i, *buffer, size.i) 
-- Prototype.l Flush(*clientData) 
-- Prototype.l Truncate(*clientData, size.i) 
 
-- 
-- Structure For file reading Or writing (I/O). 
-- 
-- This is a handler And should be implemented by callers. 
-- 
/*************************************************************** 
Structure FPDF_FILEHANDLER 
  -- 
  -- User-defined Data. 
  -- Callers can use this field To track controls. 
  -- 
  --clientData-- 
  -- 
  -- Callback function To release the current file stream object. 
  -- param[in] clientData    Pointer To user-defined Data. 
  -- return None. 
  -- 
  fptr0.Release --void (*Release)(FPDF_LPVOID clientData)-- 
  -- 
  -- Callback function To retrieve the current file stream size. 
  -- param[in] clientData    Pointer To user-defined Data. 
  -- return Size of file stream. 
  -- 
  fptr1.GetSize --FPDF_DWORD (*GetSize)(FPDF_LPVOID clientData) 
  -- 
  -- Callback function To Read Data from the current file stream. 
  -- param[in]   clientData  Pointer To user-defined Data. 
  -- param[in]   offset      Offset position starts from the beginning of file stream. This parameter indicates reading position. 
  -- param[in]   buffer      Memory buffer To store Data which are Read from file stream. This parameter should Not be <b>NULL</b>. 
  -- param[in]   size        Size of Data which should be Read from file stream, in bytes. The buffer indicated by the parameter <i>buffer</i> 
  --                         should be enough To store specified Data. 
  -- return 0 For success, other value For failure. 
  -- 
  fptr2.ReadBlock --(*ReadBlock)(FPDF_LPVOID clientData, FPDF_DWORD offset, FPDF_LPVOID buffer, FPDF_DWORD size) 
  -- 
  -- Callback function To write Data into the current file stream. 
  -- param[in]   clientData  Pointer To user-defined Data. 
  -- param[in]   offset      Offset position starts from the beginning of file stream. This parameter indicates writing position. 
  -- param[in]   buffer      Memory buffer contains Data which is written into file stream. This parameter should Not be <b>NULL</b>. 
  -- param[in]   size        Size of Data which should be written into file stream, in bytes. 
  -- return 0 For success, other value For failure. 
  -- 
  fptr3.WriteBlock --FPDF_RESULT (*WriteBlock)(FPDF_LPVOID clientData, FPDF_DWORD offset, FPDF_LPCVOID buffer, FPDF_DWORD size)-- 
  -- 
  -- Callback function To flush all internal accessing buffers. 
  -- param[in]   clientData  Pointer To user-defined Data. 
  -- return 0 For success, other value For failure. 
  -- 
  fptr4.Flush --FPDF_RESULT (*Flush)(FPDF_LPVOID clientData)-- 
  -- 
  -- Callback function To change file size. details This function is called under writing mode usually. Implementer can determine whether To realize it based on application requests. 
  -- param[in]   clientData  Pointer To user-defined Data. 
  -- param[in]   size        New size of file stream, in bytes. 
  -- return 0 For success, other value For failure. 
  -- 
  fptr5.Truncate --FPDF_RESULT (*Truncate)(FPDF_LPVOID clientData, FPDF_DWORD size)-- 
EndStructure -- FPDF_FILEHANDLER,--FPDF_LPFILEHANDLER-- 
***************************************************************/ 
public constant SizeOf_FPDF_FILEHANDLER = 48 
 
---------------------------------------------------------------------------------------------------------------------------------- 
-- prototype.l IsDataAvail(*pThis.FX_FILEAVAIL, offset.i, size.i) 
---------------------------------------------------------------------------------------------------------------------------------- 
-- Prototype.l IsDataAvail(*pThis, offset.i, size.i) 
 
-- Interface for checking whether sections of the file are available. 
/*************************************************************** 
Structure FX_FILEAVAIL 
  -- Version number of the interface. Must be 1. 
  version.l 
 
  -- Reports if the specified data section is currently available. A section is 
  -- available if all bytes in the section are available. 
  -- 
  -- Interface Version: 1 
  -- Implementation Required: Yes 
  -- 
  --   pThis  - pointer to the interface structure. 
  --   offset - the offset of the data section in the file. 
  --   size   - the size of the data section. 
  -- 
  -- Returns true if the specified data section at |offset| of |size| 
  -- is available. 
  fptr.IsDataAvail -- FPDF_BOOL (*IsDataAvail)(structure _FX_FILEAVAIL* pThis, size_t offset, size_t size)-- 
EndStructure --FX_FILEAVAIL 
--typedef void* FPDF_AVAIL-- 
***************************************************************/ 
public constant SizeOf_FX_FILEAVAIL = 12 
 
---------------------------------------------------------------------------------------------------------------------------------- 
--prototype AddSegment(*pThis.FX_DOWNLOADHINTS, offset.i, size.i) 
---------------------------------------------------------------------------------------------------------------------------------- 
-- Prototype AddSegment(*pThis, offset.i, size.i) 
-- Download hints interface. Used to receive hints for further downloading. 
/*************************************************************** 
Structure FX_DOWNLOADHINTS 
  -- Version number of the interface. Must be 1. 
  version.l 
 
  -- Add a section to be downloaded. 
  -- 
  -- Interface Version: 1 
  -- Implementation Required: Yes 
  -- 
  --   pThis  - pointer to the interface structure. 
  --   offset - the offset of the hint reported to be downloaded. 
  --   size   - the size of the hint reported to be downloaded. 
  -- 
  -- The |offset| and |size| of the section may not be unique. Part of the 
  -- section might be already available. The download manager must deal with 
  -- overlapping sections. 
  fptr.AddSegment-- void (*AddSegment)(structure _FX_DOWNLOADHINTS* pThis, size_t offset, size_t size)-- 
EndStructure 
***************************************************************/ 
public constant SizeOf_FX_DOWNLOADHINTS = 12 
 
 
/*************************************************************** 
Structure FS_QUADPOINTSF 
  x1.f 
  y1.f 
  x2.f 
  y2.f 
  x3.f 
  y3.f 
  x4.f 
  y4.f 
EndStructure 
***************************************************************/ 
public constant SizeOf_FS_QUADPOINTSF = 32 
 
---------------------------------------------------------------------------------------------------------------------------------- 
--prototype FSDK_UnSupport_Handler(*pThis.UNSUPPORT_INFO, nType.l) 
---------------------------------------------------------------------------------------------------------------------------------- 
-- Prototype FSDK_UnSupport_Handler(*pThis, nType.l) 
 
-- Interface for unsupported feature notifications. 
/*************************************************************** 
Structure UNSUPPORT_INFO 
  -- Version number of the interface. Must be 1. 
  version.l 
 
  -- Unsupported object notification function. 
  -- Interface Version: 1 
  -- Implementation Required: Yes 
  -- 
  --   pThis - pointer to the interface structure. 
  --   nType - the type of unsupported object. One of the |FPDF_UNSP_*| entries. 
  fptr.FSDK_UnSupport_Handler -- void (*FSDK_UnSupport_Handler)(structure _UNSUPPORT_INFO* pThis, int nType)-- 
EndStructure 
***************************************************************/ 
public constant SizeOf_UNSUPPORT_INFO = 12 
 
--typedef void* FPDF_FORMHANDLE-- 
 
-- -- Prototype.l app_alert(*pThis.IPDF_JsPlatform, *Msg.string, *Title.string, Type.l, Icon.l)-- 
-- -- Prototype app_beep(*pThis.IPDF_JsPlatform, nType.l) 
-- -- Prototype.l app_response(*pThis.IPDF_JsPlatform, *Question.string, *Title.string, *Default.string, *cLabel.string, bPassword.l, void* response, int length) 
-- -- Prototype.l Doc_getFilePath(*pThis.IPDF_JsPlatform, *filePath, length.l) 
-- -- Prototype Doc_mail(*pThis.IPDF_JsPlatform, *mailData, length.l, bUI.l, *To.string, *Subject.string, *CC.string, *BCC.string, *Msg.string) 
-- -- Prototype Doc_print(*pThis.IPDF_JsPlatform, bUI.l, nStart.l, int nEnd, bSilent.l, bShrinkToFit.l, bPrintAsImage.l, bReverse.l, bAnnotations.l)-- 
-- -- Prototype Doc_submitForm(*pThis.IPDF_JsPlatform, *formData, length.l, *URL.string) 
-- -- Prototype Doc_gotoPage(*pThis.IPDF_JsPlatform, nPageNum.l) 
-- -- Prototype.l Field_browse(*pThis.IPDF_JsPlatform, *filePath, length.l) 
 
-- Prototype.l app_alert(*pThis, *Msg.string, *Title.string, Type.l, Icon.l)-- 
-- Prototype app_beep(*pThis, nType.l) 
-- Prototype.l app_response(*pThis, *Question.string, *Title.string, *Default.string, *cLabel.string, bPassword.l, *response, length.l) 
-- Prototype.l Doc_getFilePath(*pThis, *filePath, length.l) 
-- Prototype Doc_mail(*pThis, *mailData, length.l, bUI.l, *To.string, *Subject.string, *CC.string, *BCC.string, *Msg.string) 
-- Prototype Doc_print(*pThis, bUI.l, nStart.l, nEnd.l, bSilent.l, bShrinkToFit.l, bPrintAsImage.l, bReverse.l, bAnnotations.l) 
-- Prototype Doc_submitForm(*pThis, *formData, length.l, *URL.string) 
-- Prototype Doc_gotoPage(*pThis, nPageNum.l) 
-- Prototype.l Field_browse(*pThis, *filePath, length.l) 
 
/*************************************************************** 
Structure IPDF_JSPLATFORM --IPDF_JsPlatform 
  -- 
  -- Version number of the Interface. Currently must be 2. 
  -- 
  version.l 
 
  -- Version 1. 
 
  -- 
  -- Method: app_alert 
  --           pop up a dialog To show warning Or hint. 
  -- Interface Version: 
  --           1 
  -- Implementation Required: 
  --           yes 
  -- Parameters: 
  --           pThis       -   Pointer To the Interface Structure itself 
  --           Msg         -   A string containing the message To be displayed. 
  --           Title       -   The title of the dialog. 
  --           Type        -   The stype of button group. 
  --                           0-OK(Default)-- 
  --                           1-OK,Cancel-- 
  --                           2-Yes,NO-- 
  --                           3-Yes, NO, Cancel. 
  --           nIcon       -   The Icon type. 
  --                           0-Error(Default)-- 
  --                           1-Warning-- 
  --                           2-Question-- 
  --                           3-Status. 
  --                           4-Asterisk 
  -- Return Value: 
  --           The Return value could be the folowing type: 
  --                           1-OK-- 
  --                           2-Cancel-- 
  --                           3-NO-- 
  --                           4-Yes-- 
  -- 
  fptr.app_alert  --Int (*app_alert)(structure _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type, int Icon)-- 
 
  -- 
  -- Method: app_beep 
  --           Causes the system To play a sound. 
  -- Interface Version: 
  --           1 
  -- Implementation Required: 
  --           yes 
  -- Parameters: 
  --           pThis       -   Pointer To the Interface Structure itself 
  --           nType       -   The sound type. 
  --                           0 - Error 
  --                           1 - Warning 
  --                           2 - Question 
  --                           3 - Status 
  --                           4 - Default (Default value) 
  -- Return Value: 
  --           None 
  -- 
  fptr1.app_beep -- void (*app_beep)(structure _IPDF_JsPlatform* pThis, int nType)-- 
 
  -- 
  -- Method: app_response 
  --           Displays a dialog box containing a question And an entry field For 
  -- the user To reply To the question. 
  -- Interface Version: 
  --           1 
  -- Implementation Required: 
  --           yes 
  -- Parameters: 
  --           pThis       -   Pointer To the Interface Structure itself 
  --           Question    -   The question To be posed To the user. 
  --           Title       -   The title of the dialog box. 
  --           Default     -   A Default value For the answer To the question. If 
  -- Not specified, no Default value is presented. 
  --           cLabel      -   A short string To appear in front of And on the 
  -- same line As the edit text field. 
  --           bPassword   -   If true, indicates that the user's response should 
  -- show As asterisks (*) Or bullets (?) To mask the response, which might be 
  -- sensitive information. The Default is false. 
  --           response    -   A string buffer allocated by SDK, To receive the 
  -- user's response. 
  --           length      -   The length of the buffer, number of bytes. 
  -- Currently, It's always be 2048. 
  -- Return Value: 
  --       Number of bytes the complete user input would actually require, Not 
  -- including trailing zeros, regardless of the value of the length 
  --       parameter Or the presence of the response buffer. 
  -- Comments: 
  --       No matter on what platform, the response buffer should be always 
  -- written using UTF-16LE encoding. If a response buffer is 
  --       present And the size of the user input exceeds the capacity of the 
  -- buffer As specified by the length parameter, only the 
  --       first "length" bytes of the user input are To be written To the 
  -- buffer. 
  -- 
  fptr2.app_response -- Int (*app_response)(structure _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Question, FPDF_WIDESTRING Title, FPDF_WIDESTRING Default, FPDF_WIDESTRING cLabel, FPDF_BOOL bPassword, void* response, int length)-- 
 
  -- 
  -- Method: Doc_getFilePath 
  --           Get the file path of the current document. 
  -- Interface Version: 
  --           1 
  -- Implementation Required: 
  --           yes 
  -- Parameters: 
  --           pThis       -   Pointer To the Interface Structure itself 
  --           filePath    -   The string buffer To receive the file path. Can be 
  -- NULL. 
  --           length      -   The length of the buffer, number of bytes. Can be 
  -- 0. 
  -- Return Value: 
  --       Number of bytes the filePath consumes, including trailing zeros. 
  -- Comments: 
  --       The filePath should be always input in local encoding. 
  -- 
  --       The Return value always indicated number of bytes required For the 
  -- buffer, even when there is 
  --       no buffer specified, Or the buffer size is less then required. In this 
  -- Case, the buffer will Not 
  --       be modified. 
  -- 
  fptr3.Doc_getFilePath  -- Int (*Doc_getFilePath)(structure _IPDF_JsPlatform* pThis, void* filePath, int length)-- 
 
  -- 
  -- Method: Doc_mail 
  --           Mails the Data buffer As an attachment To all recipients, With Or 
  -- without user interaction. 
  -- Interface Version: 
  --           1 
  -- Implementation Required: 
  --           yes 
  -- Parameters: 
  --           pThis       -   Pointer To the Interface Structure itself 
  --           mailData    -   Pointer To the Data buffer To be sent.Can be NULL. 
  --           length      -   The size,in bytes, of the buffer pointed by 
  -- mailData parameter.Can be 0. 
  --           bUI         -   If true, the rest of the parameters are used in a 
  -- compose-new-message window that is displayed To the user. If false, the cTo 
  -- parameter is required And all others are optional. 
  --           To          -   A semicolon-delimited List of recipients For the 
  -- message. 
  --           Subject     -   The subject of the message. The length limit is 64 
  -- KB. 
  --           CC          -   A semicolon-delimited List of CC recipients For 
  -- the message. 
  --           BCC         -   A semicolon-delimited List of BCC recipients For 
  -- the message. 
  --           Msg         -   The content of the message. The length limit is 64 
  -- KB. 
  -- Return Value: 
  --           None. 
  -- Comments: 
  --           If the parameter mailData is NULL Or length is 0, the current 
  -- document will be mailed As an attachment To all recipients. 
  -- 
  fptr4.Doc_mail -- void (*Doc_mail)(structure _IPDF_JsPlatform* pThis, void* mailData, int length, FPDF_BOOL bUI, FPDF_WIDESTRING To, FPDF_WIDESTRING Subject, FPDF_WIDESTRING CC, FPDF_WIDESTRING BCC, FPDF_WIDESTRING Msg)-- 
 
  -- 
  -- Method: Doc_print 
  --           Prints all Or a specific number of pages of the document. 
  -- Interface Version: 
  --           1 
  -- Implementation Required: 
  --           yes 
  -- Parameters: 
  --           pThis       -   Pointer To the Interface Structure itself. 
  --           bUI         -   If true, will cause a UI To be presented To the 
  -- user To obtain printing information And confirm the action. 
  --           nStart      -   A 0-based index that defines the start of an 
  -- inclusive range of pages. 
  --           nEnd        -   A 0-based index that defines the End of an 
  -- inclusive page range. 
  --           bSilent     -   If true, suppresses the cancel dialog box While 
  -- the document is printing. The Default is false. 
  --           bShrinkToFit    -   If true, the page is shrunk (If necessary) To 
  -- fit within the imageable area of the printed page. 
  --           bPrintAsImage   -   If true, print pages As an image. 
  --           bReverse    -   If true, print from nEnd To nStart. 
  --           bAnnotations    -   If true (the Default), annotations are 
  -- printed. 
  -- 
  fptr5.Doc_print -- void (*Doc_print)(structure _IPDF_JsPla    
Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu