PDFiumSharp PDF Action Types Unsupported action type. Go to a destination within current document. Go to a destination within another document. URI, including web pages and other Internet resources. Launch an application or open a file. Gray scale bitmap, one byte per pixel. 3 bytes per pixel, byte order: blue, green, red. 4 bytes per pixel, byte order: blue, green, red, unused. 4 bytes per pixel, byte order: blue, green, red, alpha. Flags specifying document permissions. PDF Reference: Table 22 For of 2: Print the document. For of 3 or greater: Print the document (possibly not at the highest quality level, depending on whether is also set). Modify the contents of the document by operations other than those controlled by , and . For of 2: Copy or otherwise extract text and graphics from the document, including extracting text and graphics (in support of accessibility to users with disabilities or for other purposes). For of 3 or greater: Copy or otherwise extract text and graphics from the document by operations other than that controlled by . Add or modify text annotations, fill in interactive form fields, and, if is also set, create or modify interactive form fields (including signature fields). For of 3 or greater: Fill in existing interactive form fields (including signature fields), even if is not set. For of 3 or greater: Extract text and graphics (in support of accessibility to users with disabilities or for other purposes). For of 3 or greater: Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if is not set. For of 3 or greater: Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When is not set (and is set), printing is limited to a low-level representation of the appearance, possibly of degraded quality. Flatten for normal display. Flatten for print. Flatten operation failed. Flatten operation succeed. Nothing to be flattened. Unknown page mode. Document outline, and thumbnails hidden. Document outline visible. Thumbnail images visible. Full-screen mode, no menu bar, window controls, or other decorations visible. Optional content group panel visible. Attachments panel visible. Gets the pages in the current . Gets the PDF file version. File version: 14 for 1.4, 15 for 1.5, ... Gets the revision of the security handler. PDF Reference: Table 21 Creates a new . must be called in order to free unmanaged resources. Loads a from the file system. must be called in order to free unmanaged resources. Filepath of the PDF file to load. Loads a from memory. must be called in order to free unmanaged resources. Byte array containing the bytes of the PDF document to load. The index of the first byte to be copied from . The number of bytes to copy from or a negative value to copy all bytes. Loads a from '' bytes read from a . must be called in order to free unmanaged resources. The number of bytes to read from the . If the value is equal to or smaller than 0, the stream is read to the end. Closes the and frees unmanaged resources. Saves the to a . The new PDF file version of the saved file. 14 for 1.4, 15 for 1.5, etc. Values smaller than 10 are ignored. Saves the to the file system. The new PDF file version of the saved file. 14 for 1.4, 15 for 1.5, etc. Values smaller than 10 are ignored. Static class containing the native (imported) PDFium functions. In case of missing documentation, refer to the PDFium header files. Gets a value indicating whether the PDFium library is available. false is returned if the native libraries could not be loaded for some reason. Loads a PDF document from memory. The data to load the document from. The index of the first byte to be copied from . The number of bytes to copy from or a negative value to copy all bytes. Loads a PDF document from '' bytes read from a stream. The number of bytes to read from the . If the value is equal to or smaller than 0, the stream is read to the end. Get the named destination by index. Handle to a document. The index of a named destination. The destination handle and name for a given index, or (, null) if there is no named destination corresponding to . Get the title of . Handle to the bookmark. The title of the bookmark. Gets the file path of a of type or . Handle to the action. Must be of type or . The file path of . Gets URI path of a of type . Handle to the document. Handle to the action. Must be of type . The URI path of . Enumerates all the link annotations in . Handle to the page. All the link annotations in . Get meta-data content from . Handle to the document. The tag to retrieve. The tag can be one of: Title, Author, Subject, Keywords, Creator, Producer, CreationDate, or ModDate. The meta-data. For detailed explanations of these tags and their respective values, please refer to PDF Reference 1.6, section 10.2.1, 'Document Information Dictionary'. PDF Reference Get meta-data content from . Handle to the document. The tag to retrieve. The meta-data. For detailed explanations of these tags and their respective values, please refer to PDF Reference 1.6, section 10.2.1, 'Document Information Dictionary'. PDF Reference Insert into . Handle to a page. Handle to a page object. The will be automatically freed. Load an image from a JPEG image file and then set it into . All loaded pages, may be null. Handle to an image object. Stream which provides access to an JPEG image. The number of bytes to read from or 0 to read to the end. If true, this function loads the JPEG image inline, so the image content is copied to the file. This allows to be closed after this function returns. true on success. The image object might already have an associated image, which is shared and cached by the loaded pages. In that case, we need to clear the cached image for all the loaded pages. Pass to this API to clear the image cache. If the image is not previously shared, null is a valid value. Set to . All loaded pages, may be null. Handle to an image object. Handle of the bitmap. true on success. Returns a font object loaded from a stream of data. The font is loaded into the document. The caller does not need to free the returned object. Handle to the document. A value specifying if the font is a CID font or not. The data, which will be copied by the font object. The index of the first byte to be copied from . The number of bytes to copy from or a negative value to copy all bytes. Returns NULL on failure. Imports pages from to Zero-based index of where the imported pages should be inserted in the destination document. Zero-based indices of the pages to import in the source document Saves a PDF document to a stream. The new PDF file version of the saved file. 14 for 1.4, 15 for 1.5, etc. Values smaller than 10 are ignored. Get the alternative text for a given element. Handle to the struct element. The alternative text for . Initialize the PDFium library Convenience function to call for backwards comatibility purposes. Initialize the PDFium library You have to call this function before you can call any PDF processing functions. Release all resources allocated by the PDFium library. You can call this function to release all memory blocks allocated by the library. After this function is called, you should not call any PDF processing functions. Open and load a PDF document.Path to the PDF file (including extension). A string used as the password for the PDF file. If no password is needed, or null can be used. A handle to the loaded document, or NULL on failure. Loaded document can be closed by . If this function fails, you can use to retrieve the reason why it failed. Open and load a PDF document from memory.Pointer to a buffer containing the PDF document.Number of bytes in the PDF document. A string used as the password for the PDF file. If no password is needed, or null can be used. A handle to the loaded document, or NULL on failure. The memory buffer must remain valid when the document is open. The loaded document can be closed by . If this function fails, you can use to retrieve the reason why it failed. If PDFium is built with the XFA module, the application should call function after the PDF document loaded to support XFA fields defined in the fpdfformfill.h file. Load PDF document from a custom access descriptor.A structure for accessing the file.Optional password for decrypting the PDF file.A handle to the loaded document, or NULL on failure. The application must keep the file resources valid until the PDF document is closed. The loaded document can be closed with FPDF_CloseDocument. If PDFium is built with the XFA module, the application should call function after the PDF document loaded to support XFA fields defined in the fpdfformfill.h file. Get the file version of the given PDF document.Handle to a document.The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...True if succeeds, false otherwise. If the document was created by , then this function will always fail. Get last error code when a function fails. If the previous SDK call succeeded, the return value of this function is not defined. Get total number of pages in the document.Handle to document.Total number of pages in the document. Load a page inside the document.Handle to document.Zero-based index of the page.A handle to the loaded page, or NULL if page load fails.The loaded page can be closed using FPDF_ClosePage. Get page width.Handle to the page. Page width (excluding non-displayable area) measured in points. One point is 1/72 inch (around 0.3528 mm). Get page height.Handle to the page. Page height (excluding non-displayable area) measured in points. One point is 1/72 inch (around 0.3528 mm) Get the size of the page at the given index.Handle to document.Zero-based index of the page.Pointer to a double to receive the page width (in points).Pointer to a double to receive the page height (in points). Render contents of a page to a device independent bitmap. Handle to the device independent bitmap (as the output buffer). The bitmap handle can be created by . Handle to the page.Left pixel position of the display area in bitmap coordinates.Top pixel position of the display area in bitmap coordinates.Horizontal size (in pixels) for displaying the page.Vertical size (in pixels) for displaying the page.Page orientation. for normal display, or combination of the Page Rendering flags defined above. With the flag, it renders all annotations that do not require user-interaction, which are all annotations except widget and popup annotations. Render contents of a page to a device independent bitmap. Handle to the device independent bitmap (as the output buffer). The bitmap handle can be created by . Handle to the page.The transform matrix.The rect to clip to. for normal display, or combination of the Page Rendering flags defined above. With the flag, it renders all annotations that do not require user-interaction, which are all annotations except widget and popup annotations. Close a loaded PDF page.Handle to the loaded page. Close a loaded PDF document.Handle to the loaded document. Create a device independent bitmap (FXDIB).The number of pixels in width for the bitmap. Must be greater than 0. The number of pixels in height for the bitmap. Must be greater than 0.A value indicating whether the alpha channel is used.The bitmap handle, or if parameter error or out of memory. The bitmap always uses 4 bytes per pixel. The first byte is always double word aligned. The byte order is BGRx (the last byte unused if no alpha channel) or BGRA. The pixels in a horizontal line are stored side by side, with the left most pixel stored first (with lower memory address). Each line uses width * 4 bytes. Lines are stored one after another, with the top most line stored first. There is no gap between adjacent lines. This function allocates enough memory for holding all pixels in the bitmap, but it doesn't initialize the buffer. Applications can use to fill the bitmap using any color. Create a device independent bitmap (FXDIB).The number of pixels in width for the bitmap. Must be greater than 0. The number of pixels in height for the bitmap. Must be greater than 0. A pointer to the first byte of the first line if using an external buffer. If this parameter is then the a new buffer will be created. Number of bytes for each scan line, for external buffer only.The bitmap handle, or if parameter error or out of memory. Similar to function, but allows for more formats and an external buffer is supported. The bitmap created by this function can be used in any place that a handle is required. If an external buffer is used, then the application should destroy the buffer by itself. function will not destroy the buffer. Fill a rectangle in a bitmap.The handle to the bitmap.The left position. Starting from 0 at the left-most pixel.The top position. Starting from 0 at the top-most line.Width in pixels to be filled.Height in pixels to be filled. This function sets the color and (optionally) alpha value in the specified region of the bitmap. NOTE: If the alpha channel is used, this function does NOT composite the background with the source color, instead the background will be replaced by the source color and the alpha. If the alpha channel is not used, the alpha parameter is ignored. Get data buffer of a bitmap.Handle to the bitmap as returned by .The pointer to the first byte of the bitmap buffer. The stride may be more than width * number of bytes per pixel Applications can use this function to get the bitmap buffer pointer, then manipulate any color and/or alpha values for any pixels in the bitmap. The data is in BGRA format. Where the A maybe unused if alpha was not specified. Get width of a bitmap.Handle to the bitmap as returned by .The width of the bitmap in pixels. Get height of a bitmap.Handle to the bitmap as returned by .The height of the bitmap in pixels. Get number of bytes for each line in the bitmap buffer.Handle to the bitmap as returned by .The number of bytes for each line in the bitmap buffer.The stride may be more than width * number of bytes per pixel. Destroy a bitmap and release all related buffers.Handle to the bitmap as returned by . This function will not destroy any external buffers provided when the bitmap was created. Whether the PDF document prefers to be scaled or not.Handle to the loaded document. Returns the number of copies to be printed.Handle to the loaded document.The number of copies to be printed. Page numbers to initialize print dialog box when file is printed.Handle to the loaded document.The print page range to be used for printing. Returns the paper handling option to be used when printing from the print dialog.Handle to the loaded document.The paper handling option to be used when printing. Gets the contents for a viewer ref, with a given key. The value must be of type "name".Handle to the loaded document.Name of the key in the viewer pref dictionary.A string to write the contents of the key to.Length of the buffer. The number of bytes in the contents, including the NULL terminator. Thus if the return value is 0, then that indicates an error, such as when |document| is invalid or |buffer| is NULL. If |length| is less than the returned length, or |buffer| is NULL, |buffer| will not be modified. Get the count of named destinations in the PDF document.Handle to the loaded document.The count of named destinations. Get a the destination handle for the given name.Handle to the loaded document.The name of a destination.The handle to the destination. Create a new PDF document.Returns a handle to a new document, or NULL on failure. A bitmap to which a can be rendered. Creates a new . Unmanaged memory is allocated which must be freed by calling . The width of the new bitmap. The height of the new bitmap. A value indicating wheter the new bitmap has an alpha channel. A bitmap created with this overload always uses 4 bytes per pixel. Depending on the is then either or . Creates a new using memory allocated by the caller. The caller is responsible for freeing the memory and that the adress stays valid during the lifetime of the returned . To free unmanaged resources, must be called. The width of the new bitmap. The height of the new bitmap. The format of the new bitmap. The adress of the memory block which holds the pixel values. The number of bytes per image row. Fills a rectangle in the with . The pixel values in the rectangle are replaced and not blended. Fills the whole with . The pixel values in the rectangle are replaced and not blended. Saves the in the BMP file format. Saves the in the BMP file format. Exposes the underlying image data directly as read-only stream in the BMP file format. Gets the page width (excluding non-displayable area) measured in points. One point is 1/72 inch(around 0.3528 mm). Gets the page height (excluding non-displayable area) measured in points. One point is 1/72 inch(around 0.3528 mm). Gets the page width and height (excluding non-displayable area) measured in points. One point is 1/72 inch(around 0.3528 mm). Gets the page orientation. Gets the zero-based index of the page in the Gets the which contains the page. Renders the page to a The bitmap to which the page is to be rendered. The destination rectangle in . The orientation at which the page is to be rendered. The flags specifying how the page is to be rendered. Renders the page to a The bitmap to which the page is to be rendered. The orientation at which the page is to be rendered. The flags specifying how the page is to be rendered. Gets the number of pages in the . Gets the at the zero-based in the . Imports pages of into the current . Imports pages of into the current . Inserts a new page at . Adds a new page to the end of the document. Removes the page at . Removes the from the document. Set if annotations are to be rendered. Set if using text rendering optimized for LCD display. Don't use the native text output available on some platforms Grayscale output. Set if you want to get some debug info. Set if you don't want to catch exceptions. Limit image cache size. Always use halftone for image stretching. Render for printing. Set to disable anti-aliasing on text. Set to disable anti-aliasing on images. Set to disable anti-aliasing on paths. Set whether to render in a reverse Byte order, this flag is only used when rendering to a bitmap. If not set, it will not match case by default. If not set, it will not match the whole word by default. No error. Unknown error. File not found or could not be opened. File not in PDF format or corrupted. Password required or incorrect password. Unsupported security scheme. Page not found or content error. Load XFA error. Layout XFA error. Handle to a FPDF_ACTION Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_BITMAP Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_BOOKMARK Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_CLIPPATH Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_DEST Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_DOCUMENT Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_FONT Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_LINK Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_PAGE Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_PAGELINK Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_PAGEOBJECT Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_PAGERANGE Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_RECORDER Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_SCHHANDLE Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_STRUCTELEMENT Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_STRUCTTREE Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_TEXTPAGE Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_STRINGHANDLE Gets a value indicating whether the handle is null. Gets a handle representing null. Handle to a FPDF_WIDGET Gets a value indicating whether the handle is null. Gets a handle representing null. Handle which can be used with the native functions. Gets a value indicating whether was already called on this instance. Implementors should clean up here. This method is guaranteed to only be called once.