Getting Started

Getting Started

PDFix SDK Download
Getting Started
Download PDFix SDK & CLI and Integrate it easily
Step 1

Download PDFix SDK & CLI

We have built this SDK to be as user friendly as possible and to cover every possible scenario. Making a completely responsive PDF experience we have covered the ability for this to run on all major desktop and mobile platforms.

Please download the proper package for your operating system and architecture.

Step 2

Get Trial License Key

Generate trial license key for your platform. We will send you a trial license key immediately into your email. Use this license key to initialize PDFix in your application. It works with the latest version only!

  Select the platform you would like to try
  Provide a brief description of your project or reason of PDFix SDK evaluation
  Enter your email address to receive the Trial Key
  Click Generate trial key button and check your email inbox
Step 3

Choose your package

Follow the matrix below to choose the right packages from the PDFix SDK library.

Select the platform:
Windows Mac Linux Android iOS
Select the programming language:
C++ Java C#
Choose the packages:
PDFix SDK
PDF to HTML
Tesseract OCR
Step 4

Integrate PDFix into your code

Samples help you to integrate PDFix technology into your applications.Use the code bellow based on the language you use in your application.

Available on Mac OS X, Windows, Linux, iOS, Android platforms in C++, Java and C# so take your pick!
If you run into trouble, contact us at support@pdfix.net.
Free 30 days Trial with the full feature set.
Adjustable according to your solution needs.

Integrate PDFix into Java applications (Netbeans, Android Studio, Eclipse)

#include <string>
#include <iostream>
#include "Pdfix.h"
#include "PdfToHtml.h"
PdfToHtml_statics;
// Converts PDF to HTML.
void ConvertToHtml(
const std::wstring& email, // authorization email
const std::wstring& license_key, // authorization license key
const std::wstring& open_path, // source PDF document
const std::wstring& save_path, // output HTML file
const std::wstring& config_path, // configuration file
PdfHtmlParams& html_params // conversion parameters
) {
// initialize Pdfix
if (!Pdfix_init(Pdfix_MODULE_NAME))
throw std::runtime_error("Pdfix initialization fail.");
Pdfix* pdfix = GetPdfix();
if (!pdfix)
throw std::runtime_error("GetPdfix fail");
if (!pdfix->Authorize(email.c_str(), license_key.c_str()))
throw std::runtime_error(pdfix->GetError());
// initialize PdfToHtml
if (!PdfToHtml_init(PdfToHtml_MODULE_NAME))
throw std::runtime_error("PdfToHtml_init fail");
PdfToHtml* pdf_to_html = GetPdfToHtml();
if (!pdf_to_html)
throw std::runtime_error("GetPdfToHtml fail");
std::cout << "PDFix PDF to HTML " << pdf_to_html->GetVersionMajor() << "." <<
pdf_to_html->GetVersionMinor() << "." <<
pdf_to_html->GetVersionPatch() << std::endl;
if (!pdf_to_html->Initialize(pdfix))
throw std::runtime_error(pdfix->GetError());
PdfDoc* doc = pdfix->OpenDoc(open_path.c_str(), L"");
if (!doc)
throw std::runtime_error(pdfix->GetError());
// customize conversion
if (!config_path.empty()) {
PdfDocTemplate* doc_tmpl = doc->GetDocTemplate();
if (!doc_tmpl)
throw std::runtime_error(pdfix->GetError());
PsFileStream* stm = pdfix->CreateFileStream(config_path.c_str(), kPsReadOnly);
if (stm) {
if (!doc_tmpl->LoadFromStream(stm, kDataFormatJson))
throw std::runtime_error(pdfix->GetError());
stm->Destroy();
}
}
PdfHtmlDoc* html_doc = pdf_to_html->OpenHtmlDoc(doc);
if (!html_doc)
throw std::runtime_error(pdfix->GetError());
/* set html_param
html_params.type = kPdfHtmlResponsive;
html_params.width = 1200;
html_params.flags |= kHtmlExportJavaScripts;
html_params.flags |= kHtmlExportFonts;
html_params.flags |= kHtmlRetainFontSize;
html_params.flags |= kHtmlRetainTextColor;
html_params.flags |= kHtmlNoExternalCSS | kHtmlNoExternalJS | kHtmlNoExternalIMG | kHtmlNoExternalFONT;
*/
if (!html_doc->Save(save_path.c_str(), &html_params, nullptr, nullptr))
throw std::runtime_error(pdfix->GetError());
html_doc->Close();
doc->Close();
pdf_to_html->Destroy();
pdfix->Destroy();
}

Integrate PDFix into C++ applications (XCode, Visual Studio)

#include <string>
#include <iostream>
#include "Pdfix.h"
void Initialization(
const std::wstring& email, // authorization email
const std::wstring& license_key // authorization license key
) {
// initialize Pdfix
if (!Pdfix_init(Pdfix_MODULE_NAME))
throw std::runtime_error("Pdfix initialization fail.");
Pdfix* pdfix = GetPdfix();
if (!pdfix)
throw std::runtime_error("GetPdfix fail");
if (pdfix->GetVersionMajor() != PDFIX_VERSION_MAJOR ||
pdfix->GetVersionMinor() != PDFIX_VERSION_MINOR ||
pdfix->GetVersionPatch() != PDFIX_VERSION_PATCH)
throw std::runtime_error("Incompatible version");
if (!pdfix->Authorize(email.c_str(), license_key.c_str()))
throw std::runtime_error(pdfix->GetError());
// ...
pdfix->Destroy();
}

Integrate PDFix into C# applications

using System;
using PDFixSDK.Pdfix;
namespace PDFix.App.Module
{
class Initialization
{
public static void Run(
String email, // authorization email
String licenseKey // license key
)
{
Pdfix pdfix = new Pdfix();
if (pdfix == null)
throw new Exception("Pdfix initialization fail. Please set correct email and license key.");
if (!pdfix.Authorize(email, licenseKey))
throw new Exception(pdfix.GetError());
if (!pdfix.IsAuthorized())
throw new Exception("Pdfix Authorization fail");
// ...
pdfix.Destroy();
}
}
}