2 * << Haru Free PDF Library 2.0.8 >> -- hpdf.h
4 * URL http://libharu.org/
6 * Copyright (c) 1999-2006 Takeshi Kanno
8 * Permission to use, copy, modify, distribute and sell this software
9 * and its documentation for any purpose is hereby granted without fee,
10 * provided that the above copyright notice appear in all copies and
11 * that both that copyright notice and this permission notice appear
12 * in supporting documentation.
13 * It is provided "as is" without express or implied warranty.
20 #include "hpdf_config.h"
21 #include "hpdf_version.h"
23 #define HPDF_UNUSED(a) ((void)(a))
26 # define HPDF_EXPORT(A) __declspec(dllexport) A __stdcall
28 # ifdef HPDF_DLL_MAKE_CDECL
29 # define HPDF_EXPORT(A) __declspec(dllexport) A
31 # ifdef HPDF_SHARED_MAKE
32 # define HPDF_EXPORT(A) extern A
33 # endif /* HPDF_SHARED_MAKE */
34 # endif /* HPDF_DLL_MAKE_CDECL */
35 #endif /* HPDF_DLL_MAKE */
39 # define HPDF_EXPORT(A) __declspec(dllimport) A __stdcall
41 # ifdef HPDF_DLL_CDECL
43 # define HPDF_EXPORT(A) __declspec(dllimport) A
44 # endif /* HPDF_DLL_CDECL */
50 #define HPDF_EXPORT(A) extern A
51 #endif /* HPDF_EXPORT */
53 #include "hpdf_consts.h"
54 #include "hpdf_types.h"
56 typedef void *HPDF_HANDLE;
57 typedef HPDF_HANDLE HPDF_Doc;
58 typedef HPDF_HANDLE HPDF_Page;
59 typedef HPDF_HANDLE HPDF_Pages;
60 typedef HPDF_HANDLE HPDF_Stream;
61 typedef HPDF_HANDLE HPDF_Image;
62 typedef HPDF_HANDLE HPDF_Font;
63 typedef HPDF_HANDLE HPDF_Outline;
64 typedef HPDF_HANDLE HPDF_Encoder;
65 typedef HPDF_HANDLE HPDF_3DMeasure;
66 typedef HPDF_HANDLE HPDF_ExData;
67 typedef HPDF_HANDLE HPDF_Destination;
68 typedef HPDF_HANDLE HPDF_XObject;
69 typedef HPDF_HANDLE HPDF_Annotation;
70 typedef HPDF_HANDLE HPDF_ExtGState;
71 typedef HPDF_HANDLE HPDF_FontDef;
72 typedef HPDF_HANDLE HPDF_U3D;
73 typedef HPDF_HANDLE HPDF_JavaScript;
74 typedef HPDF_HANDLE HPDF_Error;
75 typedef HPDF_HANDLE HPDF_MMgr;
76 typedef HPDF_HANDLE HPDF_Dict;
77 typedef HPDF_HANDLE HPDF_EmbeddedFile;
78 typedef HPDF_HANDLE HPDF_OutputIntent;
79 typedef HPDF_HANDLE HPDF_Xref;
84 #define HPDF_EXPORT(A) A
85 #endif /* HPDF_EXPORT */
87 #include "hpdf_consts.h"
89 #include "hpdf_error.h"
90 #include "hpdf_pdfa.h"
92 #endif /* HPDF_SHARED */
98 HPDF_EXPORT(const char *)
99 HPDF_GetVersion (void);
102 HPDF_EXPORT(HPDF_Doc)
103 HPDF_NewEx (HPDF_Error_Handler user_error_fn,
104 HPDF_Alloc_Func user_alloc_fn,
105 HPDF_Free_Func user_free_fn,
106 HPDF_UINT mem_pool_buf_size,
109 HPDF_EXPORT(HPDF_Doc)
110 HPDF_New (HPDF_Error_Handler user_error_fn,
114 HPDF_EXPORT(HPDF_STATUS)
115 HPDF_SetErrorHandler (HPDF_Doc pdf,
116 HPDF_Error_Handler user_error_fn);
120 HPDF_Free (HPDF_Doc pdf);
123 HPDF_EXPORT(HPDF_STATUS)
124 HPDF_NewDoc (HPDF_Doc pdf);
128 HPDF_FreeDoc (HPDF_Doc pdf);
131 HPDF_EXPORT(HPDF_BOOL)
132 HPDF_HasDoc (HPDF_Doc pdf);
136 HPDF_FreeDocAll (HPDF_Doc pdf);
139 HPDF_EXPORT(HPDF_STATUS)
140 HPDF_SaveToStream (HPDF_Doc pdf);
142 HPDF_EXPORT(HPDF_STATUS)
143 HPDF_GetContents (HPDF_Doc pdf,
147 HPDF_EXPORT(HPDF_UINT32)
148 HPDF_GetStreamSize (HPDF_Doc pdf);
151 HPDF_EXPORT(HPDF_STATUS)
152 HPDF_ReadFromStream (HPDF_Doc pdf,
157 HPDF_EXPORT(HPDF_STATUS)
158 HPDF_ResetStream (HPDF_Doc pdf);
161 HPDF_EXPORT(HPDF_STATUS)
162 HPDF_SaveToFile (HPDF_Doc pdf,
163 const char *file_name);
166 HPDF_EXPORT(HPDF_STATUS)
167 HPDF_GetError (HPDF_Doc pdf);
170 HPDF_EXPORT(HPDF_STATUS)
171 HPDF_GetErrorDetail (HPDF_Doc pdf);
174 HPDF_ResetError (HPDF_Doc pdf);
177 HPDF_EXPORT(HPDF_STATUS)
178 HPDF_CheckError (HPDF_Error error);
181 HPDF_EXPORT(HPDF_STATUS)
182 HPDF_SetPagesConfiguration (HPDF_Doc pdf,
183 HPDF_UINT page_per_pages);
186 HPDF_EXPORT(HPDF_Page)
187 HPDF_GetPageByIndex (HPDF_Doc pdf,
191 /*---------------------------------------------------------------------------*/
192 /*---------------------------------------------------------------------------*/
194 HPDF_EXPORT(HPDF_PageLayout)
195 HPDF_GetPageLayout (HPDF_Doc pdf);
198 HPDF_EXPORT(HPDF_STATUS)
199 HPDF_SetPageLayout (HPDF_Doc pdf,
200 HPDF_PageLayout layout);
203 HPDF_EXPORT(HPDF_PageMode)
204 HPDF_GetPageMode (HPDF_Doc pdf);
207 HPDF_EXPORT(HPDF_STATUS)
208 HPDF_SetPageMode (HPDF_Doc pdf,
212 HPDF_EXPORT(HPDF_UINT)
213 HPDF_GetViewerPreference (HPDF_Doc pdf);
216 HPDF_EXPORT(HPDF_STATUS)
217 HPDF_SetViewerPreference (HPDF_Doc pdf,
221 HPDF_EXPORT(HPDF_STATUS)
222 HPDF_SetOpenAction (HPDF_Doc pdf,
223 HPDF_Destination open_action);
226 /*---------------------------------------------------------------------------*/
227 /*----- page handling -------------------------------------------------------*/
230 HPDF_EXPORT(HPDF_Page)
231 HPDF_GetCurrentPage (HPDF_Doc pdf);
234 HPDF_EXPORT(HPDF_Page)
235 HPDF_AddPage (HPDF_Doc pdf);
238 HPDF_EXPORT(HPDF_Page)
239 HPDF_InsertPage (HPDF_Doc pdf,
243 HPDF_EXPORT(HPDF_STATUS)
244 HPDF_Page_SetWidth (HPDF_Page page,
248 HPDF_EXPORT(HPDF_STATUS)
249 HPDF_Page_SetHeight (HPDF_Page page,
253 HPDF_EXPORT(HPDF_STATUS)
254 HPDF_Page_SetSize (HPDF_Page page,
256 HPDF_PageDirection direction);
258 HPDF_EXPORT(HPDF_STATUS)
259 HPDF_Page_SetRotate (HPDF_Page page,
262 HPDF_EXPORT(HPDF_STATUS)
263 HPDF_Page_SetZoom (HPDF_Page page,
266 /*---------------------------------------------------------------------------*/
267 /*----- font handling -------------------------------------------------------*/
270 HPDF_EXPORT(HPDF_Font)
271 HPDF_GetFont (HPDF_Doc pdf,
272 const char *font_name,
273 const char *encoding_name);
276 HPDF_EXPORT(const char*)
277 HPDF_LoadType1FontFromFile (HPDF_Doc pdf,
278 const char *afm_file_name,
279 const char *data_file_name);
282 HPDF_EXPORT(HPDF_FontDef)
283 HPDF_GetTTFontDefFromFile (HPDF_Doc pdf,
284 const char *file_name,
285 HPDF_BOOL embedding);
287 HPDF_EXPORT(const char*)
288 HPDF_LoadTTFontFromFile (HPDF_Doc pdf,
289 const char *file_name,
290 HPDF_BOOL embedding);
293 HPDF_EXPORT(const char*)
294 HPDF_LoadTTFontFromFile2 (HPDF_Doc pdf,
295 const char *file_name,
297 HPDF_BOOL embedding);
300 HPDF_EXPORT(HPDF_STATUS)
301 HPDF_AddPageLabel (HPDF_Doc pdf,
303 HPDF_PageNumStyle style,
304 HPDF_UINT first_page,
308 HPDF_EXPORT(HPDF_STATUS)
309 HPDF_UseJPFonts (HPDF_Doc pdf);
312 HPDF_EXPORT(HPDF_STATUS)
313 HPDF_UseKRFonts (HPDF_Doc pdf);
316 HPDF_EXPORT(HPDF_STATUS)
317 HPDF_UseCNSFonts (HPDF_Doc pdf);
320 HPDF_EXPORT(HPDF_STATUS)
321 HPDF_UseCNTFonts (HPDF_Doc pdf);
324 /*--------------------------------------------------------------------------*/
325 /*----- outline ------------------------------------------------------------*/
328 HPDF_EXPORT(HPDF_Outline)
329 HPDF_CreateOutline (HPDF_Doc pdf,
332 HPDF_Encoder encoder);
335 HPDF_EXPORT(HPDF_STATUS)
336 HPDF_Outline_SetOpened (HPDF_Outline outline,
340 HPDF_EXPORT(HPDF_STATUS)
341 HPDF_Outline_SetDestination (HPDF_Outline outline,
342 HPDF_Destination dst);
345 /*--------------------------------------------------------------------------*/
346 /*----- destination --------------------------------------------------------*/
348 HPDF_EXPORT(HPDF_Destination)
349 HPDF_Page_CreateDestination (HPDF_Page page);
352 HPDF_EXPORT(HPDF_STATUS)
353 HPDF_Destination_SetXYZ (HPDF_Destination dst,
359 HPDF_EXPORT(HPDF_STATUS)
360 HPDF_Destination_SetFit (HPDF_Destination dst);
363 HPDF_EXPORT(HPDF_STATUS)
364 HPDF_Destination_SetFitH (HPDF_Destination dst,
368 HPDF_EXPORT(HPDF_STATUS)
369 HPDF_Destination_SetFitV (HPDF_Destination dst,
373 HPDF_EXPORT(HPDF_STATUS)
374 HPDF_Destination_SetFitR (HPDF_Destination dst,
381 HPDF_EXPORT(HPDF_STATUS)
382 HPDF_Destination_SetFitB (HPDF_Destination dst);
385 HPDF_EXPORT(HPDF_STATUS)
386 HPDF_Destination_SetFitBH (HPDF_Destination dst,
390 HPDF_EXPORT(HPDF_STATUS)
391 HPDF_Destination_SetFitBV (HPDF_Destination dst,
394 /*--------------------------------------------------------------------------*/
395 /*----- encoder ------------------------------------------------------------*/
397 HPDF_EXPORT(HPDF_Encoder)
398 HPDF_GetEncoder (HPDF_Doc pdf,
399 const char *encoding_name);
402 HPDF_EXPORT(HPDF_Encoder)
403 HPDF_GetCurrentEncoder (HPDF_Doc pdf);
406 HPDF_EXPORT(HPDF_STATUS)
407 HPDF_SetCurrentEncoder (HPDF_Doc pdf,
408 const char *encoding_name);
411 HPDF_EXPORT(HPDF_EncoderType)
412 HPDF_Encoder_GetType (HPDF_Encoder encoder);
415 HPDF_EXPORT(HPDF_ByteType)
416 HPDF_Encoder_GetByteType (HPDF_Encoder encoder,
421 HPDF_EXPORT(HPDF_UNICODE)
422 HPDF_Encoder_GetUnicode (HPDF_Encoder encoder,
426 HPDF_EXPORT(HPDF_WritingMode)
427 HPDF_Encoder_GetWritingMode (HPDF_Encoder encoder);
430 HPDF_EXPORT(HPDF_STATUS)
431 HPDF_UseJPEncodings (HPDF_Doc pdf);
435 HPDF_EXPORT(HPDF_STATUS)
436 HPDF_UseKREncodings (HPDF_Doc pdf);
440 HPDF_EXPORT(HPDF_STATUS)
441 HPDF_UseCNSEncodings (HPDF_Doc pdf);
445 HPDF_EXPORT(HPDF_STATUS)
446 HPDF_UseCNTEncodings (HPDF_Doc pdf);
449 HPDF_EXPORT(HPDF_STATUS)
450 HPDF_UseUTFEncodings (HPDF_Doc pdf);
453 /*--------------------------------------------------------------------------*/
454 /*----- annotation ---------------------------------------------------------*/
456 HPDF_EXPORT(HPDF_Annotation)
457 HPDF_Page_Create3DAnnot (HPDF_Page page,
461 HPDF_EXPORT(HPDF_Annotation)
462 HPDF_Page_CreateTextAnnot (HPDF_Page page,
465 HPDF_Encoder encoder);
467 HPDF_EXPORT(HPDF_Annotation)
468 HPDF_Page_CreateFreeTextAnnot (HPDF_Page page,
471 HPDF_Encoder encoder);
473 HPDF_EXPORT(HPDF_Annotation)
474 HPDF_Page_CreateLineAnnot (HPDF_Page page,
476 HPDF_Encoder encoder);
478 HPDF_EXPORT(HPDF_Annotation)
479 HPDF_Page_CreateLinkAnnot (HPDF_Page page,
481 HPDF_Destination dst);
484 HPDF_EXPORT(HPDF_Annotation)
485 HPDF_Page_CreateURILinkAnnot (HPDF_Page page,
491 HPDF_Page_CreateTextMarkupAnnot (HPDF_Page page,
494 HPDF_Encoder encoder,
495 HPDF_AnnotType subType);
497 HPDF_EXPORT(HPDF_Annotation)
498 HPDF_Page_CreateHighlightAnnot (HPDF_Page page,
501 HPDF_Encoder encoder);
503 HPDF_EXPORT(HPDF_Annotation)
504 HPDF_Page_CreateUnderlineAnnot (HPDF_Page page,
507 HPDF_Encoder encoder);
509 HPDF_EXPORT(HPDF_Annotation)
510 HPDF_Page_CreateSquigglyAnnot (HPDF_Page page,
513 HPDF_Encoder encoder);
515 HPDF_EXPORT(HPDF_Annotation)
516 HPDF_Page_CreateStrikeOutAnnot (HPDF_Page page,
519 HPDF_Encoder encoder);
521 HPDF_EXPORT(HPDF_Annotation)
522 HPDF_Page_CreatePopupAnnot ( HPDF_Page page,
524 HPDF_Annotation parent);
526 HPDF_EXPORT(HPDF_Annotation)
527 HPDF_Page_CreateStampAnnot ( HPDF_Page page,
529 HPDF_StampAnnotName name,
531 HPDF_Encoder encoder);
533 HPDF_EXPORT(HPDF_Annotation)
534 HPDF_Page_CreateProjectionAnnot(HPDF_Page page,
537 HPDF_Encoder encoder);
539 HPDF_EXPORT(HPDF_Annotation)
540 HPDF_Page_CreateSquareAnnot (HPDF_Page page,
543 HPDF_Encoder encoder);
545 HPDF_EXPORT(HPDF_Annotation)
546 HPDF_Page_CreateCircleAnnot (HPDF_Page page,
549 HPDF_Encoder encoder);
551 HPDF_EXPORT(HPDF_STATUS)
552 HPDF_LinkAnnot_SetHighlightMode (HPDF_Annotation annot,
553 HPDF_AnnotHighlightMode mode);
556 HPDF_EXPORT(HPDF_STATUS)
557 HPDF_LinkAnnot_SetBorderStyle (HPDF_Annotation annot,
560 HPDF_UINT16 dash_off);
563 HPDF_EXPORT(HPDF_STATUS)
564 HPDF_TextAnnot_SetIcon (HPDF_Annotation annot,
565 HPDF_AnnotIcon icon);
568 HPDF_EXPORT(HPDF_STATUS)
569 HPDF_TextAnnot_SetOpened (HPDF_Annotation annot,
572 HPDF_EXPORT(HPDF_STATUS)
573 HPDF_Annot_SetRGBColor (HPDF_Annotation annot, HPDF_RGBColor color);
575 HPDF_EXPORT(HPDF_STATUS)
576 HPDF_Annot_SetCMYKColor (HPDF_Annotation annot, HPDF_CMYKColor color);
578 HPDF_EXPORT(HPDF_STATUS)
579 HPDF_Annot_SetGrayColor (HPDF_Annotation annot, HPDF_REAL color);
581 HPDF_EXPORT(HPDF_STATUS)
582 HPDF_Annot_SetNoColor (HPDF_Annotation annot);
584 HPDF_EXPORT(HPDF_STATUS)
585 HPDF_MarkupAnnot_SetTitle (HPDF_Annotation annot, const char* name);
587 HPDF_EXPORT(HPDF_STATUS)
588 HPDF_MarkupAnnot_SetSubject (HPDF_Annotation annot, const char* name);
590 HPDF_EXPORT(HPDF_STATUS)
591 HPDF_MarkupAnnot_SetCreationDate (HPDF_Annotation annot, HPDF_Date value);
593 HPDF_EXPORT(HPDF_STATUS)
594 HPDF_MarkupAnnot_SetTransparency (HPDF_Annotation annot, HPDF_REAL value);
596 HPDF_EXPORT(HPDF_STATUS)
597 HPDF_MarkupAnnot_SetIntent (HPDF_Annotation annot, HPDF_AnnotIntent intent);
599 HPDF_EXPORT(HPDF_STATUS)
600 HPDF_MarkupAnnot_SetPopup (HPDF_Annotation annot, HPDF_Annotation popup);
602 HPDF_EXPORT(HPDF_STATUS)
603 HPDF_MarkupAnnot_SetRectDiff (HPDF_Annotation annot, HPDF_Rect rect); /* RD entry */
605 HPDF_EXPORT(HPDF_STATUS)
606 HPDF_MarkupAnnot_SetCloudEffect (HPDF_Annotation annot, HPDF_INT cloudIntensity); /* BE entry */
608 HPDF_EXPORT(HPDF_STATUS)
609 HPDF_MarkupAnnot_SetInteriorRGBColor (HPDF_Annotation annot, HPDF_RGBColor color); /* IC with RGB entry */
611 HPDF_EXPORT(HPDF_STATUS)
612 HPDF_MarkupAnnot_SetInteriorCMYKColor (HPDF_Annotation annot, HPDF_CMYKColor color); /* IC with CMYK entry */
614 HPDF_EXPORT(HPDF_STATUS)
615 HPDF_MarkupAnnot_SetInteriorGrayColor (HPDF_Annotation annot, HPDF_REAL color); /* IC with Gray entry */
617 HPDF_EXPORT(HPDF_STATUS)
618 HPDF_MarkupAnnot_SetInteriorTransparent (HPDF_Annotation annot); /* IC with No Color entry */
620 HPDF_EXPORT(HPDF_STATUS)
621 HPDF_TextMarkupAnnot_SetQuadPoints ( HPDF_Annotation annot, HPDF_Point lb, HPDF_Point rb, HPDF_Point rt, HPDF_Point lt); /* l-left, r-right, b-bottom, t-top positions */
623 HPDF_EXPORT(HPDF_STATUS)
624 HPDF_Annot_Set3DView ( HPDF_MMgr mmgr,
625 HPDF_Annotation annot,
626 HPDF_Annotation annot3d,
629 HPDF_EXPORT(HPDF_STATUS)
630 HPDF_PopupAnnot_SetOpened (HPDF_Annotation annot,
633 HPDF_EXPORT(HPDF_STATUS)
634 HPDF_FreeTextAnnot_SetLineEndingStyle (HPDF_Annotation annot, HPDF_LineAnnotEndingStyle startStyle, HPDF_LineAnnotEndingStyle endStyle);
636 HPDF_EXPORT(HPDF_STATUS)
637 HPDF_FreeTextAnnot_Set3PointCalloutLine (HPDF_Annotation annot, HPDF_Point startPoint, HPDF_Point kneePoint, HPDF_Point endPoint); /* Callout line will be in default user space */
639 HPDF_EXPORT(HPDF_STATUS)
640 HPDF_FreeTextAnnot_Set2PointCalloutLine (HPDF_Annotation annot, HPDF_Point startPoint, HPDF_Point endPoint); /* Callout line will be in default user space */
642 HPDF_EXPORT(HPDF_STATUS)
643 HPDF_FreeTextAnnot_SetDefaultStyle (HPDF_Annotation annot, const char* style);
645 HPDF_EXPORT(HPDF_STATUS)
646 HPDF_LineAnnot_SetPosition (HPDF_Annotation annot,
647 HPDF_Point startPoint, HPDF_LineAnnotEndingStyle startStyle,
648 HPDF_Point endPoint, HPDF_LineAnnotEndingStyle endStyle);
650 HPDF_EXPORT(HPDF_STATUS)
651 HPDF_LineAnnot_SetLeader (HPDF_Annotation annot, HPDF_INT leaderLen, HPDF_INT leaderExtLen, HPDF_INT leaderOffsetLen);
653 HPDF_EXPORT(HPDF_STATUS)
654 HPDF_LineAnnot_SetCaption (HPDF_Annotation annot, HPDF_BOOL showCaption, HPDF_LineAnnotCapPosition position, HPDF_INT horzOffset, HPDF_INT vertOffset);
656 HPDF_EXPORT(HPDF_STATUS)
657 HPDF_Annotation_SetBorderStyle (HPDF_Annotation annot,
658 HPDF_BSSubtype subtype,
661 HPDF_UINT16 dash_off,
662 HPDF_UINT16 dash_phase);
664 HPDF_EXPORT(HPDF_STATUS)
665 HPDF_ProjectionAnnot_SetExData(HPDF_Annotation annot, HPDF_ExData exdata);
668 /*--------------------------------------------------------------------------*/
669 /*----- 3D Measure ---------------------------------------------------------*/
670 HPDF_EXPORT(HPDF_3DMeasure)
671 HPDF_Page_Create3DC3DMeasure(HPDF_Page page,
672 HPDF_Point3D firstanchorpoint,
673 HPDF_Point3D textanchorpoint
676 HPDF_EXPORT(HPDF_3DMeasure)
677 HPDF_Page_CreatePD33DMeasure(HPDF_Page page,
678 HPDF_Point3D annotationPlaneNormal,
679 HPDF_Point3D firstAnchorPoint,
680 HPDF_Point3D secondAnchorPoint,
681 HPDF_Point3D leaderLinesDirection,
682 HPDF_Point3D measurementValuePoint,
683 HPDF_Point3D textYDirection,
685 const char* unitsString
688 HPDF_EXPORT(HPDF_STATUS)
689 HPDF_3DMeasure_SetName(HPDF_3DMeasure measure,
692 HPDF_EXPORT(HPDF_STATUS)
693 HPDF_3DMeasure_SetColor(HPDF_3DMeasure measure,
694 HPDF_RGBColor color);
696 HPDF_EXPORT(HPDF_STATUS)
697 HPDF_3DMeasure_SetTextSize(HPDF_3DMeasure measure,
700 HPDF_EXPORT(HPDF_STATUS)
701 HPDF_3DC3DMeasure_SetTextBoxSize(HPDF_3DMeasure measure,
705 HPDF_EXPORT(HPDF_STATUS)
706 HPDF_3DC3DMeasure_SetText(HPDF_3DMeasure measure,
708 HPDF_Encoder encoder);
710 HPDF_EXPORT(HPDF_STATUS)
711 HPDF_3DC3DMeasure_SetProjectionAnotation(HPDF_3DMeasure measure,
712 HPDF_Annotation projectionanotation);
714 /*--------------------------------------------------------------------------*/
715 /*----- External Data ---------------------------------------------------------*/
717 HPDF_EXPORT(HPDF_ExData)
718 HPDF_Page_Create3DAnnotExData(HPDF_Page page );
720 HPDF_EXPORT(HPDF_STATUS)
721 HPDF_3DAnnotExData_Set3DMeasurement(HPDF_ExData exdata, HPDF_3DMeasure measure);
723 /*--------------------------------------------------------------------------*/
724 /*--------------------------------------------------------------------------*/
725 /*----- 3D View ---------------------------------------------------------*/
727 HPDF_EXPORT(HPDF_Dict)
728 HPDF_Page_Create3DView (HPDF_Page page,
730 HPDF_Annotation annot3d,
733 HPDF_EXPORT(HPDF_STATUS)
734 HPDF_3DView_Add3DC3DMeasure(HPDF_Dict view,
735 HPDF_3DMeasure measure);
737 /*--------------------------------------------------------------------------*/
738 /*----- image data ---------------------------------------------------------*/
740 HPDF_EXPORT(HPDF_Image)
741 HPDF_LoadPngImageFromMem (HPDF_Doc pdf,
742 const HPDF_BYTE *buffer,
745 HPDF_EXPORT(HPDF_Image)
746 HPDF_LoadPngImageFromFile (HPDF_Doc pdf,
747 const char *filename);
750 HPDF_EXPORT(HPDF_Image)
751 HPDF_LoadPngImageFromFile2 (HPDF_Doc pdf,
752 const char *filename);
755 HPDF_EXPORT(HPDF_Image)
756 HPDF_LoadJpegImageFromFile (HPDF_Doc pdf,
757 const char *filename);
759 HPDF_EXPORT(HPDF_Image)
760 HPDF_LoadJpegImageFromMem (HPDF_Doc pdf,
761 const HPDF_BYTE *buffer,
764 HPDF_EXPORT(HPDF_Image)
765 HPDF_LoadU3DFromFile (HPDF_Doc pdf,
766 const char *filename);
768 HPDF_EXPORT(HPDF_Image)
769 HPDF_Image_LoadRaw1BitImageFromMem (HPDF_Doc pdf,
770 const HPDF_BYTE *buf,
773 HPDF_UINT line_width,
775 HPDF_BOOL top_is_first);
778 HPDF_EXPORT(HPDF_Image)
779 HPDF_LoadRawImageFromFile (HPDF_Doc pdf,
780 const char *filename,
783 HPDF_ColorSpace color_space);
786 HPDF_EXPORT(HPDF_Image)
787 HPDF_LoadRawImageFromMem (HPDF_Doc pdf,
788 const HPDF_BYTE *buf,
791 HPDF_ColorSpace color_space,
792 HPDF_UINT bits_per_component);
794 HPDF_EXPORT(HPDF_STATUS)
795 HPDF_Image_AddSMask (HPDF_Image image,
798 HPDF_EXPORT(HPDF_Point)
799 HPDF_Image_GetSize (HPDF_Image image);
802 HPDF_EXPORT(HPDF_STATUS)
803 HPDF_Image_GetSize2 (HPDF_Image image, HPDF_Point *size);
806 HPDF_EXPORT(HPDF_UINT)
807 HPDF_Image_GetWidth (HPDF_Image image);
810 HPDF_EXPORT(HPDF_UINT)
811 HPDF_Image_GetHeight (HPDF_Image image);
814 HPDF_EXPORT(HPDF_UINT)
815 HPDF_Image_GetBitsPerComponent (HPDF_Image image);
818 HPDF_EXPORT(const char*)
819 HPDF_Image_GetColorSpace (HPDF_Image image);
822 HPDF_EXPORT(HPDF_STATUS)
823 HPDF_Image_SetColorMask (HPDF_Image image,
832 HPDF_EXPORT(HPDF_STATUS)
833 HPDF_Image_SetMaskImage (HPDF_Image image,
834 HPDF_Image mask_image);
837 /*--------------------------------------------------------------------------*/
838 /*----- info dictionary ----------------------------------------------------*/
841 HPDF_EXPORT(HPDF_STATUS)
842 HPDF_SetInfoAttr (HPDF_Doc pdf,
847 HPDF_EXPORT(const char*)
848 HPDF_GetInfoAttr (HPDF_Doc pdf,
852 HPDF_EXPORT(HPDF_STATUS)
853 HPDF_SetInfoDateAttr (HPDF_Doc pdf,
858 /*--------------------------------------------------------------------------*/
859 /*----- encryption ---------------------------------------------------------*/
861 HPDF_EXPORT(HPDF_STATUS)
862 HPDF_SetPassword (HPDF_Doc pdf,
863 const char *owner_passwd,
864 const char *user_passwd);
867 HPDF_EXPORT(HPDF_STATUS)
868 HPDF_SetPermission (HPDF_Doc pdf,
869 HPDF_UINT permission);
872 HPDF_EXPORT(HPDF_STATUS)
873 HPDF_SetEncryptionMode (HPDF_Doc pdf,
874 HPDF_EncryptMode mode,
878 /*--------------------------------------------------------------------------*/
879 /*----- compression --------------------------------------------------------*/
881 HPDF_EXPORT(HPDF_STATUS)
882 HPDF_SetCompressionMode (HPDF_Doc pdf,
886 /*--------------------------------------------------------------------------*/
887 /*----- font ---------------------------------------------------------------*/
889 HPDF_EXPORT(const char*)
890 HPDF_Font_GetFontName (HPDF_Font font);
893 HPDF_EXPORT(const char*)
894 HPDF_Font_GetEncodingName (HPDF_Font font);
897 HPDF_EXPORT(HPDF_INT)
898 HPDF_Font_GetUnicodeWidth (HPDF_Font font,
901 HPDF_EXPORT(HPDF_Box)
902 HPDF_Font_GetBBox (HPDF_Font font);
905 HPDF_EXPORT(HPDF_INT)
906 HPDF_Font_GetAscent (HPDF_Font font);
909 HPDF_EXPORT(HPDF_INT)
910 HPDF_Font_GetDescent (HPDF_Font font);
913 HPDF_EXPORT(HPDF_UINT)
914 HPDF_Font_GetXHeight (HPDF_Font font);
917 HPDF_EXPORT(HPDF_UINT)
918 HPDF_Font_GetCapHeight (HPDF_Font font);
921 HPDF_EXPORT(HPDF_TextWidth)
922 HPDF_Font_TextWidth (HPDF_Font font,
923 const HPDF_BYTE *text,
927 HPDF_EXPORT(HPDF_UINT)
928 HPDF_Font_MeasureText (HPDF_Font font,
929 const HPDF_BYTE *text,
933 HPDF_REAL char_space,
934 HPDF_REAL word_space,
936 HPDF_REAL *real_width);
939 /*--------------------------------------------------------------------------*/
940 /*----- attachements -------------------------------------------------------*/
942 HPDF_EXPORT(HPDF_EmbeddedFile)
943 HPDF_AttachFile (HPDF_Doc pdf,
947 /*--------------------------------------------------------------------------*/
948 /*----- extended graphics state --------------------------------------------*/
950 HPDF_EXPORT(HPDF_ExtGState)
951 HPDF_CreateExtGState (HPDF_Doc pdf);
954 HPDF_EXPORT(HPDF_STATUS)
955 HPDF_ExtGState_SetAlphaStroke (HPDF_ExtGState ext_gstate,
959 HPDF_EXPORT(HPDF_STATUS)
960 HPDF_ExtGState_SetAlphaFill (HPDF_ExtGState ext_gstate,
965 HPDF_EXPORT(HPDF_STATUS)
966 HPDF_ExtGState_SetBlendMode (HPDF_ExtGState ext_gstate,
967 HPDF_BlendMode mode);
970 /*--------------------------------------------------------------------------*/
971 /*--------------------------------------------------------------------------*/
973 HPDF_EXPORT(HPDF_REAL)
974 HPDF_Page_TextWidth (HPDF_Page page,
978 HPDF_EXPORT(HPDF_UINT)
979 HPDF_Page_MeasureText (HPDF_Page page,
983 HPDF_REAL *real_width);
986 HPDF_EXPORT(HPDF_REAL)
987 HPDF_Page_GetWidth (HPDF_Page page);
990 HPDF_EXPORT(HPDF_REAL)
991 HPDF_Page_GetHeight (HPDF_Page page);
994 HPDF_EXPORT(HPDF_UINT16)
995 HPDF_Page_GetGMode (HPDF_Page page);
998 HPDF_EXPORT(HPDF_Point)
999 HPDF_Page_GetCurrentPos (HPDF_Page page);
1002 HPDF_EXPORT(HPDF_STATUS)
1003 HPDF_Page_GetCurrentPos2 (HPDF_Page page,
1007 HPDF_EXPORT(HPDF_Point)
1008 HPDF_Page_GetCurrentTextPos (HPDF_Page page);
1011 HPDF_EXPORT(HPDF_STATUS)
1012 HPDF_Page_GetCurrentTextPos2 (HPDF_Page page,
1016 HPDF_EXPORT(HPDF_Font)
1017 HPDF_Page_GetCurrentFont (HPDF_Page page);
1020 HPDF_EXPORT(HPDF_REAL)
1021 HPDF_Page_GetCurrentFontSize (HPDF_Page page);
1024 HPDF_EXPORT(HPDF_TransMatrix)
1025 HPDF_Page_GetTransMatrix (HPDF_Page page);
1028 HPDF_EXPORT(HPDF_REAL)
1029 HPDF_Page_GetLineWidth (HPDF_Page page);
1032 HPDF_EXPORT(HPDF_LineCap)
1033 HPDF_Page_GetLineCap (HPDF_Page page);
1036 HPDF_EXPORT(HPDF_LineJoin)
1037 HPDF_Page_GetLineJoin (HPDF_Page page);
1040 HPDF_EXPORT(HPDF_REAL)
1041 HPDF_Page_GetMiterLimit (HPDF_Page page);
1044 HPDF_EXPORT(HPDF_DashMode)
1045 HPDF_Page_GetDash (HPDF_Page page);
1048 HPDF_EXPORT(HPDF_REAL)
1049 HPDF_Page_GetFlat (HPDF_Page page);
1052 HPDF_EXPORT(HPDF_REAL)
1053 HPDF_Page_GetCharSpace (HPDF_Page page);
1056 HPDF_EXPORT(HPDF_REAL)
1057 HPDF_Page_GetWordSpace (HPDF_Page page);
1060 HPDF_EXPORT(HPDF_REAL)
1061 HPDF_Page_GetHorizontalScalling (HPDF_Page page);
1064 HPDF_EXPORT(HPDF_REAL)
1065 HPDF_Page_GetTextLeading (HPDF_Page page);
1068 HPDF_EXPORT(HPDF_TextRenderingMode)
1069 HPDF_Page_GetTextRenderingMode (HPDF_Page page);
1072 /* This function is obsolete. Use HPDF_Page_GetTextRise. */
1073 HPDF_EXPORT(HPDF_REAL)
1074 HPDF_Page_GetTextRaise (HPDF_Page page);
1077 HPDF_EXPORT(HPDF_REAL)
1078 HPDF_Page_GetTextRise (HPDF_Page page);
1081 HPDF_EXPORT(HPDF_RGBColor)
1082 HPDF_Page_GetRGBFill (HPDF_Page page);
1085 HPDF_EXPORT(HPDF_RGBColor)
1086 HPDF_Page_GetRGBStroke (HPDF_Page page);
1089 HPDF_EXPORT(HPDF_CMYKColor)
1090 HPDF_Page_GetCMYKFill (HPDF_Page page);
1093 HPDF_EXPORT(HPDF_CMYKColor)
1094 HPDF_Page_GetCMYKStroke (HPDF_Page page);
1097 HPDF_EXPORT(HPDF_REAL)
1098 HPDF_Page_GetGrayFill (HPDF_Page page);
1101 HPDF_EXPORT(HPDF_REAL)
1102 HPDF_Page_GetGrayStroke (HPDF_Page page);
1105 HPDF_EXPORT(HPDF_ColorSpace)
1106 HPDF_Page_GetStrokingColorSpace (HPDF_Page page);
1109 HPDF_EXPORT(HPDF_ColorSpace)
1110 HPDF_Page_GetFillingColorSpace (HPDF_Page page);
1113 HPDF_EXPORT(HPDF_TransMatrix)
1114 HPDF_Page_GetTextMatrix (HPDF_Page page);
1117 HPDF_EXPORT(HPDF_UINT)
1118 HPDF_Page_GetGStateDepth (HPDF_Page page);
1121 /*--------------------------------------------------------------------------*/
1122 /*----- GRAPHICS OPERATORS -------------------------------------------------*/
1125 /*--- General graphics state ---------------------------------------------*/
1128 HPDF_EXPORT(HPDF_STATUS)
1129 HPDF_Page_SetLineWidth (HPDF_Page page,
1130 HPDF_REAL line_width);
1133 HPDF_EXPORT(HPDF_STATUS)
1134 HPDF_Page_SetLineCap (HPDF_Page page,
1135 HPDF_LineCap line_cap);
1138 HPDF_EXPORT(HPDF_STATUS)
1139 HPDF_Page_SetLineJoin (HPDF_Page page,
1140 HPDF_LineJoin line_join);
1143 HPDF_EXPORT(HPDF_STATUS)
1144 HPDF_Page_SetMiterLimit (HPDF_Page page,
1145 HPDF_REAL miter_limit);
1148 HPDF_EXPORT(HPDF_STATUS)
1149 HPDF_Page_SetDash (HPDF_Page page,
1150 const HPDF_UINT16 *dash_ptn,
1151 HPDF_UINT num_param,
1156 /* ri --not implemented yet */
1159 HPDF_EXPORT(HPDF_STATUS)
1160 HPDF_Page_SetFlat (HPDF_Page page,
1161 HPDF_REAL flatness);
1165 HPDF_EXPORT(HPDF_STATUS)
1166 HPDF_Page_SetExtGState (HPDF_Page page,
1167 HPDF_ExtGState ext_gstate);
1170 /*--- Special graphic state operator --------------------------------------*/
1173 HPDF_EXPORT(HPDF_STATUS)
1174 HPDF_Page_GSave (HPDF_Page page);
1177 HPDF_EXPORT(HPDF_STATUS)
1178 HPDF_Page_GRestore (HPDF_Page page);
1181 HPDF_EXPORT(HPDF_STATUS)
1182 HPDF_Page_Concat (HPDF_Page page,
1190 /*--- Path construction operator ------------------------------------------*/
1193 HPDF_EXPORT(HPDF_STATUS)
1194 HPDF_Page_MoveTo (HPDF_Page page,
1199 HPDF_EXPORT(HPDF_STATUS)
1200 HPDF_Page_LineTo (HPDF_Page page,
1205 HPDF_EXPORT(HPDF_STATUS)
1206 HPDF_Page_CurveTo (HPDF_Page page,
1215 HPDF_EXPORT(HPDF_STATUS)
1216 HPDF_Page_CurveTo2 (HPDF_Page page,
1223 HPDF_EXPORT(HPDF_STATUS)
1224 HPDF_Page_CurveTo3 (HPDF_Page page,
1231 HPDF_EXPORT(HPDF_STATUS)
1232 HPDF_Page_ClosePath (HPDF_Page page);
1235 HPDF_EXPORT(HPDF_STATUS)
1236 HPDF_Page_Rectangle (HPDF_Page page,
1243 /*--- Path painting operator ---------------------------------------------*/
1246 HPDF_EXPORT(HPDF_STATUS)
1247 HPDF_Page_Stroke (HPDF_Page page);
1250 HPDF_EXPORT(HPDF_STATUS)
1251 HPDF_Page_ClosePathStroke (HPDF_Page page);
1254 HPDF_EXPORT(HPDF_STATUS)
1255 HPDF_Page_Fill (HPDF_Page page);
1258 HPDF_EXPORT(HPDF_STATUS)
1259 HPDF_Page_Eofill (HPDF_Page page);
1262 HPDF_EXPORT(HPDF_STATUS)
1263 HPDF_Page_FillStroke (HPDF_Page page);
1266 HPDF_EXPORT(HPDF_STATUS)
1267 HPDF_Page_EofillStroke (HPDF_Page page);
1270 HPDF_EXPORT(HPDF_STATUS)
1271 HPDF_Page_ClosePathFillStroke (HPDF_Page page);
1274 HPDF_EXPORT(HPDF_STATUS)
1275 HPDF_Page_ClosePathEofillStroke (HPDF_Page page);
1278 HPDF_EXPORT(HPDF_STATUS)
1279 HPDF_Page_EndPath (HPDF_Page page);
1282 /*--- Clipping paths operator --------------------------------------------*/
1285 HPDF_EXPORT(HPDF_STATUS)
1286 HPDF_Page_Clip (HPDF_Page page);
1289 HPDF_EXPORT(HPDF_STATUS)
1290 HPDF_Page_Eoclip (HPDF_Page page);
1293 /*--- Text object operator -----------------------------------------------*/
1296 HPDF_EXPORT(HPDF_STATUS)
1297 HPDF_Page_BeginText (HPDF_Page page);
1300 HPDF_EXPORT(HPDF_STATUS)
1301 HPDF_Page_EndText (HPDF_Page page);
1303 /*--- Text state ---------------------------------------------------------*/
1306 HPDF_EXPORT(HPDF_STATUS)
1307 HPDF_Page_SetCharSpace (HPDF_Page page,
1311 HPDF_EXPORT(HPDF_STATUS)
1312 HPDF_Page_SetWordSpace (HPDF_Page page,
1316 HPDF_EXPORT(HPDF_STATUS)
1317 HPDF_Page_SetHorizontalScalling (HPDF_Page page,
1321 HPDF_EXPORT(HPDF_STATUS)
1322 HPDF_Page_SetTextLeading (HPDF_Page page,
1326 HPDF_EXPORT(HPDF_STATUS)
1327 HPDF_Page_SetFontAndSize (HPDF_Page page,
1332 HPDF_EXPORT(HPDF_STATUS)
1333 HPDF_Page_SetTextRenderingMode (HPDF_Page page,
1334 HPDF_TextRenderingMode mode);
1337 HPDF_EXPORT(HPDF_STATUS)
1338 HPDF_Page_SetTextRise (HPDF_Page page,
1341 /* This function is obsolete. Use HPDF_Page_SetTextRise. */
1342 HPDF_EXPORT(HPDF_STATUS)
1343 HPDF_Page_SetTextRaise (HPDF_Page page,
1346 /*--- Text positioning ---------------------------------------------------*/
1349 HPDF_EXPORT(HPDF_STATUS)
1350 HPDF_Page_MoveTextPos (HPDF_Page page,
1355 HPDF_EXPORT(HPDF_STATUS)
1356 HPDF_Page_MoveTextPos2 (HPDF_Page page,
1361 HPDF_EXPORT(HPDF_STATUS)
1362 HPDF_Page_SetTextMatrix (HPDF_Page page,
1372 HPDF_EXPORT(HPDF_STATUS)
1373 HPDF_Page_MoveToNextLine (HPDF_Page page);
1375 /*--- Text showing -------------------------------------------------------*/
1378 HPDF_EXPORT(HPDF_STATUS)
1379 HPDF_Page_ShowText (HPDF_Page page,
1385 HPDF_EXPORT(HPDF_STATUS)
1386 HPDF_Page_ShowTextNextLine (HPDF_Page page,
1390 HPDF_EXPORT(HPDF_STATUS)
1391 HPDF_Page_ShowTextNextLineEx (HPDF_Page page,
1392 HPDF_REAL word_space,
1393 HPDF_REAL char_space,
1397 /*--- Color showing ------------------------------------------------------*/
1399 /* cs --not implemented yet */
1400 /* CS --not implemented yet */
1401 /* sc --not implemented yet */
1402 /* scn --not implemented yet */
1403 /* SC --not implemented yet */
1404 /* SCN --not implemented yet */
1407 HPDF_EXPORT(HPDF_STATUS)
1408 HPDF_Page_SetGrayFill (HPDF_Page page,
1412 HPDF_EXPORT(HPDF_STATUS)
1413 HPDF_Page_SetGrayStroke (HPDF_Page page,
1417 HPDF_EXPORT(HPDF_STATUS)
1418 HPDF_Page_SetRGBFill (HPDF_Page page,
1424 HPDF_EXPORT(HPDF_STATUS)
1425 HPDF_Page_SetRGBStroke (HPDF_Page page,
1431 HPDF_EXPORT(HPDF_STATUS)
1432 HPDF_Page_SetCMYKFill (HPDF_Page page,
1439 HPDF_EXPORT(HPDF_STATUS)
1440 HPDF_Page_SetCMYKStroke (HPDF_Page page,
1446 /*--- Shading patterns ---------------------------------------------------*/
1448 /* sh --not implemented yet */
1450 /*--- In-line images -----------------------------------------------------*/
1452 /* BI --not implemented yet */
1453 /* ID --not implemented yet */
1454 /* EI --not implemented yet */
1456 /*--- XObjects -----------------------------------------------------------*/
1459 HPDF_EXPORT(HPDF_STATUS)
1460 HPDF_Page_ExecuteXObject (HPDF_Page page,
1463 /*--- Marked content -----------------------------------------------------*/
1465 /* BMC --not implemented yet */
1466 /* BDC --not implemented yet */
1467 /* EMC --not implemented yet */
1468 /* MP --not implemented yet */
1469 /* DP --not implemented yet */
1471 /*--- Compatibility ------------------------------------------------------*/
1473 /* BX --not implemented yet */
1474 /* EX --not implemented yet */
1476 HPDF_EXPORT(HPDF_STATUS)
1477 HPDF_Page_DrawImage (HPDF_Page page,
1485 HPDF_EXPORT(HPDF_STATUS)
1486 HPDF_Page_Circle (HPDF_Page page,
1492 HPDF_EXPORT(HPDF_STATUS)
1493 HPDF_Page_Ellipse (HPDF_Page page,
1500 HPDF_EXPORT(HPDF_STATUS)
1501 HPDF_Page_Arc (HPDF_Page page,
1509 HPDF_EXPORT(HPDF_STATUS)
1510 HPDF_Page_TextOut (HPDF_Page page,
1516 HPDF_EXPORT(HPDF_STATUS)
1517 HPDF_Page_TextRect (HPDF_Page page,
1523 HPDF_TextAlignment align,
1527 HPDF_EXPORT(HPDF_STATUS)
1528 HPDF_Page_SetSlideShow (HPDF_Page page,
1529 HPDF_TransitionStyle type,
1530 HPDF_REAL disp_time,
1531 HPDF_REAL trans_time);
1534 HPDF_EXPORT(HPDF_OutputIntent)
1535 HPDF_ICC_LoadIccFromMem (HPDF_Doc pdf,
1537 HPDF_Stream iccdata,
1541 HPDF_EXPORT(HPDF_OutputIntent)
1542 HPDF_LoadIccProfileFromFile (HPDF_Doc pdf,
1543 const char* icc_file_name,
1548 #endif /* __cplusplus */
1550 #endif /* _HPDF_H */