赋能全场景 PDF 开发,助力数字化未来

福昕 PDF SDK是一款功能强大的PDF开发工具包,支持多种编程语言和跨平台集成,提供 PDF 阅读、编辑、表单处理与数据提取、字签名与安全加密、高并发云端解析等核心功能。适用于移动端、 网页、桌面、服务器及嵌入式设备,帮助开发者快速构建高性能PDF应用。
欢迎您进入福昕开发者中心,获取更多技术支持和资源。

多平台示例代码支持

String sn = "";
String key = "";
int error_code = Library.initialize(sn, key);
if (error_code != e_ErrSuccess) {
    return;
}
// 加载 "Sample.pdf" 文档
PDFDoc doc = new PDFDoc("Sample.pdf");
error_code = doc.load(null);
if (error_code != e_ErrSuccess) {
    return;
}
// 获取文档的第一页
PDFPage page = doc.getPage(0);
// 解析页面
page.startParse(e_ParsePageNormal, null, false);
...

NSString* sn = @" ";
NSString* key = @" ";
// 初始化库
FSErrorCode code = [FSLibrary initialize:sn key:key];
if (code != FSErrSuccess) {
    return -1;
}
// 加载一个 PDF 文档,并解析文档的第一页
NSString* pdfpath = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"pdf"];
FSPDFDoc* doc = [[FSPDFDoc alloc] initWithPath:pdfpath];
FSErrorCode errorCode = [doc load:nil];
if (errorCode != FSErrSuccess) {
    return -1;
}
FSPDFPage* page = [doc getPage:0];
[page startParse:FSPDFPageParsePageNormal pause:nil is_reparse:NO];
...
            

string sn = "";
string key = "";
// 初始化SDK
ErrorCode error_code = Library.Initialize(sn, key);
if (error_code != ErrorCode.e_ErrSuccess) {
    Console.WriteLine("Library Initialize Error: {0}\n", error_code);
    return;
}
// 加载“Sample.pdf”文档
using (PDFDoc doc = new PDFDoc(@"Sample.pdf")) {
    error_code = doc.Load(null);
    if (error_code != ErrorCode.e_ErrSuccess) {
        return;
    }
    // 获取文档的第一页并解析
    using (PDFPage page = new PDFPage(doc.GetPage(0))) {
        page.StartParse(0, null, true);
        ...
    }
}
            

var pdfui = new UIExtension.PDFUI({
    viewerOptions: {
        libPath: './lib', // web sdk的库路径。
        jr: {
            licenseSN: licenseSN,
            licenseKey: licenseKey
        }
    },
    renderTo: '#pdf-ui' // the div (id="pdf-ui")
});
// 根据需要修改文件路径。
fetch('/docs/FoxitPDFSDKforWeb_DemoGuide.pdf').then(function (response) {
    response.arrayBuffer().then(function (buffer) {
        pdfui.openPDFByFile(buffer);
    })
})

         

// 初始化库。
int errorCode = Library.initialize(sn, key);
if (errorCode != Constants.e_ErrSuccess)
 return;
// 实例化一个 PDFViewCtrl 对象。
pdfViewCtrl = new PDFViewCtrl(this);
// 设置 RMS UI 操作的关联活动。
pdfViewCtrl.setAttachedActivity(this);
uiExtensionsManager = new UIExtensionsManager(this.getApplicationContext(), pdfViewCtrl);
uiExtensionsManager.setAttachedActivity(this);
uiExtensionsManager.onCreate(this, pdfViewCtrl, savedInstanceState);
pdfViewCtrl.setUIExtensionsManager(uiExtensionsManager);
// 打开并渲染 PDF 文档。
String path = Environment.getExternalStorageDirectory().getPath() + "/FoxitSDK/Sample.pdf";
uiExtensionsManager.openDocument(path, null);
...
         

//初始化SDK
NSString *sn = @"";
NSString *key = @"";
FSErrorCode eRet = [FSLibrary initialize:sn key:key];
if (FSErrSuccess != eRet) {
   return; }

//以全屏尺寸初始化一个FSPDFViewCtrl对象
FSPDFViewCtrl* pdfViewCtrl;
pdfViewCtrl = [[FSPDFViewCtrl alloc] initWithFrame: [self.view bounds]];

//打开PDF进行显示
NSString* pdfPath = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"pdf"];
[pdfViewCtrl openDoc:pdfPath password:nil completion:nil];
[self.view addSubview:pdfViewCtrl];
...
         

//初始化SDK
#include "../../../include/conversion/fs_pdf2office.h"

using namespace foxit;
using namespace conversion::pdf2office;

static const char* sn = "***";
static const char* key = "***";
int main(int argc, char* argv[]) {
  int err_ret = 0;
  ErrorCode error_code = Library::Initialize(sn, key);
  if (error_code != foxit::e_ErrSuccess) {
    return 1;
  }
  try {
    // Convert PDF file to Word format file.
    PDF2OfficeSettingData setting_data;
    PDF2Office::StartConvertToWord(L"word.pdf", nullptr, L"pdf2word_result.docx", setting_data, nullptr);
  } catch (const Exception& e) {
    err_ret = e.GetErrCode();
  } catch (...) {
    err_ret = 1;
  }
  Library::Release();
  return err_ret;
}


         

//初始化SDK
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
axFoxitPDFSDK1.UnLockActiveX("Licence_ID", "Unlock_code"); // The license key
axFoxitPDFSDK1.OpenFile("C:/FoxitBigPreview.pdf", "");
axFoxitPDFSDK1.SetPageRotate(0, 1);
}
}
}
         

//初始化SDK
import { FoxitRDKNative } from 'foxit_rdk';

const pdfpath: string = "xxx/Sample.pdf";

// 加载PDF文档
const doc: FoxitRDKNative.PDFDoc = new FoxitRDKNative.PDFDoc(pdfpath);
doc.Load();

// 获取PDF文档页面
const pdfPage: FoxitRDKNative.PDFPage = doc.GetPage(1);

// 添加注释
const rect: FoxitRDKNative.RectF = new FoxitRDKNative.RectF(100, 100, 120, 120);
const note: FoxitRDKNative.Note = new FoxitRDKNative.Note(
  pdfPage.AddAnnot(FoxitRDKNative.Annot.e_Note, rect)
);

// 设置注释属性
note.SetIconName("Comment");
note.SetBorderColor(0xff0000ff);

// ... 其他操作
         

立即体验福昕 PDF SDK

无论您是 企业开发者、独立开发者,还是行业客户,福昕 PDF SDK 都能为您提供 高效、安全、易用 的 PDF 解决方案。