#include <iostream>
#include "hpdf.h"
using namespace std;

void error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_data)
{
    printf("ERROR: error_no=%04X, detail_no=%d\n",
        (unsigned int)error_no, (int)detail_no);
    throw std::exception(); /* throw exception on error */
}
int main()
{
    HPDF_Doc pdf = HPDF_New(error_handler, NULL); /* set error-handler */
    if (!pdf) {
        printf("error: cannot create PdfDoc object\n");
        return 1;
    }


    HPDF_Free(pdf);
    return 0;
}