#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include "handler.h"
#include "utils.h"
int main (int argc, char **argv)
{
char fname[256];
pdf =
HPDF_NewEx (demo_error_handler, NULL, NULL, 0, NULL);
if (!pdf) {
printf ("error: cannot create PdfDoc object\n");
return 1;
}
if (setjmp(env)) {
return 1;
}
strcpy (fname, argv[0]);
strcat (fname, ".pdf");
i++;
}
return 0;
}
HPDF_STATUS HPDF_SaveToFile(HPDF_Doc pdf, const char *filename)
Saves the current document to file.
void HPDF_Free(HPDF_Doc pdf)
Revoke a document object and all resources.
HPDF_Doc HPDF_NewEx(HPDF_Error_Handler user_error_fn, HPDF_Alloc_Func user_alloc_fn, HPDF_Free_Func user_free_fn, HPDF_UINT mem_pool_buf_size, void *user_data)
Create an instance of a document object and initialize it.
HPDF_STATUS HPDF_Destination_SetXYZ(HPDF_Destination dst, HPDF_REAL left, HPDF_REAL top, HPDF_REAL zoom)
Define page appearance with three parameters which are left, top and zoom.
HPDF_Destination HPDF_Page_CreateDestination(HPDF_Page page)
Create new destination object for the page.
HPDF_Outline HPDF_CreateOutline(HPDF_Doc pdf, HPDF_Outline parent, const char *title, HPDF_Encoder encoder)
Create new outline object.
HPDF_STATUS HPDF_Outline_SetOpened(HPDF_Outline outline, HPDF_BOOL opened)
Set whether this outline node is opened when the outline is displayed for the first time.
HPDF_STATUS HPDF_Outline_SetDestination(HPDF_Outline outline, HPDF_Destination dst)
Set target destination object to jump to when outline object is clicked.
HPDF_REAL HPDF_Page_GetHeight(HPDF_Page page)
Get page height.
HPDF_Page HPDF_AddPage(HPDF_Doc pdf)
Create new page and add it after the last page of document.
HPDF_STATUS HPDF_Page_SetSize(HPDF_Page page, HPDF_PageSizes size, HPDF_PageDirection direction)
Change page size and direction to a predefined ones.
HPDF_STATUS HPDF_SetPageMode(HPDF_Doc pdf, HPDF_PageMode mode)
Set document display mode.
#define HPDF_TRUE
Definition: hpdf_consts.h:26
@ HPDF_PAGE_SIZE_US_LETTER
US Loose "Letter" page size (216.0mm x 279.0mm)
Definition: hpdf_page_sizes.h:74
@ HPDF_PAGE_SIZE_EOF
Last page size enum value.
Definition: hpdf_page_sizes.h:914
enum _HPDF_PageSizes HPDF_PageSizes
@ HPDF_PAGE_PORTRAIT
Portrait orientation (longest size vertical)
Definition: hpdf_types.h:575
@ HPDF_PAGE_MODE_USE_THUMBS
Definition: hpdf_types.h:363
const char * HPDF_PageSizeName(HPDF_PageSizes size)
Return name of predefined page size.
Definition: hpdf_objects.h:333
Definition: hpdf_objects.h:421
Definition: hpdf_doc.h:36