Foxit Developer Blog

    Insights, tutorials, and updates from the Foxit PDF SDK engineering team.

    Foxit WebPDF Viewer - Discontinued

    Does Foxit WebPDF Viewer support Docker deployments?

    Yes, Foxit WebPDF Viewer supports Docker deployments. A Docker Image for WebPDF Viewer is provided in the Docker Hub public repository: https://hub.docker.com/r/foxitsoftware/webpdf/ Note: This article refers to a deprecated version of a Foxit Product. If you are still using Foxit WebPDF Viewer, please refer to your download package documents for Developer Guide and API Reference. [...]

    Read Article
    Foxit PDF SDK 5.3

    Why the length of the string retrieved from interface FSPDF_TextPage_GetChars is different from the count of characters getting from interface FSPDF_TextPage_CountChars?

    The string retrieved from interface FSPDF_TextPage_GetChars is a UTF-8 string. The interface FSPDF_TextPage_CountChars gets the count of characters in a page. “The length of string” and “the count of characters” are two totally different concepts. The length of a UTF-8 string represents how many bytes the UTF-8 string consumes, rather than how many characters the [...]

    Read Article
    Foxit PDF SDK 5.3

    How can I rotate a text object around its center instead of the origin of coordinates?

    Figure 1(a) shows the rotation of a text object around the origin of coordinates in Foxit PDF SDK. If we want to rotate a text object around its center as shown in Figure 1(b), a set of complex transformations are needed. The complete transformation process is shown in Figure 2. First, translate the center of [...]

    Read Article
    Foxit PDF SDK 5.3

    How to render only part of a PDF page?

    To render only part of a PDF page, the key point is to ensure that the rendering page size is larger than the device’s display area. Contents that are not on the display area will not be rendered. Foxit PDF SDK provides the interface FSPDF_Page_GetMatrix to get page’s transformation matrix which can be used for [...]

    Read Article
    Foxit WebPDF Viewer - Discontinued

    Why Eclipse reports “The method getTextContent() is undefined” always in org.w3c.dom.Node class when running webpdf-extension-sample project?

    The project uses dom4j->xml-apis, it calls node class from dom4j but not from JDK. So it reports node class error. To solve the problem, right click properties of the project, select builder path, and then move the JDK up to maven dependencies, it will call the node class from JDK. The error will disappear. Note: [...]

    Read Article
    Foxit PDF SDK 5.3

    Why the length of the string retrieved from interface FSPDF_TextPage_GetChars is different from the count of characters getting from interface FSPDF_TextPage_CountChars?

    The string retrieved from interface FSPDF_TextPage_GetChars is a UTF-8 string. The interface FSPDF_TextPage_CountChars gets the count of characters in a page. “The length of string” and “the count of characters” are two totally different concepts. The length of a UTF-8 string represents how many bytes the UTF-8 string consumes, rather than how many characters the [...]

    Read Article
    Foxit PDF SDK 5.3

    Why can’t I get the desired filling color if the bitmap format is not ARGB or RGB or if the bitmap contains alpha channel when using the interface FSCRT_Bitmap_FillRect?

    Before SDK 4.4 version, there exist two bugs when using the interface FSCRT_Bitmap_FillRect to fill a bitmap object with a specified color. FSCRT_Bitmap_FillRect just only receives the color format of ARGB, but it does not judge the format of the bitmap and treats all bitmap formats as ARGB. So, users cannot get the desired filling [...]

    Read Article
    Foxit PDF SDK 5.3

    How can I display fonts correctly?

    Foxit PDF SDK provides the interface of FSCRT_Library_AddFontFile or FSCRT_Library_SetFontMapperHandler to display fonts. Following is a sample to show how to use FSCRT_Library_SetFontMapperHandler in C++. static FSCRT_FONTMAPPERHANDLER ExternalFontMapper; static string FallbackFontPath; // MapExternalFont function will be triggered when an external font is needed. static FS_RESULT MapExternalFont(FS_LPVOID clientData, FS_LPCSTR fontName, FS_DWORD fontStyles, FS_INT32 weight, FS_INT32 charset, [...]

    Read Article
    Foxit PDF SDK 5.3

    What is the role of the interface FSPDF_Doc_InitiateJavaScript? And why would it destroy the form actions when calling the interface FSPDF_Doc_InitiateJavaScript before FSPDF_Doc_SetActionHandler?

    FSPDF_Doc_InitiateJavaScript is mainly used for initiating javascript, such as a series of javascript functions and global variables that are stated by users. When opening a document, we should call this interface to initiate javascript, which may generate other actions that need support from external application. So the interface FSPDF_Doc_InitiateJavaScript should be called after FSPDF_Doc_SetActionHandler. Otherwise, [...]

    Read Article
    Foxit PDF SDK 5.3

    What is the relationship between FSPDF_FORM and FSPDF_FORMCONTROL? What about FSPDF_FORMCONTROL and FSCRT_ANNOT?

    One PDF Form (FSPDF_FORM) can contain more than one Form Field, and one Form Field can contain more than one Form Control (FSPDF_ FORMCONTROL). Form Control (FSPDF_ FORMCONTROL) and Annotation (FSCRT_ANNOT) belong to the type of “annotation”. The difference is that FSPDF_ FORMCONTROL denotes the “widget” annotations, and FSCRT_ANNOT denotes other annotations which are not [...]

    Read Article