Foxit PDF SDK

Our high-performance libraries add robust PDF functionality to enterprise, mobile, and cloud applications across all platforms, using the most popular developer languages and environments.

The best tools for developers

What platform are you working on?

Build on a modern tech stack that integrates tightly with the platform you’re working on. We continuously improve our products and they gain new features every month.

We grow with you as your requirements change and your project evolves.

using namespace std; using namespace foxit; using namespace foxit::common; using foxit::common::Library; using namespace pdf; using namespace annots; using foxit::pdf::annots::Line; // Create a blank document PDFDoc doc = PDFDoc(); // Add a blank A4 page to the document PDFPage page = doc.InsertPage(0, 595, 842); // Create a note annotation annots::Note note(page.AddAnnot(Annot::e_Note, RectF(10, 350, 50, 400))); // Set note annotation properties note.SetIconName("Comment"); note.SetSubject(L"Note"); note.SetTitle(L"Foxit SDK"); note.SetContent(L"Note annotation."); note.SetCreationDateTime(GetLocalDateTime()); note.SetModifiedDateTime(GetLocalDateTime()); note.SetUniqueID(WString::FromLocal(RandomUID())); // Add state annotation to note annotation Note state = note.AddStateAnnot(Markup::e_StateModelReview, Markup::e_StateAccepted); state.SetContent(L"Accepted set by Foxit SDK"); state.SetTitle(L"Foxit SDK"); state.SetModifiedDateTime(GetLocalDateTime()); state.SetUniqueID(WString::FromLocal(RandomUID())); state.ResetAppearanceStream(); // Appearance should be reset. note.ResetAppearanceStream(); cout << "Add a note annotation." << endl; // Save PDF file
C++
server.js 100% | 6/6 ln : 4
using foxit; using foxit.common; using foxit.common.fxcrt; using foxit.pdf; using foxit.pdf.annots; using (PDFDoc doc = new PDFDoc()) { // Add a blank A4 page to the document PDFPage page = doc.InsertPage(0, 595, 842); // Get first page with index 0 using (PDFPage page = doc.GetPage(0)) { // Add note annotation Note note = null; Annot annot = null; using (annot = page.AddAnnot(Annot.Type.e_Note, new RectF(10, 350, 50, 400))) using (note = new Note(annot)) { note.SetIconName("Comment"); note.SetSubject("Note"); note.SetTitle("Foxit SDK"); note.SetContent("Note annotation."); note.SetCreationDateTime(GetLocalDateTime()); note.SetModifiedDateTime(GetLocalDateTime()); note.SetUniqueID(RandomUID()); } // Add state annotation to note annotation using (Note state = note.AddStateAnnot(Markup.StateModel.e_StateModelReview, Markup.State.e_StateAccepted)) { state.SetContent("Accepted set by Foxit SDK"); state.SetTitle("Foxit SDK"); state.SetModifiedDateTime(GetLocalDateTime()); state.SetUniqueID(RandomUID()); state.ResetAppearanceStream(); // Appearance should be reset. note.ResetAppearanceStream(); Console.WriteLine("Add a note annotation."); } // Save PDF file String newPdf = output_path + "annotation.pdf"; doc.SaveAs(newPdf, (int)PDFDoc.SaveFlags.e_SaveFlagNoOriginal);
C#
server.js 100% | 6/6 ln : 4
// Create a new document FSPDFDoc* doc = [[FSPDFDoc alloc] init]; // Set a blank page width and height and add to document floatw =612.0;floath =792.0; FSPDFPage* page = [doc insertPage:index width:w height:h]; // Add note annotation FSRectF* annot_rect = [[FSRectF alloc] initWithLeft1:10 bottom1:350 right1:50 top1:400]; FSNote* note = [[FSNote alloc] initWithAnnot:[page addAnnot:FSAnnotNote rect:annot_rect]]; // Set some properties for the annotation [note setIconName:@"Comment"]; [note setSubject:@"Note"]; [note setTitle:@"Foxit SDK"]; [note setContent:@"Note annotation."]; // Reset Appearance [note resetAppearanceStream]; NSLog(@"Add a note annotation."); // Save PDF file NSString* save_pdf_path = [output_directory stringByAppendingPathComponent:@"annotation.pdf"]; [doc saveAs:save_pdf_path save_flags
Objective-C
server.js 100% | 6/6 ln : 4
#import "AppDelegate.h" #import <UIKit/UIKit.h> @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSString *sn = @"your-licence-key-signature"; NSString *key = @"your-licence-here"; FSErrorCode eRet = [FSLibrary initialize:sn key:key]; if (FSErrSuccess != eRet) { NSLog(@"License Key Invalid"); } return YES; }
Objective-C
server.js 100% | 6/6 ln : 4
import com.foxit.sdk.common.Library; import com.foxit.sdk.common.fxcrt.RectF; import com.foxit.sdk.pdf.PDFDoc; import com.foxit.sdk.pdf.PDFPage; import com.foxit.sdk.pdf.annots.Note; // Load a document PDFDoc doc = new PDFDoc(); // Get first page with index 0 PDFPage page = doc.insertPage(0, 595, 842); // Add note annotation Note note = new Note(page.addAnnot(Annot.e_Note, new RectF(10, 350, 50, 400))); //This flag is used for printing annotations. note.setFlags(4); note.setIconName("Comment"); note.setSubject("Note"); note.setTitle("Foxit SDK"); note.setContent("Note annotation."); note.setCreationDateTime(GetLocalDateTime()); note.setModifiedDateTime(GetLocalDateTime()); note.setUniqueID(RandomUID()); // Add state annotation to note annotation Note state = new Note(note.addStateAnnot("Foxit SDK", Markup.e_StateModelReview, Markup.e_StateAccepted)); state.setContent("Accepted set by Foxit SDK"); state.setUniqueID(RandomUID()); // Appearance should be reset. note.resetAppearanceStream(); System.out.println("Add a note annotation.");
Java
server.js 100% | 6/6 ln : 4
import com.foxit.sdk.PDFException; import com.foxit.sdk.common.Library; import java.io.File; import static com.foxit.sdk.common.Constants.e_ErrSuccess; import static com.foxit.sdk.pdf.PDFDoc.e_SaveFlagNoOriginal; public static void main(String[] args) throws PDFException { // Initialize library int error_code = Library.initialize(sn, key); if (error_code != e_ErrSuccess) { System.out.println("Library Initialize Error: " + error_code); return; }
Java
server.js 100% | 6/6 ln : 4
import com.foxit.sdk.PDFViewCtrl; import com.foxit.sdk.common.Constants; import com.foxit.sdk.common.fxcrt.RectF; import com.foxit.sdk.common.fxcrt.RectFArray; import com.foxit.sdk.pdf.PDFDoc; import com.foxit.sdk.pdf.PDFPage; import com.foxit.sdk.pdf.TextSearch; import com.foxit.sdk.pdf.annots.Annot; import com.foxit.sdk.pdf.annots.Note; import com.foxit.sdk.pdf.annots.QuadPoints; import com.foxit.sdk.pdf.annots.QuadPointsArray; import com.foxit.sdk.pdf.annots.TextMarkup; import com.foxit.sdk.common.fxcrt.PointF; // Define path String pdfpath = "xxx/Sample.pdf"; // Create PDF from scratch PDFDoc doc = new PDFDoc(pdfpath); doc.load(null); // Get first page of document PDFPage pdfPage = doc.getPage(1); // Create rectangle RectF rect = new RectF(100, 100, 120, 120); Note note = new Note(pdfPage.addAnnot(Annot.e_Note, rect)); note.setIconName("Comment"); // Set border color to blue note.setBorderColor(0xff0000ff); // Add some content note.setContent("Foxit PDF SDK"); // Reset appearance
Java
server.js 100% | 6/6 ln : 4
package com.foxit; import android.content.Context; import android.os.Environment; import com.foxit.home.R; import com.foxit.pdfreader.MultiTabView; import com.foxit.pdfreader.fragment.AppTabsManager; import com.foxit.sdk.common.Constants; import com.foxit.sdk.common.Library; import com.foxit.uiextensions.controls.toolbar.IBaseItem; import com.foxit.uiextensions.home.local.LocalModule; import com.foxit.uiextensions.utils.UIToast; import java.io.File; import java.util.HashMap; public class App { private static String sn = "your license key signature"; private static String key = "your license key"; private Context mContext; private int errCode = Constants.e_ErrSuccess; private static App INSTANCE = new App(); public static App instance() { return INSTANCE; } private App(){ errCode = Library.initialize(sn, key); } public boolean checkLicense(){ switch (errCode) { case Constants.e_ErrSuccess: break ; case Constants.e_ErrInvalidLicense: UIToast.getInstance(mContext).show(mContext.getString(R.string.fx_the_license_is_invalid)); return false; default: UIToast.getInstance(mContext).show(mContext.getString(R.string.fx_failed_to_initialize_the_library)); return false; } return true;
Java
server.js 100% | 6/6 ln : 4
// Create a new document FSPDFDoc* doc = [[FSPDFDoc alloc] init]; // Set a blank page width and height and add to document floatw =612.0;floath =792.0; FSPDFPage* page = [doc insertPage:index width:w height:h]; // Add note annotation FSRectF* annot_rect = [[FSRectF alloc] initWithLeft1:10 bottom1:350 right1:50 top1:400]; FSNote* note = [[FSNote alloc] initWithAnnot:[page addAnnot:FSAnnotNote rect:annot_rect]]; // Set some properties for the annotation [note setIconName:@"Comment"]; [note setSubject:@"Note"]; [note setTitle:@"Foxit SDK"]; [note setContent:@"Note annotation."]; // Reset Appearance [note resetAppearanceStream]; NSLog(@"Add a note annotation."); // Save PDF file NSString* save_pdf_path = [output_directory stringByAppendingPathComponent:@"annotation.pdf"]; [doc saveAs:save_pdf_path save_flag
Objective-C
server.js 100% | 6/6 ln : 4
#import "AppDelegate.h" #import <UIKit/UIKit.h> @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSString *sn = @"your-licence-key-signature"; NSString *key = @"your-licence-here"; FSErrorCode eRet = [FSLibrary initialize:sn key:key]; if (FSErrSuccess != eRet) { NSLog(@"License Key Invalid"); } return YES; }
Objective-C
server.js 100% | 6/6 ln : 4
//Render the pdf page, then save it to a bitmap file. void FunctionDemo::MainPage::render_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { StorageFolder^ documentFolder = Windows::Storage::KnownFolders::DocumentsLibrary; std::shared_ptr spBitmap = std::make_shared(nullptr); create_task(documentFolder->GetFileAsync("FoxitBigPreview.pdf")).then([=](StorageFile^ file) { try { m_doc = ref new FSPDFDoc(file, 0); if (!m_doc) { return; } FSErrorCode code = m_doc->Load(""); if (code != FSErrorCode::e_errSuccess) { return; } FSPDFPage^ page = m_doc->GetPage(0); if (!page->IsParsed()) { page->StartParse(0, nullptr, false); } //create bitmap int pageWidth = (int)page->GetWidth(); int pageHeight = (int)page->GetHeight(); *spBitmap = ref new FSBitmap(pageWidth, pageHeight, FSDIBFormat::e_dibRgb32, nullptr, 0); if (!(*spBitmap)) { return; } (*spBitmap)->FillRect(0xffffffff, nullptr); //init renderer FSRenderer^ render = ref new FSRenderer((*spBitmap), false); if (!render) { return; } //set different kinds of properties render->SetRenderContentFlags((int)FSRenderContentFlag::e_renderPage); render->SetTransformAnnotIcon(true); render->SetColorMode(FSRenderColorMode::e_colorModeNormal); render->SetForceHalftone(true); FSMatrix^ matrix = page->GetDisplayMatrix(0, 0, pageWidth, pageHeight, FSRotation::e_rotation0); render->StartRender(page, matrix, nullptr); } catch (Platform::Exception^ e) { OutputDebugString(e->Message->Data()); } }).then([=]() { return documentFolder->CreateFileAsync("Output_Render.bmp", CreationCollisionOption::ReplaceExisting); }).then([=](StorageFile^ file) { FSImage^ img = ref new FSImage(); img->AddFrame((*spBitmap)); if(img->SaveAs(file, "bmp")) this->showMesseageDialog("", "The output file is saved to:" + file->Path); else this->showMesseageDialog("", "error!"); });
C++
server.js 100% | 6/6 ln : 4
// Add the script below to your javascript file to initialize the viewer // Replace "window.demoLicenseKey" with your license key // And replace 'doc' with the path to the PDF file you wish to load
JavaScript
server.js 100% | 6/6 ln : 4
Read the docs

Smart Forms

Create, edit and fill PDF (AcroForms and XFA) forms progammatically. Give end users the ability to fill out digital forms that connect flawlessly to your systems through the import and export of FDF (Form Data Format) files.

Read more Read more

Digital Signature

Use ink signatures to let customers sign documents in their digital devices. Sign PDF in web apps easily without needing to print a file to sign again!

Read more Read more

PDF Annotations

Our PDF SDK provides full support for displaying and annotating PDF in web applications with an extensive range of functions for creating, editing or importing/exporting annotations.

Read more Read more
Robust functionality

More features

Viewing & rendering

Our core API provides for high-fidelity rendering of PDF documents with optimized performance for desktop and mobile platforms.

Full-text search

Fast full-text search for any PDF document, language, or encoding type. The SQLite-based full-text search delivers near-instant results, even for repositories on any digital device.

Rights management

Our PDF SDK can generate secure PDFs with native encryption and decryption, or integrate with customized DRM or IRM security systems. Our technology integrates with Microsoft RMS.

Solutions

Plug-Ins & Open Source Solutions

Cordova Support

We provide sample projects, demos, API docs and more for every single feature in the PDF SDK to get you up to speed quickly.

Learn More Learn More
Kotlin Support

We provide sample projects, demos, API docs and more for every single feature in the PDF SDK to get you up to speed quickly.

Learn More Learn More
React Native Support

We provide sample projects, demos, API docs and more for every single feature in the PDF SDK to get you up to speed quickly.

Learn More Learn More
WebPDF.JS Viewer

We provide sample projects, demos, API docs and more for every single feature in the PDF SDK to get you up to speed quickly.

Learn More Learn More
Don’t just take it from us

Hear it from our Customers

“I chose Foxit since it worked, was affordable, and uniquely accommodated to my business needs and business model. Foxit provided more sophisticated technology that enabled me to do things the others could not.”

Winston Chen

Founder, VoiceDream

“Users can easily access any meeting documentation, no matter if they are at the office or on the road. They don’t have to go through the hassle of carrying out loads of documents to meetings. Board members can now be confident that their information is highly secure.”

Frank Becker

Chief Technology Officer, Loomion

“With the attention already being there, for a product still in prototype stage at that time, [Foxit SDK] was our hero to help implement a first fully functional product in a short period of time.”

Oliver Grahl

Owner, Grahl Software Design

Used everywhere

Trusted by some of the world’s largest companies.

Take a look at who uses our technology.