PDFelement - Edit, Annotate, Fill and Sign PDF Documents

appstore
Get from App Store

Get

PDFelement - Read, Annotate and Sign PDF

appstore
Get it on Google Play

Get

Quick Guide for PDFelement SDK

The hands-on guide to help you learn how to use PDFelement SDK in seconds.

homeOnline Help > Quick Guide For PDFelement SDK

PDF To XML

Function Description

Convert PDF documents to XML documents

Code sample

          bool ConvertToXml(const wchar_t* pdf_path, const wchar_t* dest_path) {
              PDF2Xml pdf_to_xml;
              auto open_result = pdf_to_xml.Open(pdf_path);
              if (open_result == PDF2Xml::kOpenSuccess) {
                  return pdf_to_xml.Save(dest_path);
          }
          return false;
          }
          

 

Method: PDF2Xml::Open

  • Description: Open the PDF document
  • Parameters Description:

Parameter

Type

Must

Description

file_path

const char* or

const wchar_t*

Yes

PDF document path.

password

const unsigned char*

No

Password

password_length

size_t

No

Password length

Return type:

Type

Description

    /**

    * @brief Open result

    */

    enum OpenResult {

        kOpenFailed,

        kOpenSuccess,

        kOpenNeedPassword = 4,

    };

Whether the opening is successful.

Code sample

          PDF2Xml pdf_to_xml;
          unsigned char pwd[100] = {  "123456" };
          auto open_result = pdf_to_xml.Open(L"F:\\source\\test.pdf", pwd, 6u);
          if (open_result != PDF2Xml::kOpenSuccess) {
              switch (open_result) {
                  case PDF2Xml::kOpenFailed:
                      std::cerr << "Failed to open the document." << std::endl;
                      break;
                  case PDF2Xml::kOpenNeedPassword:
                      std::cerr << "Document requires password." << std::endl;
                  default:
                      break;
              }
          }
          

 

Method: PDF2Xml::AddPageRange

  • Description: add conversion page range, convert all pages by default.
  • Parameters description:

Parameter

Type

Must

Description

start

unsigned int

Yes

Start Page

end

unsigned int

Yes

End Page

step

unsigned int

No

Step, the default value is 1

Return type:

Type

Description

Void

Code sample

          PDF2Xml pdf_to_xml;
          auto open_result = pdf_to_xml.Open(L"F:\\source\\test.pdf");
          if (open_result == PDF2Xml::kOpenSuccess) {
              pdf_to_xml.AddPageRange(2u,5u);
          }
          

 

Method: PDF2Xml::SetRegion

  • Description: Set the rectangular area of the conversion page
  • Parameters description:

Parameter

Type

Must

Description

left

float

Yes

The x-axis coordinate value of the upper left corner of the rectangular area

top

float

Yes

The y-axis coordinate value of the upper left corner of the rectangular area

right

float

Yes

The x-axis coordinate value of the lower right corner of the rectangular area

bottom

float

Yes

The y-axis coordinate value of the lower right corner of the rectangular area

Return type:

Type

Description

Void

Code sample

          PDF2Xml pdf_to_xml;
          auto open_result = pdf_to_xml.Open(L"F:\\source\\test.pdf");
          if (open_result == PDF2Xml::kOpenSuccess) {
              pdf_to_xml.SetRegion(100,300,200,200);
          }
          

 

Method: PDF2Xml::Save

  • Description: Save the converted document
  • Parameters description:

Parameter

Type

Must

Description

dest_path

const char* or

const wchar_t*

Yes

Destination file path

progress

Progress

No

Save the progress notification object. Default is empty

Return type:

Type

Description

Void

Code sample

          PDF2Xml pdf_to_xml;
          auto open_result = pdf_to_xml.Open(L"F:\\source\\test.pdf");
          if (open_result == PDF2Xml::kOpenSuccess) {
          pdf_to_xml.Save(L"F:\\output\\test.xml");
          }
          

PDF To Images

Function Description

Convert PDF documents to Images

Code sample

bool ConvertToImage(const wchar_t* pdf_path, const wchar_t* dest_dir) {
PDF2Word pdf_to_image;
auto open_result = pdf_to_image.Open(pdf_path);
if (open_result == PDF2Image::kOpenSuccess) {
    return pdf_to_image.Save(dest_dir);
}
return false;
}

 

Method: PDF2Image::Open

    • Description: Open the PDF document
    • Parameters Description:

Parameter

Type

Must

Description

file_path

const char* or

const wchar_t*

Yes

PDF document path.

password

const unsigned char*

No

Password

password_length

size_t

No

Password length

  • Return type:

Type

Description

    /**

    * @brief Open result

    */

    enum OpenResult {

        kOpenFailed,

        kOpenSuccess,

        kOpenNeedPassword = 4,

    };

Whether the opening is successful.

Code sample

PDF2Image pdf_to_image;
unsigned char pwd[100] = {  "123456" };
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf", pwd, 6u);
if (open_result != PDF2Image::kOpenSuccess) {
switch (open_result) {
    case PDF2Image::kOpenFailed:
        std::cerr << "Failed to open the document." << std::endl;
        break;
    case PDF2Image::kOpenNeedPassword:
        std::cerr << "Document requires password." << std::endl;
    default:
        break;
}
}

Method: PDF2Image::AddPageRange

  • Description: add conversion page range, convert all pages by default.
  • Parameters Description:

Parameter

Type

Must

Description

start

unsigned int

Yes

Start Page

end

unsigned int

Yes

End Page

step

unsigned int

No

Step, the default value is 1

  • Return type:

Type

Description

Void

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.AddPageRange(2u,5u);
}

 

Method: PDF2Image::SetRegion

  • Description: Set the rectangular area of the conversion page
  • Parameters Description:

Parameter

Type

Must

Description

left

float

Yes

The x-axis coordinate value of the upper left corner of the rectangular area

top

float

Yes

The y-axis coordinate value of the upper left corner of the rectangular area

right

float

Yes

The x-axis coordinate value of the lower right corner of the rectangular area

bottom

float

Yes

The y-axis coordinate value of the lower right corner of the rectangular area

  • Return type:

Type

Description

Void

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetRegion(100,300,200,200);
}

 

Method: PDF2Image::GetIgnoreImage

  • Description: Get the image in the ignored page, the default is No
  • Return type:

Type

Description

Bool

Whether to ignore images in the page

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetIgnoreImage(true);
if (pdf_to_image.GetIgnoreImage()) {
std::cout << "Ignore the image.." << std::endl;
}
}

 

Method: PDF2Image::GetImageOfEntirePage

  • Description: Get whether to convert each page into an image, the default is No
  • Return type:

Type

Description

bool

Whether to convert each page into an image

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetImageOfEntirePage(true);
if (pdf_to_image.GetImageOfEntirePage()) {
std::cout << "Convert the entire page to an image." << std::endl;
}
}

 

Method: PDF2Image::GetImageDpi

  • Description: Get the DPI of the image in the document
  • Return type:

Type

Description

float

DPI value

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
std::cout <<“DPI:”<< pdf_to_image.GetImageDpi() << std::endl;
}

 

Method: PDF2Image::SetIgnoreImage

  • Description: Set to ignore images in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_image

bool

Yes

Ignore the images in the page

  • Return type:

Type

Description

Void

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetIgnoreImage(true);
}

 

Method: PDF2Image::SetImageOfEntirePage

    • Description: set to whether to convert each page into an image
  • Parameters Description:

Parameter

Type

Must

Description

image_of_entire_page

Bool

Yes

Whether to convert each page into an image

  • Return type:

Type

Description

Void

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetImageOfEntirePage(true);
}

 

Method: PDF2Image::SetImageDpi

  • Description: set the DPI of the converted image
  • Parameters Description:

Parameter

Type

Must

Description

dpi

float

Yes

The DPI of the image

  • Return type:

Type

Description

Void

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetImageDpi(90);
}

 

Method: PDF2Image::GetIgnoreLink

  • Description: Get whether to ignore hyperlinks in the page
  • Return type:

Type

Description

bool

whether to ignore hyperlinks in the page

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetIgnoreLink(true);
if (pdf_to_image.GetIgnoreLink()) {
std::cout << "Ignore hyperlinks." << std::endl;
}
}

 

Method: PDF2Image::SetIgnoreLink

  • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_link

bool

Yes

whether to ignore hyperlinks in the page

  • Return type:

Type

Description

Void

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetIgnoreLink(true);
}

 

Method:PDF2Image::GetZipOutput

  • Description: Get whether to compress the output document
  • Return type:

Type

Description

bool

whether to compress the output document

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetZipOutput(true);
if (pdf_to_image.GetZipOutput()) {
std::cout << "Compress the output document." << std::endl;
}
}

 

Method: PDF2Image:: SetZipOutput

  • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

zip_output

bool

Yes

whether to compress the output document

  • Return type:

Type

Description

Void

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetZipOutput(true);
}

 

Method: PDF2Image::Save

  • Description: Save the converted document
  • Parameters Description:

Parameter

Type

Must

Description

dest_path

const char* or

const wchar_t*

Yes

Destination file path

image_format

/**

* @brief Image Format

*/

enum ImageFormat {

    kFormatBmp,  /**< @brief BMP Format */

    kFormatJpeg, /**< @brief JPEG Format */

    kFormatPng,  /**< @brief PNG Format */

    kFormatGif,  /**< @brief GIF Format */

    kFormatTiff, /**< @brief TIFF Format */

};

No

The output image format is JPEG by default

progress

Progress

No

Save the progress notification object. Default is empty

  • Return type:

Type

Description

Void

Code sample

PDF2Image pdf_to_image;
auto open_result = pdf_to_image.Open(L"F:\\source\\test.pdf");
if (open_result == PDF2Image::kOpenSuccess) {
pdf_to_image.SetZipOutput(true);
pdf_to_image.Save(L"F:\\output\\test_jpg.zip");
}

PDF To TXT

Function Description

Convert PDF documents to TXT documents

Code sample

  bool ConvertToTxt(const wchar_t* pdf_path, const wchar_t* dest_path) {
      PDF2Text pdf_to_text;
      auto open_result = pdf_to_text.Open(pdf_path);
      if (open_result == PDF2Text::kOpenSuccess) {
          return pdf_to_text.Save(dest_path);
  }
  return false;
  }
  

 

Method: PDF2TXT::Open

    • Description: Open the PDF document
    • Parameters Description:

Parameter

Type

Must

Description

file_path

const char* or

const wchar_t*

Yes

PDF document path.

password

const unsigned char*

No

Password

password_length

size_t

No

Password length

Return type:

Type

Description

    /**

    * @brief Open result

    */

    enum OpenResult {

        kOpenFailed,

        kOpenSuccess,

        kOpenNeedPassword = 4,

    };

Whether the opening is successful.

Code sample

  PDF2Text pdf_to_text;
  unsigned char pwd[100] = {  "123456" };
  auto open_result = pdf_to_text.Open(L"F:\\source\\test.pdf", pwd, 6u);
  if (open_result != PDF2Text::kOpenSuccess) {
      switch (open_result) {
          case PDF2Text::kOpenFailed:
              std::cerr << "Failed to open the document." << std::endl;
              break;
          case PDF2Text::kOpenNeedPassword:
              std::cerr << "Document requires password." << std::endl;
          default:
              break;
      }
  }
  

 

Method: PDF2TXT::AddPageRange

    • Description: add conversion page range, convert all pages by default.
  • Parameters Description:

Parameter

Type

Must

Description

start

unsigned int

Yes

Start Page

end

unsigned int

Yes

End Page

step

unsigned int

No

Step, the default value is 1

Return type:

Type

Description

Void

Code sample

  PDF2Text pdf_to_text;
  auto open_result = pdf_to_text.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Text::kOpenSuccess) {
      pdf_to_text.AddPageRange(2u,5u);
  }
  

 

Method: PDF2TXT::SetRegion

    • Description: Set the rectangular area of the conversion page
  • Parameters Description:

Parameter

Type

Must

Description

left

float

Yes

The x-axis coordinate value of the upper left corner of the rectangular area

top

float

Yes

The y-axis coordinate value of the upper left corner of the rectangular area

right

float

Yes

The x-axis coordinate value of the lower right corner of the rectangular area

bottom

float

Yes

The y-axis coordinate value of the lower right corner of the rectangular area

Return type:

Type

Description

Void

Code sample

  PDF2Text pdf_to_text;
  auto open_result = pdf_to_text.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Text::kOpenSuccess) {
      pdf_to_text.SetRegion(100,300,200,200);
  }
  

 

Method: PDF2TXT::Save

    • Description: Save the converted document
  • Parameters Description:

Parameter

Type

Must

Description

dest_path

const char* or

const wchar_t*

Yes

Destination file path

progress

Progress

No

Save the progress notification object. Default is empty

Return type:

Type

Description

Void

Code sample

  PDF2Text pdf_to_text;
  auto open_result = pdf_to_text.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Text::kOpenSuccess) {
  pdf_to_text.Save(L"F:\\output\\test.txt");
  }
  

PDF To Word

Function Description

Convert PDF documents to Word documents

Code sample

    bool ConvertToDocx(const wchar_t* pdf_path, const wchar_t* dest_path) {
        PDF2Word pdf_to_word;
        auto open_result = pdf_to_word.Open(pdf_path);
        if (open_result == PDF2Word::kOpenSuccess) {
            return pdf_to_word.Save(dest_path);
    }
    return false;
    }
    

 

Method: PDF2Word::Open

Description: Open the PDF document

Parameters Description:

Parameter

Type

Must

Description

file_path

const char* or

const wchar_t*

Yes

PDF document path.

password

const unsigned char*

No

Password

password_length

size_t

No

Password length

Return type:

Type

Description

    /**

    * @brief Open result

    */

    enum OpenResult {

        kOpenFailed,

        kOpenSuccess,

        kOpenNeedPassword = 4,

    };

Whether the opening is successful.

Code sample

    PDF2Word pdf_to_word;
    unsigned char pwd[100] = {  "123456" };
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf", pwd, 6u);
    if (open_result != PDF2Word::kOpenSuccess) {
        switch (open_result) {
            case PDF2Word::kOpenFailed:
                std::cerr << "Failed to open the document." << std::endl;
                break;
            case PDF2Word::kOpenNeedPassword:
                std::cerr << "Document requires password." << std::endl;
            default:
                break;
        }
    }
    

 

Method: PDF2Word::AddPageRange

Description: add conversion page range, convert all pages by default.

Parameters Description:

Parameter

Type

Must

Description

start

unsigned int

Yes

Start Page

end

unsigned int

Yes

End Page

step

unsigned int

No

Step, the default value is 1

Return type:

Type

Description

Void

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
        pdf_to_word.AddPageRange(2u,5u);
    }
    

 

Method: PDF2Word::SetRegion

Description: Set the rectangular area of the conversion page

Parameters Description:

Parameter

Type

Must

Description

left

float

Yes

The x-axis coordinate value of the upper left corner of the rectangular area

top

float

Yes

The y-axis coordinate value of the upper left corner of the rectangular area

right

float

Yes

The x-axis coordinate value of the lower right corner of the rectangular area

bottom

float

Yes

The y-axis coordinate value of the lower right corner of the rectangular area

Return type:

Type

Description

Void

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
        pdf_to_word.SetRegion(100,300,200,200);
    }
    

 

Method: PDF2Word::GetIgnoreImage

Description: Get the image in the ignored page, the default is No

Return type:

Type

Description

Bool

Whether to ignore images in the page

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
    pdf_to_word.SetIgnoreImage(true);
    if (pdf_to_word.GetIgnoreImage()) {
        std::cout << "Ignore the image.." << std::endl;
    }
    }
    

 

Method: PDF2Word::GetImageOfEntirePage

Description: Get whether to convert each page into an image, the default is No

Return type:

Type

Description

bool

Whether to convert each page into an image

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
    pdf_to_word.SetImageOfEntirePage(true);
    if (pdf_to_word.GetImageOfEntirePage()) {
        std::cout << "Convert the entire page to an image." << std::endl;
    }
    }
    

 

Method: PDF2Word::GetImageDpi

Description: Get the DPI of the image in the document

Return type:

Type

Description

float

DPI value

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
        std::cout <<“DPI:”<< pdf_to_word.GetImageDpi() << std::endl;
    }
    

 

Method: PDF2Word::SetIgnoreImage

Description: Set to ignore images in the page

Parameters Description:

Parameter

Type

Must

Description

ignore_image

bool

Yes

Ignore the images in the page

Return type:

Type

Description

Void

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
    pdf_to_word.SetIgnoreImage(true);
    }
    

 

Method: PDF2Word::SetImageOfEntirePage

Description: set to whether to convert each page into an image

Parameters Description:

Parameter

Type

Must

Description

image_of_entire_page

Bool

Yes

Whether to convert each page into an image

Return type:

Type

Description

Void

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
    pdf_to_word.SetImageOfEntirePage(true);
    }
    

 

Method: PDF2Word::SetImageDpi

Description: set the DPI of the converted image

Parameters Description:

Parameter

Type

Must

Description

dpi

float

Yes

The DPI of the image

Return type:

Type

Description

Void

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
    pdf_to_word.SetImageDpi(90);
    }
    

 

Method: PDF2Word::GetIgnoreLink

Description: Get whether to ignore hyperlinks in the page

Return type:

Type

Description

bool

whether to ignore hyperlinks in the page

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
    pdf_to_word.SetIgnoreLink(true);
    if (pdf_to_word.GetIgnoreLink()) {
        std::cout << "Ignore hyperlinks." << std::endl;
    }
    }
    

 

Method: PDF2Word::SetIgnoreLink

Description: Set whether to ignore hyperlinks in the page

Parameters Description:

Parameter

Type

Must

Description

ignore_link

bool

Yes

whether to ignore hyperlinks in the page

Return type:

Type

Description

Void

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
    pdf_to_word.SetIgnoreLink(true);
    }
    

 

Method: PDF2Word::Save

Description: Save the converted document

Parameters Description:

Parameter

Type

Must

Description

dest_path

const char* or

const wchar_t*

Yes

Destination file path

office_version

/**

* @brief Office version

*/

enum OfficeVersion {

    kOffice2003 = 0,

    kOffice2007 = 1

};

No

Office version,The default is 2007

progress

Progress

No

Save the progress notification object. Default is empty

Return type:

Type

Description

Void

Code sample

    PDF2Word pdf_to_word;
    auto open_result = pdf_to_word.Open(L"F:\\source\\test.pdf");
    if (open_result == PDF2Word::kOpenSuccess) {
    pdf_to_word.SetIgnoreLink(true);
    pdf_to_word.Save(L"F:\\output\\test.docx");
    }
    

PDF To Excel

1.Function Description

Convert PDF documents to Excel documents

Code sample

  bool ConvertToXlsx(const wchar_t* pdf_path, const wchar_t* dest_path) {
      PDF2Excel pdf_to_excel;
      auto open_result = pdf_to_excel.Open(pdf_path);
      if (open_result == PDF2Excel::kOpenSuccess) {
          return pdf_to_excel.Save(dest_path);
  }
  return false;
  }
  

 

Method: PDF2Excel::Open

    • Description: Open the PDF document
    • Parameters Description:

Parameter

Type

Must

Description

file_path

const char* or

const wchar_t*

Yes

PDF document path.

password

const unsigned char*

No

Password

password_length

size_t

No

Password length

Return type:

Type

Description

    /**

    * @brief Open result

    */

    enum OpenResult {

        kOpenFailed,

        kOpenSuccess,

        kOpenNeedPassword = 4,

    };

Whether the opening is successful.

Code sample

  PDF2Excel pdf_to_excel;
  unsigned char pwd[100] = {  "123456" };
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf", pwd, 6u);
  if (open_result != PDF2Excel::kOpenSuccess) {
      switch (open_result) {
          case PDF2Excel::kOpenFailed:
              std::cerr << "Failed to open the document." << std::endl;
              break;
          case PDF2Excel::kOpenNeedPassword:
              std::cerr << "Document requires password." << std::endl;
          default:
              break;
      }
  }
  

 

Method: PDF2Excel::AddPageRange

    • Description: add conversion page range, convert all pages by default.
  • Parameters Description:

Parameter

Type

Must

Description

start

unsigned int

Yes

Start Page

end

unsigned int

Yes

End Page

step

unsigned int

No

Step, the default value is 1

Return type:

Type

Description

Void

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
      pdf_to_excel.AddPageRange(2u,5u);
  }
  

 

Method: PDF2Excel::SetRegion

    • Description: Set the rectangular area of the conversion page
  • Parameters Description:

Parameter

Type

Must

Description

left

float

Yes

The x-axis coordinate value of the upper left corner of the rectangular area

top

float

Yes

The y-axis coordinate value of the upper left corner of the rectangular area

right

float

Yes

The x-axis coordinate value of the lower right corner of the rectangular area

bottom

float

Yes

The y-axis coordinate value of the lower right corner of the rectangular area

Return type:

Type

Description

Void

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
      pdf_to_excel.SetRegion(100,300,200,200);
  }
  

 

Method: PDF2Excel::GetIgnoreImage

      • Description: Get the image in the ignored page, the default is No

Return type:

Type

Description

Bool

Whether to ignore images in the page

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
  pdf_to_excel.SetIgnoreImage(true);
  if (pdf_to_excel.GetIgnoreImage()) {
      std::cout << "Ignore the image.." << std::endl;
  }
  }
  

 

Method: PDF2Excel::GetImageOfEntirePage

      • Description: Get whether to convert each page into an image, the default is No

Return type:

Type

Description

bool

Whether to convert each page into an image

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
  pdf_to_excel.SetImageOfEntirePage(true);
  if (pdf_to_excel.GetImageOfEntirePage()) {
      std::cout << "Convert the entire page to an image." << std::endl;
  }
  }
  

 

Method: PDF2Excel::GetImageDpi

      • Description: Get the DPI of the image in the document

Return type:

Type

Description

float

DPI value

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
      std::cout <<“DPI:”<< pdf_to_excel.GetImageDpi() << std::endl;
  }
  

 

Method: PDF2Excel::SetIgnoreImage

    • Description: Set to ignore images in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_image

bool

Yes

Ignore the images in the page

Return type:

Type

Description

Void

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
  pdf_to_excel.SetIgnoreImage(true);
  }
  

 

Method: PDF2Excel::SetImageOfEntirePage

    • Description: set to whether to convert each page into an image
  • Parameters Description:

Parameter

Type

Must

Description

image_of_entire_page

Bool

Yes

Whether to convert each page into an image

Return type:

Type

Description

Void

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
  pdf_to_excel.SetImageOfEntirePage(true);
  }
  

 

Method: PDF2Excel::SetImageDpi

    • Description: set the DPI of the converted image
  • Parameters Description:

Parameter

Type

Must

Description

dpi

float

Yes

The DPI of the image

Return type:

Type

Description

Void

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
  pdf_to_excel.SetImageDpi(90);
  }
  

 

Method: PDF2Excel::GetIgnoreLink

      • Description: Get whether to ignore hyperlinks in the page

Return type:

Type

Description

bool

whether to ignore hyperlinks in the page

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
  pdf_to_excel.SetIgnoreLink(true);
  if (pdf_to_excel.GetIgnoreLink()) {
      std::cout << "Ignore hyperlinks." << std::endl;
  }
  }
  

 

Method: PDF2Excel::SetIgnoreLink

    • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_link

bool

Yes

whether to ignore hyperlinks in the page

Return type:

Type

Description

Void

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
  pdf_to_excel.SetIgnoreLink(true);
  }
  

 

Method: PDF2Excel::GetExportMode

      • Description: Get export mode

Return type:

Type

Description

 

/**

* @brief Excel export mode

*/

enum ExcelExportMode {

    kExportModeEachPageToOneSheet,        /**< @brief Each page is converted to one sheet (Sheet) */

    kExportModeCombineAllPagesToOneSheet, /**< @brief Merge the contents of all pages into one sheet (Sheet) */

};

Excel export mode

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
  pdf_to_excel.SetExportMode(kExportModeEachPageToOneSheet);
  if (pdf_to_excel.GetExportMode()==kExportModeEachPageToOneSheet) {
      std::cout << "Each page is converted to one sheet." << std::endl;
  }
  }
  

 

Method: PDF2Excel::SetExportMode

    • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

mode

/**

* @brief Excel export mode

*/

enum ExcelExportMode {

    kExportModeEachPageToOneSheet,        /**< @brief Each page is converted to one sheet (Sheet) */

    kExportModeCombineAllPagesToOneSheet, /**< @brief Merge the contents of all pages into one sheet (Sheet) */

};

Yes

Export mode

Return type:

Type

Description

bool

Whether it was set successfully

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
  pdf_to_excel.SetExportMode(kExportModeEachPageToOneSheet);
  }
  

 

Method: PDF2Excel::Save

    • Description: Save the converted document
  • Parameters Description:

Parameter

Type

Must

Description

dest_path

const char* or

const wchar_t*

Yes

Destination file path

office_version

/**

* @brief Office version

*/

enum OfficeVersion {

    kOffice2003 = 0,

    kOffice2007 = 1

};

No

Office version,The default is 2007

progress

Progress

No

Save the progress notification object. Default is empty

Return type:

Type

Description

Void

Code sample

  PDF2Excel pdf_to_excel;
  auto open_result = pdf_to_excel.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Excel::kOpenSuccess) {
  pdf_to_excel.SetIgnoreLink(true);
  pdf_to_excel.SetExportMode(kExportModeEachPageToOneSheet);
  pdf_to_excel.Save(L"F:\\output\\test.xlsx");
  }
  

PDF To PPT

Function Description

Convert PDF documents to PPT documents

Code sample

  bool ConvertToPPTx(const wchar_t* pdf_path, const wchar_t* dest_path) {
      PDF2Word pdf_to_PPT;
      auto open_result = pdf_to_PPT.Open(pdf_path);
      if (open_result == PDF2PPT::kOpenSuccess) {
          return pdf_to_PPT.Save(dest_path);
  }
  return false;
  }
   

Method: PDF2PPT::Open

    • Description: Open the PDF document
    • Parameters Description:

Parameter

Type

Must

Description

file_path

const char* or

const wchar_t*

Yes

PDF document path.

password

const unsigned char*

No

Password

password_length

size_t

No

Password length

Return type:

Type

Description

    /**

    * @brief Open result

    */

    enum OpenResult {

        kOpenFailed,

        kOpenSuccess,

        kOpenNeedPassword = 4,

    };

Whether the opening is successful.

Code sample

  PDF2PPT pdf_to_PPT;
  unsigned char pwd[100] = {  "123456" };
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf", pwd, 6u);
  if (open_result != PDF2PPT::kOpenSuccess) {    
  switch (open_result) {        
  case PDF2PPT::kOpenFailed:            
  std::cerr << "Failed to open the document." << std::endl;
  break;
  case PDF2PPT::kOpenNeedPassword:            
  std::cerr << "Document requires password." << std::endl;
  default:            
  break;    
  }
  }
   

 

Method: PDF2PPT::AddPageRange

    • Description: add conversion page range, convert all pages by default.
  • Parameters Description:

Parameter

Type

Must

Description

start

unsigned int

Yes

Start Page

end

unsigned int

Yes

End Page

step

unsigned int

No

Step, the default value is 1

Return type:

Type

Description

Void

Code sample

  PDF2PPT pdf_to_PPT;
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2PPT::kOpenSuccess) {    
  pdf_to_PPT.AddPageRange(2u,5u);
  }

 

Method: PDF2PPT::SetRegion

    • Description: Set the rectangular area of the conversion page
  • Parameters Description:

Parameter

Type

Must

Description

left

float

Yes

The x-axis coordinate value of the upper left corner of the rectangular area

top

float

Yes

The y-axis coordinate value of the upper left corner of the rectangular area

right

float

Yes

The x-axis coordinate value of the lower right corner of the rectangular area

bottom

float

Yes

The y-axis coordinate value of the lower right corner of the rectangular area

Return type:

Type

Description

Void

Code sample
PDF2PPT pdf_to_PPT;
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2PPT::kOpenSuccess) {    
  pdf_to_PPT.SetRegion(100,300,200,200);
  } 

Method: PDF2PPT::GetIgnoreImage

      • Description: Get the image in the ignored page, the default is No

Return type:

Type

Description

Bool

Whether to ignore images in the page

Code sample
PDF2PPT pdf_to_PPT;
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2PPT::kOpenSuccess) {
  pdf_to_PPT.SetIgnoreImage(true);
  if (pdf_to_PPT.GetIgnoreImage()) {    
  std::cout << "Ignore the image.." << std::endl;
  }
  }

 

Method: PDF2PPT::GetImageOfEntirePage

      • Description: Get whether to convert each page into an image, the default is No

Return type:

Type

Description

bool

Whether to convert each page into an image

Code sample

  PDF2PPT pdf_to_PPT;
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2PPT::kOpenSuccess) {
  pdf_to_PPT.SetImageOfEntirePage(true);
  if (pdf_to_PPT.GetImageOfEntirePage()) {    
  std::cout << "Convert the entire page to an image." << std::endl;
  }
  }
  

 

Method: PDF2PPT::GetImageDpi

      • Description: Get the DPI of the image in the document

Return type:

Type

Description

float

DPI value

Code sample
  •  

Method: PDF2PPT::SetIgnoreImage

    • Description: Set to ignore images in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_image

bool

Yes

Ignore the images in the page

Return type:

Type

Description

Void

Code sample

  PDF2PPT pdf_to_PPT;
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2PPT::kOpenSuccess) {    
  std::cout <<“DPI:”<< pdf_to_PPT.GetImageDpi() << std::endl;
  }
  

 

Method: PDF2PPT::SetImageOfEntirePage

    • Description: set to whether to convert each page into an image
  • Parameters Description:

Parameter

Type

Must

Description

image_of_entire_page

Bool

Yes

Whether to convert each page into an image

Return type:

Type

Description

Void

Code sample

  PDF2PPT pdf_to_PPT;
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2PPT::kOpenSuccess) { 
  std::cout <<“DPI:”<< pdf_to_PPT.GetImageDpi() << std::endl;
  }
  

Method: PDF2PPT::SetImageDpi

    • Description: set the DPI of the converted image
  • Parameters Description:

Parameter

Type

Must

Description

dpi

float

Yes

The DPI of the image

Return type:

Type

Description

Void

Code sample

PDF2PPT pdf_to_PPT;
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2PPT::kOpenSuccess) {
  pdf_to_PPT.SetImageDpi(90);
  }

 

Method: PDF2PPT::GetIgnoreLink

      • Description: Get whether to ignore hyperlinks in the page

Return type:

Type

Description

bool

whether to ignore hyperlinks in the page

Code sample

PDF2PPT pdf_to_PPT;
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2PPT::kOpenSuccess) {
  pdf_to_PPT.SetIgnoreLink(true);
  if (pdf_to_PPT.GetIgnoreLink()) {
  std::cout << "Ignore hyperlinks." << std::endl;
  }
  }

 

Method: PDF2PPT::SetIgnoreLink

    • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_link

bool

Yes

whether to ignore hyperlinks in the page

Return type:

Type

Description

Void

Code sample
PDF2PPT pdf_to_PPT;
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2PPT::kOpenSuccess) {
  pdf_to_PPT.SetIgnoreLink(true);
  }

 

Method: PDF2PPT::Save

    • Description: Save the converted document
  • Parameters Description:

Parameter

Type

Must

Description

dest_path

const char* or

const wchar_t*

Yes

Destination file path

office_version

/**

* @brief Office version

*/

enum OfficeVersion {

    kOffice2003 = 0,

    kOffice2007 = 1

};

No

Office version,The default is 2007

progress

Progress

No

Save the progress notification object. Default is empty

Return type:

Type

Description

Void

Code sample
PDF2PPT pdf_to_PPT;
  auto open_result = pdf_to_PPT.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2PPT::kOpenSuccess) {
  pdf_to_PPT.SetIgnoreLink(true);
  pdf_to_PPT.Save(L"F:\\output\\test.PPTx");
  }

PDF To RTF

Function Description

Convert PDF documents to RTF documents

Code sample

  bool ConvertToRtf(const wchar_t* pdf_path, const wchar_t* dest_path) {
      PDF2Rtf pdf_to_rtf;
      auto open_result = pdf_to_rtf.Open(pdf_path);
      if (open_result == PDF2Rtf::kOpenSuccess) {
          return pdf_to_rtf.Save(dest_path);
  }
  return false;
  }
  

 

Method: PDF2RTF::Open

    • Description: Open the PDF document
    • Parameters Description:

Parameter

Type

Must

Description

file_path

const char* or

const wchar_t*

Yes

PDF document path.

password

const unsigned char*

No

Password

password_length

size_t

No

Password length

Return type:

Type

Description

    /**

    * @brief Open result

    */

    enum OpenResult {

        kOpenFailed,

        kOpenSuccess,

        kOpenNeedPassword = 4,

    };

Whether the opening is successful.

Code sample

  PDF2Rtf pdf_to_rtf;
  unsigned char pwd[100] = {  "123456" };
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf", pwd, 6u);
  if (open_result != PDF2Rtf::kOpenSuccess) {
      switch (open_result) {
          case PDF2Rtf::kOpenFailed:
              std::cerr << "Failed to open the document." << std::endl;
              break;
          case PDF2Rtf::kOpenNeedPassword:
              std::cerr << "Document requires password." << std::endl;
          default:
              break;
      }
  }
  

 

Method: PDF2RTF::AddPageRange

    • Description: add conversion page range, convert all pages by default.
  • Parameters Description:

Parameter

Type

Must

Description

start

unsigned int

Yes

Start Page

end

unsigned int

Yes

End Page

step

unsigned int

No

Step, the default value is 1

Return type:

Type

Description

Void

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
      pdf_to_rtf.AddPageRange(2u,5u);
  }
  

 

Method: PDF2RTF::SetRegion

    • Description: Set the rectangular area of the conversion page
  • Parameters Description:

Parameter

Type

Must

Description

left

float

Yes

The x-axis coordinate value of the upper left corner of the rectangular area

top

float

Yes

The y-axis coordinate value of the upper left corner of the rectangular area

right

float

Yes

The x-axis coordinate value of the lower right corner of the rectangular area

bottom

float

Yes

The y-axis coordinate value of the lower right corner of the rectangular area

Return type:

Type

Description

Void

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
      pdf_to_rtf.SetRegion(100,300,200,200);
  }
  

 

Method: PDF2RTF::GetIgnoreImage

      • Description: Get the image in the ignored page, the default is No

Return type:

Type

Description

Bool

Whether to ignore images in the page

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
  pdf_to_rtf.SetIgnoreImage(true);
  if (pdf_to_rtf.GetIgnoreImage()) {
      std::cout << "Ignore the image.." << std::endl;
  }
  }
  

 

Method: PDF2RTF::GetImageOfEntirePage

      • Description: Get whether to convert each page into an image, the default is No

Return type:

Type

Description

bool

Whether to convert each page into an image

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
  pdf_to_rtf.SetImageOfEntirePage(true);
  if (pdf_to_rtf.GetImageOfEntirePage()) {
      std::cout << "Convert the entire page to an image." << std::endl;
  }
  }
  

 

Method: PDF2RTF::GetImageDpi

      • Description: Get the DPI of the image in the document

Return type:

Type

Description

float

DPI value

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
      std::cout <<“DPI:”<< pdf_to_rtf.GetImageDpi() << std::endl;
  }
  

 

Method: PDF2RTF::SetIgnoreImage

    • Description: Set to ignore images in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_image

bool

Yes

Ignore the images in the page

Return type:

Type

Description

Void

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
  pdf_to_rtf.SetIgnoreImage(true);
  }
  

 

Method: PDF2RTF::SetImageOfEntirePage

    • Description: set to whether to convert each page into an image
  • Parameters Description:

Parameter

Type

Must

Description

image_of_entire_page

Bool

Yes

Whether to convert each page into an image

Return type:

Type

Description

Void

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
  pdf_to_rtf.SetImageOfEntirePage(true);
  }
  

 

Method: PDF2RTF::SetImageDpi

    • Description: set the DPI of the converted image
  • Parameters Description:

Parameter

Type

Must

Description

dpi

float

Yes

The DPI of the image

Return type:

Type

Description

Void

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
  pdf_to_rtf.SetImageDpi(90);
  }
  

 

Method: PDF2RTF::GetIgnoreLink

      • Description: Get whether to ignore hyperlinks in the page

Return type:

Type

Description

bool

whether to ignore hyperlinks in the page

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
  pdf_to_rtf.SetIgnoreLink(true);
  if (pdf_to_rtf.GetIgnoreLink()) {
      std::cout << "Ignore hyperlinks." << std::endl;
  }
  }
  

 

Method: PDF2RTF::SetIgnoreLink

    • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_link

bool

Yes

whether to ignore hyperlinks in the page

Return type:

Type

Description

Void

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
  pdf_to_rtf.SetIgnoreLink(true);
  }
  

 

Method: PDF2RTF::Save

    • Description: Save the converted document
  • Parameters Description:

Parameter

Type

Must

Description

dest_path

const char* or

const wchar_t*

Yes

Destination file path

progress

Progress

No

Save the progress notification object. Default is empty

Return type:

Type

Description

Void

Code sample

  PDF2Rtf pdf_to_rtf;
  auto open_result = pdf_to_rtf.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Rtf::kOpenSuccess) {
  pdf_to_rtf.SetIgnoreLink(true);
  pdf_to_rtf.Save(L"F:\\output\\test.rtf");
  }
  

PDF To HTML

Function Description

Convert PDF documents to HTML documents


  bool ConvertToHtml(const wchar_t* pdf_path, const wchar_t* dest_dir) {
      PDF2Html pdf_to_html;
      auto open_result = pdf_to_html.Open(pdf_path);
      if (open_result == PDF2Html::kOpenSuccess) {
          return pdf_to_html.Save(dest_dir);
  }
  return false;
  }
  

 

Method: PDF2Html::Open

  • Description: Open the PDF document
  • Parameters Description:

Parameter

Type

Must

Description

file_path

const char* or

const wchar_t*

Yes

PDF document path.

password

const unsigned char*

No

Password

password_length

size_t

No

Password length

Return type:

Type

Description

    /**

    * @brief Open result

    */

    enum OpenResult {

        kOpenFailed,

        kOpenSuccess,

        kOpenNeedPassword = 4,

    };

Whether the opening is successful.


  PDF2Html pdf_to_html;
  unsigned char pwd[100] = {  "123456" };
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf", pwd, 6u);
  if (open_result != PDF2Html::kOpenSuccess) {
      switch (open_result) {
          case PDF2Html::kOpenFailed:
              std::cerr << "Failed to open the document." << std::endl;
              break;
          case PDF2Html::kOpenNeedPassword:
              std::cerr << "Document requires password." << std::endl;
          default:
              break;
      }
  }
  

 

Method: PDF2Html::AddPageRange

  • Description: add conversion page range, convert all pages by default.
  • Parameters Description:

Parameter

Type

Must

Description

start

unsigned int

Yes

Start Page

end

unsigned int

Yes

End Page

step

unsigned int

No

Step, the default value is 1

Return type:

Type

Description

Void


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
      pdf_to_html.AddPageRange(2u,5u);
  }
  

 

Method: PDF2Html::SetRegion

  • Description: Set the rectangular area of the conversion page
  • Parameters Description:

Parameter

Type

Must

Description

left

float

Yes

The x-axis coordinate value of the upper left corner of the rectangular area

top

float

Yes

The y-axis coordinate value of the upper left corner of the rectangular area

right

float

Yes

The x-axis coordinate value of the lower right corner of the rectangular area

bottom

float

Yes

The y-axis coordinate value of the lower right corner of the rectangular area

Return type:

Type

Description

Void


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
      pdf_to_html.SetRegion(100,300,200,200);
  }
  

 

Method: PDF2Html::GetIgnoreImage

  • Description: Get the image in the ignored page, the default is No

Return type:

Type

Description

Bool

Whether to ignore images in the page


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
  pdf_to_html.SetIgnoreImage(true);
  if (pdf_to_html.GetIgnoreImage()) {
      std::cout << "Ignore the image.." << std::endl;
  }
  }
  

 

Method: PDF2Html::GetImageOfEntirePage

  • Description: Get whether to convert each page into an image, the default is No

Return type:

Type

Description

bool

Whether to convert each page into an image


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
  pdf_to_html.SetImageOfEntirePage(true);
  if (pdf_to_html.GetImageOfEntirePage()) {
      std::cout << "Convert the entire page to an image." << std::endl;
  }
  }
  

 

Method: PDF2Html::GetImageDpi

  • Description: Get the DPI of the image in the document

Return type:

Type

Description

float

DPI value


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
      std::cout <<“DPI:”<< pdf_to_html.GetImageDpi() << std::endl;
  }
  

 

Method: PDF2Html::SetIgnoreImage

  • Description: Set to ignore images in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_image

bool

Yes

Ignore the images in the page

Return type:

Type

Description

Void


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
  pdf_to_html.SetIgnoreImage(true);
  }
  

 

Method: PDF2Html::SetImageOfEntirePage

  • Description: set to whether to convert each page into an image
  • Parameters Description:

Parameter

Type

Must

Description

image_of_entire_page

Bool

Yes

Whether to convert each page into an image

Return type:

Type

Description

Void


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
  pdf_to_html.SetImageOfEntirePage(true);
  }
  

 

Method: PDF2Html::SetImageDpi

  • Description: set the DPI of the converted image
  • Parameters Description:

Parameter

Type

Must

Description

dpi

float

Yes

The DPI of the image

Return type:

Type

Description

Void


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
  pdf_to_html.SetImageDpi(90);
  }
  

 

Method: PDF2Html::GetIgnoreLink

  • Description: Get whether to ignore hyperlinks in the page

Return type:

Type

Description

bool

whether to ignore hyperlinks in the page


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
  pdf_to_html.SetIgnoreLink(true);
  if (pdf_to_html.GetIgnoreLink()) {
      std::cout << "Ignore hyperlinks." << std::endl;
  }
  

 

Method: PDF2Html::SetIgnoreLink

  • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_link

bool

Yes

whether to ignore hyperlinks in the page

Return type:

Type

Description

Void


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
  pdf_to_html.SetIgnoreLink(true);
  }
  

 

Method: PDF2Html::GetZipOutput

  • Description: Get whether to compress the output document

Return type:

Type

Description

bool

whether to compress the output document


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
  pdf_to_html.SetZipOutput(true);
  if (pdf_to_html.GetZipOutput()) {
      std::cout << "Compress the output document." << std::endl;
  }
  }
  

 

Method: PDF2Html::SetZipOutput

  • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

zip_output

bool

Yes

whether to compress the output document

Return type:

Type

Description

Void


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
  pdf_to_html.SetZipOutput(true);
  }
  

 

Method: PDF2Html::Save

  • Description: Save the converted document
  • Parameters Description:

Parameter

Type

Must

Description

dest_path

const char* or

const wchar_t*

Yes

Destination file path

progress

Progress

No

Save the progress notification object. Default is empty

Return type:

Type

Description

Void


  PDF2Html pdf_to_html;
  auto open_result = pdf_to_html.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Html::kOpenSuccess) {
  pdf_to_html.SetZipOutput(true);
  pdf_to_html.Save(L"F:\\output\\test.zip");
  }
  

PDF To Epub

Function Description

Convert PDF documents to Epub documents

Code sample

  bool ConvertToEpub(const wchar_t* pdf_path, const wchar_t* dest_path) {
      PDF2Epub pdf_to_epub;
      auto open_result = pdf_to_epub.Open(pdf_path);
      if (open_result == PDF2Epub::kOpenSuccess) {
          return pdf_to_epub.Save(dest_path);
  }
  return false;
  }
  

 

Method: PDF2Epub::Open

  • Description: Open the PDF document
  • Parameters Description:

Parameter

Type

Must

Description

file_path

const char* or

const wchar_t*

Yes

PDF document path.

password

const unsigned char*

No

Password

password_length

size_t

No

Password length

Return type:

Type

Description

    /**

    * @brief Open result

    */

    enum OpenResult {

        kOpenFailed,

        kOpenSuccess,

        kOpenNeedPassword = 4,

    };

Whether the opening is successful.

Code sample

  PDF2Epub pdf_to_epub;
  unsigned char pwd[100] = {  "123456" };
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf", pwd, 6u);
  if (open_result != PDF2Epub::kOpenSuccess) {
      switch (open_result) {
          case PDF2Epub::kOpenFailed:
              std::cerr << "Failed to open the document." << std::endl;
              break;
          case PDF2Epub::kOpenNeedPassword:
              std::cerr << "Document requires password." << std::endl;
          default:
              break;
      }
  }
  

 

Method: PDF2Epub::AddPageRange

  • Description: add conversion page range, convert all pages by default.
  • Parameters Description:

Parameter

Type

Must

Description

start

unsigned int

Yes

Start Page

end

unsigned int

Yes

End Page

step

unsigned int

No

Step, the default value is 1

Return type:

Type

Description

Void

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
      pdf_to_epub.AddPageRange(2u,5u);
  }
  

 

Method: PDF2Epub::SetRegion

  • Description: Set the rectangular area of the conversion page
  • Parameters Description:

Parameter

Type

Must

Description

left

float

Yes

The x-axis coordinate value of the upper left corner of the rectangular area

top

float

Yes

The y-axis coordinate value of the upper left corner of the rectangular area

right

float

Yes

The x-axis coordinate value of the lower right corner of the rectangular area

bottom

float

Yes

The y-axis coordinate value of the lower right corner of the rectangular area

Return type:

Type

Description

Void

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
      pdf_to_epub.SetRegion(100,300,200,200);
  }
  

 

Method: PDF2Epub::GetIgnoreImage

    • Description: Get the image in the ignored page, the default is No

Return type:

Type

Description

Bool

Whether to ignore images in the page

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
  pdf_to_epub.SetIgnoreImage(true);
  if (pdf_to_epub.GetIgnoreImage()) {
      std::cout << "Ignore the image.." << std::endl;
  }
  }
  

 

Method: PDF2Epub::GetImageOfEntirePage

  • Description: Get whether to convert each page into an image, the default is No
            • Return type:

Type

Description

bool

Whether to convert each page into an image

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
  pdf_to_epub.SetImageOfEntirePage(true);
  if (pdf_to_epub.GetImageOfEntirePage()) {
      std::cout << "Convert the entire page to an image." << std::endl;
  }
  }
  

 

Method: PDF2Epub::GetImageDpi

  • Description: Get the DPI of the image in the document
              • Return type:

Type

Description

float

DPI value

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
      std::cout <<“DPI:”<< pdf_to_epub.GetImageDpi() << std::endl;
  }
  

 

Method: PDF2Epub::SetIgnoreImage

  1. Description: Set to ignore images in the page
  2. Parameters Description:

Parameter

Type

Must

Description

ignore_image

bool

Yes

Ignore the images in the page

Return type:

Type

Description

Void

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
  pdf_to_epub.SetIgnoreImage(true);
  }
  

 

Method: PDF2Epub::SetImageOfEntirePage

  • Description: set to whether to convert each page into an image
  • Parameters Description:

Parameter

Type

Must

Description

image_of_entire_page

Bool

Yes

Whether to convert each page into an image

Return type:

Type

Description

Void

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
  pdf_to_epub.SetImageOfEntirePage(true);
  }
  

 

Method: PDF2Epub::SetImageDpi

  • Description: set the DPI of the converted image
  • Parameters Description:

Parameter

Type

Must

Description

dpi

float

Yes

The DPI of the image

Return type:

Type

Description

Void

Code sample

  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
  pdf_to_epub.SetImageDpi(90);
  }
  

 

Method: PDF2Epub::GetIgnoreLink

    • Description: Get whether to ignore hyperlinks in the page

Return type:

Type

Description

bool

whether to ignore hyperlinks in the page

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
  pdf_to_epub.SetIgnoreLink(true);
  if (pdf_to_epub.GetIgnoreLink()) {
      std::cout << "Ignore hyperlinks." << std::endl;
  }
  }
  

 

Method: PDF2Epub::SetIgnoreLink

  • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_link

bool

Yes

whether to ignore hyperlinks in the page

Return type:

Type

Description

Void

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
  pdf_to_epub.SetIgnoreLink(true);
  }
  

 

Method: PDF2Epub::SetCoverImage

  • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

cover_image_file

const wchar_t* or

const char*

Yes

Image path

image_format

/**

* @brief image format

*/

enum CoverImageFormat {

    kCoverImageFormatJpeg, /**< @brief JPEG format */

    kCoverImageFormatPng,  /**< @brief PNG format */

};

Yes

Image format

Return type:

Type

Description

Void

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
  pdf_to_epub.SetCoverImage(L"F:\\output\\cover.jpeg",kCoverImageFormatJpeg);
  }
  

 

Method: PDF2Epub::Save

  • Description: Save the converted document
  • Parameters Description:

Parameter

Type

Must

Description

dest_path

const char* or

const wchar_t*

Yes

Destination file path

progress

Progress

No

Save the progress notification object. Default is empty

Return type:

Type

Description

Void

Code sample

  PDF2Epub pdf_to_epub;
  auto open_result = pdf_to_epub.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Epub::kOpenSuccess) {
  pdf_to_epub.SetCoverImage(L"F:\\output\\cover.jpeg",kCoverImageFormatJpeg);
  pdf_to_epub.Save(L"F:\\output\\test.epub");
  }
  

PDF To Pages

Function Description

Convert PDF documents to Pages documents

Code sample

  bool ConvertToPages(const wchar_t* pdf_path, const wchar_t* dest_path) {
      PDF2Pages pdf_to_pages;
      auto open_result = pdf_to_pages.Open(pdf_path);
      if (open_result == PDF2Pages::kOpenSuccess) {
          return pdf_to_pages.Save(dest_path);
  }
  return false;
  }
  

 

Method: PDF2Pages::Open

  • Description: Open the PDF document
  • Parameters Description:

Parameter

Type

Must

Description

file_path

const char* or

const wchar_t*

Yes

PDF document path.

password

const unsigned char*

No

Password

password_length

size_t

No

Password length

Return type:

Type

Description

    /**

    * @brief Open result

    */

    enum OpenResult {

        kOpenFailed,

        kOpenSuccess,

        kOpenNeedPassword = 4,

    };

Whether the opening is successful.

Code sample

  PDF2Pages pdf_to_pages;
  unsigned char pwd[100] = {  "123456" };
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf", pwd, 6u);
  if (open_result != PDF2Pages::kOpenSuccess) {
      switch (open_result) {
          case PDF2Pages::kOpenFailed:
              std::cerr << "Failed to open the document." << std::endl;
              break;
          case PDF2Pages::kOpenNeedPassword:
              std::cerr << "Document requires password." << std::endl;
          default:
              break;
      }
  }
  

 

Method: PDF2Pages::AddPageRange

  • Description: add conversion page range, convert all pages by default.
  • Parameters Description:

Parameter

Type

Must

Description

start

unsigned int

Yes

Start Page

end

unsigned int

Yes

End Page

step

unsigned int

No

Step, the default value is 1

Return type:

Type

Description

Void

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
      pdf_to_pages.AddPageRange(2u,5u);
  }
  

 

Method: PDF2Pages::SetRegion

  • Description: Set the rectangular area of the conversion page
  • Parameters Description:

Parameter

Type

Must

Description

left

float

Yes

The x-axis coordinate value of the upper left corner of the rectangular area

top

float

Yes

The y-axis coordinate value of the upper left corner of the rectangular area

right

float

Yes

The x-axis coordinate value of the lower right corner of the rectangular area

bottom

float

Yes

The y-axis coordinate value of the lower right corner of the rectangular area

Return type:

Type

Description

Void

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
      pdf_to_pages.SetRegion(100,300,200,200);
  }
  

 

Method: PDF2Pages::GetIgnoreImage

    • Description: Get the image in the ignored page, the default is No

Return type:

Type

Description

Bool

Whether to ignore images in the page

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
  pdf_to_pages.SetIgnoreImage(true);
  if (pdf_to_pages.GetIgnoreImage()) {
      std::cout << "Ignore the image.." << std::endl;
  }
  }
  

 

Method: PDF2Pages::GetImageOfEntirePage

    • Description: Get whether to convert each page into an image, the default is No

Return type:

Type

Description

bool

Whether to convert each page into an image

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
  pdf_to_pages.SetImageOfEntirePage(true);
  if (pdf_to_pages.GetImageOfEntirePage()) {
      std::cout << "Convert the entire page to an image." << std::endl;
  }
  }
  

 

Method: PDF2Pages::GetImageDpi

    • Description: Get the DPI of the image in the document

Return type:

Type

Description

float

DPI value

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
      std::cout <<“DPI:”<< pdf_to_pages.GetImageDpi() << std::endl;
  }
  

 

Method: PDF2Pages::SetIgnoreImage

  • Description: Set to ignore images in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_image

bool

Yes

Ignore the images in the page

Return type:

Type

Description

Void

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
  pdf_to_pages.SetIgnoreImage(true);
  }
  

 

Method: PDF2Pages::SetImageOfEntirePage

  • Description: set to whether to convert each page into an image
  • Parameters Description:

Parameter

Type

Must

Description

image_of_entire_page

Bool

Yes

Whether to convert each page into an image

Return type:

Type

Description

Void

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
  pdf_to_pages.SetImageOfEntirePage(true);
  }
  

 

Method: PDF2Pages::SetImageDpi

  • Description: set the DPI of the converted image
  • Parameters Description:

Parameter

Type

Must

Description

dpi

float

Yes

The DPI of the image

Return type:

Type

Description

Void

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
  pdf_to_pages.SetImageDpi(90);
  }
  

 

Method: PDF2Pages::GetIgnoreLink

    • Description: Get whether to ignore hyperlinks in the page

Return type:

Type

Description

bool

whether to ignore hyperlinks in the page

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
  pdf_to_pages.SetIgnoreLink(true);
  if (pdf_to_pages.GetIgnoreLink()) {
      std::cout << "Ignore hyperlinks." << std::endl;
  }
  }
  

 

Method: PDF2Pages::SetIgnoreLink

  • Description: Set whether to ignore hyperlinks in the page
  • Parameters Description:

Parameter

Type

Must

Description

ignore_link

bool

Yes

whether to ignore hyperlinks in the page

Return type:

Type

Description

Void

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
  pdf_to_pages.SetIgnoreLink(true);
  }
  

 

Method: PDF2Pages::Save

  • Description: Save the converted document
  • Parameters Description:

Parameter

Type

Must

Description

dest_path

const char* or

const wchar_t*

Yes

Destination file path

progress

Progress

No

Save the progress notification object. Default is empty

Return type:

Type

Description

Void

Code sample

  PDF2Pages pdf_to_pages;
  auto open_result = pdf_to_pages.Open(L"F:\\source\\test.pdf");
  if (open_result == PDF2Pages::kOpenSuccess) {
  pdf_to_pages.SetIgnoreLink(true);
  pdf_to_pages.Save(L"F:\\output\\test.pages");
  }
  

Progress

Function Description

A callback interface for receiving transformation progress, which needs to be implemented by the user

Code sample

    class ProgressImpl: public Progress  {
    public:
        virtual ~ProgressImpl() {}
        bool Pause(){}
        void SetRange(float range_min, float range_max) {}
        void SetPosition(float position){}
    };
    bool ConvertToXml(const wchar_t* pdf_path, const wchar_t* dest_path) {
        PDF2Xml pdf_to_xml;
        auto open_result = pdf_to_xml.Open(pdf_path);
    if (open_result == PDF2Xml::kOpenSuccess) {
        auto progress=std::make_shared();
            return pdf_to_xml.Save(dest_path,progress.get());
    }
    return false;
    }
    

 

Method: Progress::Pause

  • Description: Get whether to pause

Return type:

Type

Description

Bool

Whether to pause

Code sample

    void Progress::Pause(){
        return pause_;
    }
    

 

Method: Progress::SetRange

  • Description: Set progress range
  • Parameters Description:

Parameter

Type

Must

Description

range_min

float

Yes

set minimum value

range_max

float

Yes

set maximum value

Return type:

Type

Description

Void

Code sample

    void Progress::SetRange(float range_min, float range_max){
    range_min_=range_min;
    range_max_=range_max;
    std::cout << "range from:"+range_min_<<“到”<< range_max_<< std::endl;
    }
    

 

Method: Progress::SetPosition

  • Description: Set the position of the progress bar
  • Parameters Description:

Parameter

Type

Must

Description

position

float

Yes

the position of the progress bar

Return type:

Type

Description

Void

Code sample

    void Progress::SetRange(float position){
    position_=position;
    std::cout << "current progress:"+position_<< std::endl;
    }
    

Contact Support Still have confusion or any suggestions? Please contact support and we will reply within 24 hours.

Volume Licensing Program
Digitize paperwork and accelerate the way you create, prepare, and sign documents.

Available for Windows, Mac, iOS, and Android.

Try Free Try Free Try Free Buy Now
Start your free trial!

Skip and Download

×