Foxit PDF SDK 5.3

How to display fonts correctly using Foxit PDF SDK?

by Conor Smith | April 5, 2017
To display the fonts correctly, you must use the FSCRT_Library_AddFontFile or use FSCRT_Library_SetFontMapperHandler. Here is how to use FSCRT_Library_SetFontMapperHandler in C++. declare the following structure: static FSCRT_FONTMAPPERHANDLER ExternalFontMapper; static string FallbackFontPath; static FS_RESULT MapExternalFont(FS_LPVOID clientData, FS_LPCSTR fontName, FS_DWORD fontStyles, FS_INT32 weight, FS_INT32 charset, FSCRT_FILE *fontFile, FS_INT32 *faceIndex){ //This call back will trigger when an external […]
Keep reading Keep reading

How to render only a section of a PDF on Foxit PDF SDK?

by Conor Smith | April 5, 2017
Follow the steps outlined below to render a selection of a PDF on Foxit PDF SDK: Change the parameters of FSPDF_Page_GetMatrix before rendering Go to “samples\simple_sample\comm_src\fgsdk_common.cpp” and locate the call for FSPDF_Page_GetMatrix Change the parameters. For example, “FSPDF_Page_GetMatrix(page, -200, -100, (FS_INT32)width*1.5, (FS_INT32)height*3, 0, &mt)” Run the demo at “simple_sample\pdf2img” and look at the output to […]
Keep reading Keep reading

How to fix “error C3861: ‘InitializeCriticalSectionEx’:identifier not found” or “error C3861: ‘FSCRT_Renderer_CreateOnWindowsDC’: identifier not found”

by Conor Smith | April 5, 2017
To fix these errors in Foxit PDF SDK, follow the steps below: In Visual Studio’s “Solution Explorer” right click on the project with the error and select properties Select Configuration Properties ->General Set “Platform Toolset” to “Visual Studio 2010 (v100)” Note: This article refers to a deprecated version of a Foxit Product. If you are […]
Keep reading Keep reading

How to read outlines with Foxit PDF SDK

by Conor Smith | April 5, 2017
Outline and Bookmarks are the same in PDF. Please see the header file fpdf_document_r.h and locate the method starting with FSPDF_Bookmark_XXX. Function with the naming convention FSPDF_Bookmark_XXX are the function that will allow user to extract bookmark information. Note: This article refers to a deprecated version of a Foxit Product. If you are still using […]
Keep reading Keep reading

Can I extract text from PDF files using Foxit PDF SDK?

by Conor Smith | April 5, 2017
Yes. Text extraction from a PDF can be done by calling the FSPDF_TextPage_ExportToFile function using C++. Download Foxit PDF SDK 4.1 and get the demo at: samples\simple_sample\pdf2text\pdf2text.cpp FS_RESULT FSPDF_TextPage_ExportToFile(FSPD_TEXTPAGE textPage, FSCRT_FILE file) Parameters: textPage - Handle to FSPD_TEXTPAGE object returned by function PSPDF_TextPage_Load file - Handle to a FSCRT_FILE object which can be a file object or […]
Keep reading Keep reading

Foxit PDF SDK 4.x/5.x module breakdown

by Conor Smith | April 4, 2017
Break down of the Module package. Note: Please read the list like this “Module package – Module included.” Standard  – Renderer, Image (write for Bitmap only),  PDF Base, PDF Document(Read), PDF Async(read), PDF Page (Read), PDF Object (Read), PDFTextPage(Read), PDF Reflow(Read), App, Base Edit – Image(Read), PDF Document(Write), PDF Page(Write), PDF Object(Write), PDF Page Object(Write) […]
Keep reading Keep reading

How to render only a section of a PDF?

by Conor Smith | April 4, 2017
It is possible to render only a section of a PDF with the functionality provided in Foxit PDF SDK. The steps to do that are outlined below: Foxit PDF SDK  Change the parameters of FSPDF_Page_GetMatrix before rendering Go to “samples\simple_sample\comm_src\fgsdk_common.cpp” of the evaluation package and locate the call for FSPDF_Page_GetMatrix Change the parameters.  For example, […]
Keep reading Keep reading

How to support non-standard fonts on Foxit PDF SDK?

by Conor Smith | April 4, 2017
To support non-standard fonts on Foxit PDF SDK, follow the steps outlined below: Use the FSCRT_Library_AddFontFile or use FSCRT_Library_SetFontMapperHandler. Create the callback to handle the non-standard font. static FSCRT_FONTMAPPERHANDLER ExternalFontMapper;  static FS_RESULT MapExternalFont(FS_LPVOID clientData, FS_LPCSTR fontName, FS_DWORD fontStyles, FS_INT32 weight, FS_INT32 charset, FSCRT_FILE *fontFile, FS_INT32 *faceIndex){         if(fontName=="randomFontName") {             //set fontFile to use the non-Standard font […]
Keep reading Keep reading
Used everywhere

Trusted by