Getting Started

Getting Started

Getting Started

This page will help you install PDFix on your system, so that you can build apps with it right away.
Download PDFix SDK

Go to the Download page. Please download the proper package for your operating system and architecture.

Choose your package

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

Get the Licence key

Generate trial license key for your platform. Use this license key to initialize PDFix in your application.

Integrate PDFix into your code

Use the code bellow based on the language you use in your application.

Platforms and programming languages

  C++ Java C# .NET Core 2.0 Kotlin
Windows Coming soon  
Mac   Coming soon  
Linux   Coming soon  
Android     Coming soon
iOS        

Choose your package:

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

PDFix SDK Samples

Samples help you to integrate PDFix technology into your applications.

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");
if (!pdfix.Authorize(email, licenseKey))
throw new Exception(pdfix.GetError());
// ...
pdfix.Destroy();
}
}
}