#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "handler.h"
#include "utils.h"
int main(int argc, char **argv)
{
char fname[256];
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;
}
font =
HPDF_GetFont (pdf,
"Times-Roman",
"WinAnsiEncoding");
"Icon. \n This annotation set to be opened initially.",
NULL);
"Annotation with Key Icon", NULL);
"Annotation with Note Icon", NULL);
"Annotation with Help Icon", NULL);
"Annotation with NewParagraph Icon", NULL);
"Annotation with Paragraph Icon", NULL);
"Annotation with Insert Icon", NULL);
const char *annotation_text = "Annotation with ISO8859 text %s";
char buf[50] = {0};
HPDF_snprintf(buf, 50, annotation_text, iso8859_2_text);
buf, encoding);
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_Encoder HPDF_GetEncoder(HPDF_Doc pdf, const char *encoding_name)
Get encoder object handle by specified encoding name.
HPDF_Font HPDF_GetFont(HPDF_Doc pdf, const char *font_name, const char *encoding_name)
Get requested font object handle.
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_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_STATUS HPDF_TextAnnot_SetIcon(HPDF_Annotation annot, HPDF_AnnotIcon icon)
Define link annotation icon.
HPDF_Annotation HPDF_Page_CreateTextAnnot(HPDF_Page page, HPDF_Rect rect, const char *text, HPDF_Encoder encoder)
Create new text annotation object for the page.
HPDF_STATUS HPDF_TextAnnot_SetOpened(HPDF_Annotation annot, HPDF_BOOL opened)
Define whether link annotation is initially opened.
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.
#define HPDF_TRUE
Definition: hpdf_consts.h:26
@ HPDF_ANNOT_ICON_NEW_PARAGRAPH
"NewParagraph"
Definition: hpdf_types.h:456
@ HPDF_ANNOT_ICON_PARAGRAPH
"Paragraph"
Definition: hpdf_types.h:458
@ HPDF_ANNOT_ICON_HELP
"Help"
Definition: hpdf_types.h:454
@ HPDF_ANNOT_ICON_COMMENT
"Comment"
Definition: hpdf_types.h:448
@ HPDF_ANNOT_ICON_INSERT
"Insert"
Definition: hpdf_types.h:460
@ HPDF_ANNOT_ICON_NOTE
"Note"
Definition: hpdf_types.h:452
Definition: hpdf_objects.h:421
Definition: hpdf_doc.h:36
Definition: hpdf_encoder.h:115
Definition: hpdf_types.h:110
HPDF_REAL top
Definition: hpdf_types.h:114
HPDF_REAL left
Definition: hpdf_types.h:111