Foxit PDF SDK(Mac版)

Foxit PDF SDK(Mac版)支持开发自定义PDF阅读器,从中可选择添加PDF相关功能。只需要几行代码和一个优秀的功能库就可以添加注释、填写表单和签名功能。福昕核心API可以帮助开发人员开发PDF阅读器/编辑器或后台PDF工作流,满足企业目标需求。

使用Foxit PDF SDK(Mac版)开发PDF软件

Foxit PDF SDK(Mac版)可以帮助开发人员快速开发功能丰富的应用程序。福昕的核心API 专为Mac开发者设计,提供强大的PDF库,可以将您的应用提升到一个新的高度。开发人员可以通过Xcode或其他集成开发环境使用C++或Objective-C编写代码,构建一个快速、稳健和出色的PDF解决方案。

PDF SDK for Mac Support

功能

查看PDF

我们的核心API针对桌面和移动平台进行了优化,可以提供高保真度PDF文档渲染体验。

数字签名

无需打印文件,用户可以在其电子设备上签署文件,加速业务处理,并给用户带来舒适的体验。

PDF表单

支持使用电子设备填写数字表单,使之更高效、快捷。

权限管理

Foxit PDF SDK可以通过加密/解密服务或集成自定义数字权限管理(DRM)或信息权限管理(IRM)系统生成受保护的PDF文件。福昕的PDF SDK集成了微软权限管理服务(RMS)。

PDF注释

Foxit PDF SDK提供丰富的注释和标记功能,支持创建、编辑、导入和导出注释等。

全文搜索

采用SQLite数据库,支持对多种语言类型的PDF文档进行全文检索,提供快速、便捷的搜索体验。
 

FOXIT PDF SDK 8.5简介

Foxit PDF SDK 8.0是PDF领域中一个具有变革性的版本,无论是Web端基于JavaScript的Web Viewer还是桌面端SDK 和移动端SDK,都带来了许多新增功能和升级改进。我们还为PDF SDK(Web版)提供了全新的Viewer Demo。

在 Web端,我们新增了一个全新的Viewer Demo,向您展示如何充分利用我们基于JavaScript的 PDF 库。

我们还增强了协作功能,让您可以在 PDF查看器的多个实例之间同步注释和页面操作。您可以在自己的应用程序中轻松部署我们的SDK和管理所有用户的实时访问。另外,Web端SDK还提供了全新的辅助功能,如高对比度的支持和“文本到语音”转换工具。

我们的桌面端SDK提供了对 ARM Linux平台的支持、对HTMLtoPDF功能的重大升级、将表单数据导出到 CSV 功能等等。

在移动端,我们推出了新的UI,风格与桌面端UI以及福昕的其他产品的更加统一,签名功能中新增了一个用于检测是否已应用签名的事件,以及UI 上提供了注释小结功能。立即下载试用吧!

FOXIT PDF SDK 6.3 

PDF SDK6.3增加了不少新功能,包括:从URL打开PDF时存储缓存的支持,新增了阅读视图模式,以及JavaScript中增加了SignatureInfo和Doc / WillClose功能,等等!

同时全面更新了文档资料,为您提供新版的开发人员指南以及大量新的代码示例,帮助开发人员快速上手。

高级技术

XFA表单

XFA表单是基于XML的表单。能够安全获取、呈现、移动、处理、输出、更新和打印与静态和动态XFA表单相关的信息。使用XFA表单能简化您的数据共享、数据和获取。

权限管理

将应用程序和文件连接到微软的权限管理服务平台,保护PDF文档的安全。Foxit PDF SDK支持集成自定义IRM和DRM解决方案。
 
 

密文处理

出于合法或安全的考虑,通过编程实现搜索和审查文档的敏感信息,确保您的客户和员工的信息安全。通过福昕强大的技术加密文档,使得文档符合通用数据保护条例(GDPR)。

试用福昕技术

福昕阅读器(Mac版)采用与PDF SDK(Mac版)相同的技术进行开发,可以从应用商店免费下载。欢迎立即试用。

优点

集成开发

Foxit PDF SDK(Mac版)专为Apple开发者构建,已经Mac和iOS开发人员测试。启动Xcode或您的集成开发环境,尽享程序开发体验。

易于集成

我们开发Mac PDF库时将平台作为首要考虑因素。我们遵循Mac的命名规定和编码规定,使我们的程序符合Mac应用程序标准。

功能丰富

我们的产品功能在移动端和桌面端保持一致,使得跨平台开发更加简单顺畅。我们会不断更新功能集,欢迎关注我们的产品页面。

福昕核心技术支持

Foxit PDF SDK的核心技术已经存在多年,并且受到许多知名公司的信任。福昕强大的引擎使文档在不同平台上都可以快速查看并且保持一致。

系统要求

  • Mac OS X 10.6~10.14
  • Xcode 8或更高版本

使用Xcode加载文件和添加图像

int main(int argc, char *argv[])
{
  int err_ret = 0;
  WString input_file = input_path + L"AboutFoxit.pdf";

  WString output_directory = output_path + L"bookmark/";
#if defined(_WIN32) || defined(_WIN64)
  _mkdir(String::FromUnicode(output_directory));
#else
  mkdir(String::FromUnicode(output_directory), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
#endif

  WString output_file1 = output_directory + L"bookmark_add.pdf";
  WString output_file2 = output_directory + L"bookmark_change.pdf";
  WString bookmark_info_file = output_directory + L"bookmark_info.txt";

  SdkLibMgr spSdkLibMgr;
  ErrorCode error_code = spSdkLibMgr.Initialize();
  if (error_code != foxit::e_ErrSuccess) {
    return 1;
  }

  try {
    PDFDoc doc(input_file);
    ErrorCode error_code = doc.Load();
    if (error_code != foxit::e_ErrSuccess) {
      printf("The Doc [%s] Error: %d\n", (const char*)String::FromUnicode(input_file), error_code);
      return 1;
    }

    // Show original bookmark information.
    ShowBookmarksInfo(doc, bookmark_info_file);

    //Get bookmark root node or Create new bookmark root node.
    Bookmark root = doc.GetRootBookmark();
    if (root.IsEmpty())
    {
      root = doc.CreateRootBookmark();
    }
    for (int i = 0; i < doc.GetPageCount(); i += 2) {
      Destination dest = Destination::CreateFitPage(doc, i);
      CFX_WideString ws_title;
      ws_title.Format((FX_LPCWSTR)L"A bookmark to a page (index: %d)", i);
      Bookmark child = root.Insert(ws_title,
        foxit::pdf::Bookmark::e_PosLastChild);
      child.SetDestination(dest);
      child.SetColor(i * 0xF68C21);
    }
    doc.SaveAs(output_file1, PDFDoc::e_SaveFlagNoOriginal);

    // Get first bookmark and change properties.
    Bookmark first_bookmark = root.GetFirstChild();
    first_bookmark.SetStyle(foxit::pdf::Bookmark::e_StyleItalic);
    first_bookmark.SetColor(0xFF0000);
    first_bookmark.SetTitle(L"Change bookmark title, style, and color");

    // Remove next sibling bookmark
    if (!first_bookmark.GetNextSibling().IsEmpty()) {
      doc.RemoveBookmark(first_bookmark.GetNextSibling());
    }

    WString bookmark_info_file = output_directory + L"bookmark_info1.txt";
    ShowBookmarksInfo(doc, bookmark_info_file);

    doc.SaveAs(output_file2, PDFDoc::e_SaveFlagNoOriginal);
    cout << "Bookmark demo." << endl;

  } catch (const Exception& e) {
    cout << e.GetMessage() << endl;
    err_ret = 1;
  }
  catch(...)
  {
    cout << "Unknown Exception" << endl;
    err_ret = 1;
  }

  return err_ret;
}
class SdkLibMgr {
public:
  SdkLibMgr() : isInitialize(false){};
  ErrorCode Initialize() {
    ErrorCode error_code = Library::Initialize(sn, key);
    if (error_code != foxit::e_ErrSuccess) {
      printf("Library Initialize Error: %d\n", error_code);
    } else {
      isInitialize = true;
    }
    return error_code;

  }
  ~SdkLibMgr(){
    if(isInitialize)
      Library::Release();
  }
private:
  bool isInitialize;
};

WString output_directory = output_path + L"pdf2image/";

void Save2Image(Bitmap& bitmap, int nPageIndex, const char* sExt)
{
  // Add the bitmap to image and save the image.
  Image image;
  image.AddFrame(bitmap);
  WString s;
  s.Format((FX_LPCWSTR)L"AboutFoxit_%d",nPageIndex);
  s = output_directory + s + WString::FromLocal(sExt);
  image.SaveAs(s);

  cout << "Save page " << nPageIndex << " into a picture of " << sExt << " format." << endl;
}

void Save2Image(Image& image, const char* sExt)
{
  WString s = L"AboutFoxit";
  s = output_directory + s + WString::FromLocal(sExt);
  image.SaveAs(s);

  cout << "Save pdf file into a picture of " << sExt << " format." << endl;
}

int main(int argc, char *argv[])
{
#if defined(_WIN32) || defined(_WIN64)
  _mkdir(String::FromUnicode(output_directory));
#else
  mkdir(String::FromUnicode(output_directory), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
#endif

  int err_ret = 0;
  WString input_file = input_path + L"AboutFoxit.pdf";
  const char* support_image_extends[] = {".bmp", ".jpg", ".jpeg", ".png", ".jpx", ".jp2"};
  const char* support_multi_image[] = {".tif", ".tiff"};
  SdkLibMgr spSdkLibMgr;
  ErrorCode error_code = spSdkLibMgr.Initialize();
  if (error_code != foxit::e_ErrSuccess) {
    return 1;
  }

  try {
    PDFDoc doc=PDFDoc(input_file);
    ErrorCode error_code = doc.Load();
    if (error_code != foxit::e_ErrSuccess) {
      printf("The Doc [%s] Error: %d\n", (const char*)String::FromUnicode(input_file), error_code);
      return 1;
    }

    Image image;
    // get page count
    int nPageCount = doc.GetPageCount();
    for(int i=0;i<nPageCount;i++)
    {
      PDFPage page = doc.GetPage(i);
      // Parse page.
      page.StartParse(foxit::pdf::PDFPage::e_ParsePageNormal, NULL, false);

      int width = static_cast<int>(page.GetWidth());
      int height = static_cast<int>(page.GetHeight());
      Matrix matrix = page.GetDisplayMatrix(0, 0, width, height, page.GetRotation());

      // Prepare a bitmap for rendering.
      Bitmap bitmap(width, height, foxit::common::Bitmap::e_DIBArgb, NULL, 0);
      bitmap.FillRect(0xFFFFFFFF, NULL);

      // Render page
      Renderer render(bitmap, false);
      render.StartRender(page, matrix, NULL);
      image.AddFrame(bitmap);
      for(unsigned int j=0;j<sizeof(support_image_extends)/sizeof(support_image_extends[0]);j++)
      {
        const char* extend = support_image_extends[j];
        Save2Image(bitmap,i,extend);
      }
    }

    for(unsigned int j=0;j<sizeof(support_multi_image)/sizeof(support_multi_image[0]);j++)
    {
      const char* extend = support_multi_image[j];
      Save2Image(image,extend);
    }

  } catch (const Exception& e) {
    cout << e.GetMessage() << endl;
    err_ret = 1;
  }
  catch(...)
  {
    cout << "Unknown Exception" << endl;
    err_ret = 1;
  }

  return err_ret;
}