Foxit Developer Blog

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

    Foxit Quick PDF Library

    Render a PDF as an image with an asymmetrical DPI

    The current rendering engine is set up to use the same DPI setting for both the horizontal and vertical axis. So it isn’t possible to render an image with an asymmetrical DPI, however, it is possible to get the same effect though by stretching the page. Here’s some pseudo code that shows how to do [...]

    Read Article
    Foxit Quick PDF Library

    How do I programmatically create thumbnails for pages in PDFs?

    Creating thumbnails for PDFs using Foxit Quick PDF Library is simple. Simply use the functions listed in the below order: RenderPageToString AddImageFromString SetPageThumbnail Here is some C# sample code demonstrating how this works: QP.LoadFromFile("original.pdf"); byte[] ImageContent = QP.RenderPageToString(96, 1, 0); int ImageID = QP.AddImageFromString(ImageContent, 1); QP.SelectImage(ImageID); QP.SelectPage(1); QP.SetPageThumbnail(); QP.SaveToFile("original_with_thumbnail.pdf"); In this sample I’ve created the [...]

    Read Article
    Foxit Quick PDF Library

    Code to check PDFs for security settings

    The AnalyseFile function can be used to check a PDF for security settings. If the PDF has an open password then this password will need to be passed to the AnalyseFile function before you can check the permissions for the PDF. private void btnAnalyseFile_Click(object sender, EventArgs e) { string[] item1 = { "Filename", "Filesize", "Author", [...]

    Read Article
    Foxit Quick PDF Library

    Programmatically set initial view zoom magnification using Foxit Quick PDF Library

    The PDF specification doesn’t have a simple document setting that specifies the initial page number and zoom magnification. However it is possible to add an “open action” to the document that specifies the action to perform when the document is opened. Foxit Quick PDF Library’s SetOpenActionDestination function allows you to set the initial page and [...]

    Read Article
    Foxit Quick PDF Library

    Generate PDF report from MS Access application coded in Visual Basic

    You can use Foxit Quick PDF Library with Microsoft Access and Visual Basic using either the DLL or ActiveX editions. There is also a knowledge base article which shows you how to generate a PDF report from a Microsoft Access database using C# and Foxit Quick PDF Library. Included below is a sample demonstrating how [...]

    Read Article
    Foxit Quick PDF Library

    Display watermark only when a PDF is printed

    With the use of Optional Content Groups (OCGs), aka Layers in Acrobat lingo, it is possible to make specific content only appear when the PDF is viewed on screen or printed. The sample code demonstrates how this can be done by showing you three different examples of text drawn on a page. // Draw text [...]

    Read Article
    Foxit Quick PDF Library

    Programmatically remove a password from a PDF

    The ease with which you can remove a password from a PDF document depends on whether you have the user password. If the user password is known then removing security from a PDF is as simple as loading a document using the LoadFromFile function and at the same time including the user password in the [...]

    Read Article
    Foxit Quick PDF Library

    Programmatically delete all form fields in a PDF

    All form fields in a PDF can be deleted with the assistance of the DeleteFormField function in Foxit Quick PDF Library. Some JScript sample code that demonstrates how to do this is shown below: DPL.LoadFromFile("pdf_form.pdf"); TotalFormFields = DPL.FormFieldCount() While (TotalFormFields > 0) { DPL.DeleteFormField(TotalFormFields); TotalFormfields = TotalFormFields - 1; } DPL.SaveToFile("no_form_fields.pdf"); This article refers to [...]

    Read Article
    Foxit Quick PDF Library

    Rename an existing form field programmatically

    It is possible to rename a form field programmatically using the SetFormFieldChildTitle function in Foxit Quick PDF Library. Say for example that you have a parent field called Details, with child fields Name and Address, the full field names will be: Details.Name Details.Address If you wanted to change Details.Name to Details.FirstName you can use: int [...]

    Read Article
    Foxit Quick PDF Library

    Add a barcode to a PDF

    Adding a barcode to a PDF is simple using the Draw Barcode function available with Foxit Quick PDF Library.

    Read Article