#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "handler.h"
#include "utils.h"
void
{
char buf[50];
HPDF_snprintf(buf, 50, "Page:%d", page_num);
}
int main(int argc, char **argv)
{
char fname[256];
const char *uri = "http://libharu.org";
strcpy (fname, argv[0]);
strcat (fname, ".pdf");
pdf =
HPDF_New (demo_error_handler, NULL);
if (!pdf) {
printf ("error: cannot create PdfDoc object\n");
return 1;
}
if (setjmp(env)) {
return 1;
}
for (i = 0; i < 7; i++) {
print_page(page[i], font, i + 1);
}
HPDF_Page_ShowText (index_page,
"Jump to Page4 (HilightMode=HPDF_ANNOT_DOWN_APPEARANCE)");
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_New(HPDF_Error_Handler user_error_fn, void *user_data)
Create an instance of a document object and initialize it.
HPDF_Font HPDF_GetFont(HPDF_Doc pdf, const char *font_name, const char *encoding_name)
Get requested font object handle.
HPDF_STATUS HPDF_Page_SetTextLeading(HPDF_Page page, HPDF_REAL value)
Set text leading (line spacing).
HPDF_STATUS HPDF_Page_SetFontAndSize(HPDF_Page page, HPDF_Font font, HPDF_REAL size)
Set the type of font and size leading.
HPDF_STATUS HPDF_Page_MoveToNextLine(HPDF_Page page)
Move current position for text showing depending on current text showing point and text leading.
HPDF_STATUS HPDF_Page_ShowText(HPDF_Page page, const char *text)
Put text at the current text position on the page.
HPDF_STATUS HPDF_Page_BeginText(HPDF_Page page)
Begin text object and set text position to (0, 0).
HPDF_STATUS HPDF_Page_EndText(HPDF_Page page)
Finish text object.
HPDF_STATUS HPDF_Page_MoveTextPos(HPDF_Page page, HPDF_REAL x, HPDF_REAL y)
Change current text position using the specified offset values.
HPDF_Annotation HPDF_Page_CreateURILinkAnnot(HPDF_Page page, HPDF_Rect rect, const char *uri)
Create new web link annotation object for the page.
HPDF_Annotation HPDF_Page_CreateLinkAnnot(HPDF_Page page, HPDF_Rect rect, HPDF_Destination dst)
Create new link annotation object for the page.
HPDF_STATUS HPDF_LinkAnnot_SetHighlightMode(HPDF_Annotation annot, HPDF_AnnotHighlightMode mode)
Define link annotation mouse click appearance.
HPDF_STATUS HPDF_LinkAnnot_SetBorderStyle(HPDF_Annotation annot, HPDF_REAL width, HPDF_UINT16 dash_on, HPDF_UINT16 dash_off)
Define link annotation border style.
HPDF_Destination HPDF_Page_CreateDestination(HPDF_Page page)
Create new destination object for the page.
HPDF_Point HPDF_Page_GetCurrentTextPos(HPDF_Page page)
Get current position for text showing.
HPDF_Page HPDF_AddPage(HPDF_Doc pdf)
Create new page and add it after the last page of document.
HPDF_STATUS HPDF_Page_SetWidth(HPDF_Page page, HPDF_REAL value)
Change page width.
HPDF_STATUS HPDF_Page_SetHeight(HPDF_Page page, HPDF_REAL value)
Change page height.
unsigned int HPDF_UINT
Definition: hpdf_types.h:45
@ HPDF_ANNOT_NO_HIGHTLIGHT
No highlighting.
Definition: hpdf_types.h:430
@ HPDF_ANNOT_INVERT_BORDER
Invert annotation border.
Definition: hpdf_types.h:434
@ HPDF_ANNOT_DOWN_APPEARANCE
Dent annotation.
Definition: hpdf_types.h:436
@ HPDF_ANNOT_INVERT_BOX
Invert annotation area contents.
Definition: hpdf_types.h:432
Definition: hpdf_objects.h:333
Definition: hpdf_objects.h:421
Definition: hpdf_doc.h:36
Definition: hpdf_types.h:105
HPDF_REAL y
Definition: hpdf_types.h:107
HPDF_REAL x
Definition: hpdf_types.h:106
Definition: hpdf_types.h:110
HPDF_REAL top
Definition: hpdf_types.h:114
HPDF_REAL right
Definition: hpdf_types.h:113
HPDF_REAL bottom
Definition: hpdf_types.h:112
HPDF_REAL left
Definition: hpdf_types.h:111