Commit b5efa708 authored by Allison Vacanti's avatar Allison Vacanti
Browse files

Merge branch 'upstream-libharu' into update_libharu

* upstream-libharu:
  libharu 2018-10-03 (bfc84ae5)
parents 74d94885 2f69cc63
...@@ -67,13 +67,13 @@ case of most of UNIX, these libraries are usually installed.) ...@@ -67,13 +67,13 @@ case of most of UNIX, these libraries are usually installed.)
* *
* Available development environment * Available development environment
* *
Haru can work as both static-library (.a, .lib) and shared-library (.so, .dll). Haru can work as both a static-library (.a, .lib) and a shared-library (.so, .dll).
When you use it as static-library, It can be used by C and a C++. When you use it as a static-library, It can be used by C and C++.
But when you use it as shared-library, it can be used by many development But when you use it as a shared-library, it can be used by many development
languages which support shared library. languages which support shared libraries.
So far, Haru provides bindings for Ruby, Delphi/Free Pascal and C#. So far, Haru provides bindings for Ruby, Delphi/Free Pascal, and C#.
If you write bindings for other programing languages, please notice me! If you write bindings for other programing languages, please inform me!
* *
* Runtime environment of programs using Haru * Runtime environment of programs using Haru
......
...@@ -80,6 +80,7 @@ typedef HPDF_HANDLE HPDF_EmbeddedFile; ...@@ -80,6 +80,7 @@ typedef HPDF_HANDLE HPDF_EmbeddedFile;
typedef HPDF_HANDLE HPDF_OutputIntent; typedef HPDF_HANDLE HPDF_OutputIntent;
typedef HPDF_HANDLE HPDF_Xref; typedef HPDF_HANDLE HPDF_Xref;
typedef HPDF_HANDLE HPDF_Shading; typedef HPDF_HANDLE HPDF_Shading;
typedef HPDF_HANDLE HPDF_Boolean;
#else #else
...@@ -194,6 +195,9 @@ HPDF_GetPageByIndex (HPDF_Doc pdf, ...@@ -194,6 +195,9 @@ HPDF_GetPageByIndex (HPDF_Doc pdf,
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
HPDF_EXPORT(HPDF_MMgr)
HPDF_GetPageMMgr (HPDF_Page page);
HPDF_EXPORT(HPDF_PageLayout) HPDF_EXPORT(HPDF_PageLayout)
HPDF_GetPageLayout (HPDF_Doc pdf); HPDF_GetPageLayout (HPDF_Doc pdf);
...@@ -453,13 +457,31 @@ HPDF_EXPORT(HPDF_STATUS) ...@@ -453,13 +457,31 @@ HPDF_EXPORT(HPDF_STATUS)
HPDF_UseUTFEncodings (HPDF_Doc pdf); HPDF_UseUTFEncodings (HPDF_Doc pdf);
/*--------------------------------------------------------------------------*/
/*----- XObject ------------------------------------------------------------*/
HPDF_EXPORT(HPDF_XObject)
HPDF_Page_CreateXObjectFromImage (HPDF_Doc pdf,
HPDF_Page page,
HPDF_Rect rect,
HPDF_Image image,
HPDF_Boolean zoom);
HPDF_EXPORT(HPDF_XObject)
HPDF_Page_CreateXObjectAsWhiteRect (HPDF_Doc pdf,
HPDF_Page page,
HPDF_Rect rect);
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/*----- annotation ---------------------------------------------------------*/ /*----- annotation ---------------------------------------------------------*/
HPDF_EXPORT(HPDF_Annotation) HPDF_EXPORT(HPDF_Annotation)
HPDF_Page_Create3DAnnot (HPDF_Page page, HPDF_Page_Create3DAnnot (HPDF_Page page,
HPDF_Rect rect, HPDF_Rect rect,
HPDF_U3D u3d); HPDF_BOOL tb,
HPDF_BOOL np,
HPDF_U3D u3d,
HPDF_Image ap);
HPDF_EXPORT(HPDF_Annotation) HPDF_EXPORT(HPDF_Annotation)
HPDF_Page_CreateTextAnnot (HPDF_Page page, HPDF_Page_CreateTextAnnot (HPDF_Page page,
...@@ -478,6 +500,15 @@ HPDF_Page_CreateLineAnnot (HPDF_Page page, ...@@ -478,6 +500,15 @@ HPDF_Page_CreateLineAnnot (HPDF_Page page,
const char *text, const char *text,
HPDF_Encoder encoder); HPDF_Encoder encoder);
HPDF_EXPORT(HPDF_Annotation)
HPDF_Page_CreateWidgetAnnot_WhiteOnlyWhilePrint (HPDF_Doc pdf,
HPDF_Page page,
HPDF_Rect rect);
HPDF_EXPORT(HPDF_Annotation)
HPDF_Page_CreateWidgetAnnot (HPDF_Page page,
HPDF_Rect rect);
HPDF_EXPORT(HPDF_Annotation) HPDF_EXPORT(HPDF_Annotation)
HPDF_Page_CreateLinkAnnot (HPDF_Page page, HPDF_Page_CreateLinkAnnot (HPDF_Page page,
HPDF_Rect rect, HPDF_Rect rect,
...@@ -555,6 +586,9 @@ HPDF_EXPORT(HPDF_STATUS) ...@@ -555,6 +586,9 @@ HPDF_EXPORT(HPDF_STATUS)
HPDF_LinkAnnot_SetHighlightMode (HPDF_Annotation annot, HPDF_LinkAnnot_SetHighlightMode (HPDF_Annotation annot,
HPDF_AnnotHighlightMode mode); HPDF_AnnotHighlightMode mode);
HPDF_EXPORT(HPDF_STATUS)
HPDF_LinkAnnot_SetJavaScript(HPDF_Annotation annot,
HPDF_JavaScript javascript);
HPDF_EXPORT(HPDF_STATUS) HPDF_EXPORT(HPDF_STATUS)
HPDF_LinkAnnot_SetBorderStyle (HPDF_Annotation annot, HPDF_LinkAnnot_SetBorderStyle (HPDF_Annotation annot,
......
...@@ -34,6 +34,10 @@ HPDF_Annotation_New (HPDF_MMgr mmgr, ...@@ -34,6 +34,10 @@ HPDF_Annotation_New (HPDF_MMgr mmgr,
HPDF_AnnotType type, HPDF_AnnotType type,
HPDF_Rect rect); HPDF_Rect rect);
HPDF_Annotation
HPDF_WidgetAnnot_New (HPDF_MMgr mmgr,
HPDF_Xref xref,
HPDF_Rect rect);
HPDF_Annotation HPDF_Annotation
HPDF_LinkAnnot_New (HPDF_MMgr mmgr, HPDF_LinkAnnot_New (HPDF_MMgr mmgr,
...@@ -53,7 +57,10 @@ HPDF_Annotation ...@@ -53,7 +57,10 @@ HPDF_Annotation
HPDF_3DAnnot_New (HPDF_MMgr mmgr, HPDF_3DAnnot_New (HPDF_MMgr mmgr,
HPDF_Xref xref, HPDF_Xref xref,
HPDF_Rect rect, HPDF_Rect rect,
HPDF_U3D u3d); HPDF_BOOL tb,
HPDF_BOOL np,
HPDF_U3D u3d,
HPDF_Image ap);
HPDF_Annotation HPDF_Annotation
HPDF_MarkupAnnot_New (HPDF_MMgr mmgr, HPDF_MarkupAnnot_New (HPDF_MMgr mmgr,
......
...@@ -109,14 +109,14 @@ ...@@ -109,14 +109,14 @@
#define HPDF_LIMIT_MAX_INT 2147483647 #define HPDF_LIMIT_MAX_INT 2147483647
#define HPDF_LIMIT_MIN_INT -2147483647 #define HPDF_LIMIT_MIN_INT -2147483647
#define HPDF_LIMIT_MAX_REAL 32767 #define HPDF_LIMIT_MAX_REAL 3.4E38f // per PDF 1.7 spec, Annex C, old value 32767
#define HPDF_LIMIT_MIN_REAL -32767 #define HPDF_LIMIT_MIN_REAL -3.4E38f // per PDF 1.7 spec, Annex C, old value -32767
#define HPDF_LIMIT_MAX_STRING_LEN 65535 #define HPDF_LIMIT_MAX_STRING_LEN 2147483646 // per PDF 1.7 spec, limit 32767 is for strings in content stream and no limit in other cases => open the limit to max Integer, old value 65535
#define HPDF_LIMIT_MAX_NAME_LEN 127 #define HPDF_LIMIT_MAX_NAME_LEN 127
#define HPDF_LIMIT_MAX_ARRAY 32767 #define HPDF_LIMIT_MAX_ARRAY 8388607 // per PDF 1.7 spec, "Maximum number of indirect objects in a PDF file" is 8388607, old value 8191
#define HPDF_LIMIT_MAX_DICT_ELEMENT 4095 #define HPDF_LIMIT_MAX_DICT_ELEMENT 8388607 // per PDF 1.7 spec, "Maximum number of indirect objects in a PDF file" is 8388607, old value 4095
#define HPDF_LIMIT_MAX_XREF_ELEMENT 8388607 #define HPDF_LIMIT_MAX_XREF_ELEMENT 8388607
#define HPDF_LIMIT_MAX_GSTATE 28 #define HPDF_LIMIT_MAX_GSTATE 28
#define HPDF_LIMIT_MAX_DEVICE_N 8 #define HPDF_LIMIT_MAX_DEVICE_N 8
......
...@@ -382,6 +382,8 @@ HPDF_STATUS ...@@ -382,6 +382,8 @@ HPDF_STATUS
HPDF_Array_AddReal (HPDF_Array array, HPDF_Array_AddReal (HPDF_Array array,
HPDF_REAL value); HPDF_REAL value);
HPDF_STATUS
HPDF_Array_AddNull (HPDF_Array array);
HPDF_STATUS HPDF_STATUS
HPDF_Array_AddName (HPDF_Array array, HPDF_Array_AddName (HPDF_Array array,
......
...@@ -225,6 +225,23 @@ typedef struct _HPDF_TransMatrix { ...@@ -225,6 +225,23 @@ typedef struct _HPDF_TransMatrix {
HPDF_REAL y; HPDF_REAL y;
} HPDF_TransMatrix; } HPDF_TransMatrix;
/*---------------------------------------------------------------------------*/
/*----- HPDF_3DMatrix struct ------------------------------------------------*/
typedef struct _HPDF_3DMatrix {
HPDF_REAL a;
HPDF_REAL b;
HPDF_REAL c;
HPDF_REAL d;
HPDF_REAL e;
HPDF_REAL f;
HPDF_REAL g;
HPDF_REAL h;
HPDF_REAL i;
HPDF_REAL tx;
HPDF_REAL ty;
HPDF_REAL tz;
} HPDF_3DMatrix;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -368,7 +385,8 @@ typedef enum _HPDF_AnnotType { ...@@ -368,7 +385,8 @@ typedef enum _HPDF_AnnotType {
HPDF_ANNOT_3D, HPDF_ANNOT_3D,
HPDF_ANNOT_SQUIGGLY, HPDF_ANNOT_SQUIGGLY,
HPDF_ANNOT_LINE, HPDF_ANNOT_LINE,
HPDF_ANNOT_PROJECTION HPDF_ANNOT_PROJECTION,
HPDF_ANNOT_WIDGET
} HPDF_AnnotType; } HPDF_AnnotType;
......
...@@ -25,6 +25,7 @@ extern "C" { ...@@ -25,6 +25,7 @@ extern "C" {
#endif #endif
HPDF_EXPORT(HPDF_JavaScript) HPDF_CreateJavaScript(HPDF_Doc pdf, const char *code); HPDF_EXPORT(HPDF_JavaScript) HPDF_CreateJavaScript(HPDF_Doc pdf, const char *code);
HPDF_EXPORT(HPDF_JavaScript) HPDF_LoadJSFromFile (HPDF_Doc pdf, const char *filename);
HPDF_EXPORT(HPDF_U3D) HPDF_LoadU3DFromFile (HPDF_Doc pdf, const char *filename); HPDF_EXPORT(HPDF_U3D) HPDF_LoadU3DFromFile (HPDF_Doc pdf, const char *filename);
...@@ -33,12 +34,19 @@ HPDF_EXPORT(HPDF_Dict) HPDF_Create3DView (HPDF_MMgr mmgr, const char *name); ...@@ -33,12 +34,19 @@ HPDF_EXPORT(HPDF_Dict) HPDF_Create3DView (HPDF_MMgr mmgr, const char *name);
HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_Add3DView(HPDF_U3D u3d, HPDF_Dict view); HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_Add3DView(HPDF_U3D u3d, HPDF_Dict view);
HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_SetDefault3DView(HPDF_U3D u3d, const char *name); HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_SetDefault3DView(HPDF_U3D u3d, const char *name);
HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_AddOnInstanciate(HPDF_U3D u3d, HPDF_JavaScript javaScript); HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_AddOnInstanciate(HPDF_U3D u3d, HPDF_JavaScript javaScript);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_AddNode(HPDF_Dict view, const char *name, HPDF_REAL opacity, HPDF_BOOL visible); HPDF_EXPORT(HPDF_Dict) HPDF_3DView_CreateNode(HPDF_Dict view, const char *name);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DViewNode_SetOpacity(HPDF_Dict node, HPDF_REAL opacity);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DViewNode_SetVisibility(HPDF_Dict node, HPDF_BOOL visible);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DViewNode_SetMatrix(HPDF_Dict node, HPDF_3DMatrix Mat3D);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_AddNode(HPDF_Dict view, HPDF_Dict node);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetLighting(HPDF_Dict view, const char *scheme); HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetLighting(HPDF_Dict view, const char *scheme);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetBackgroundColor(HPDF_Dict view, HPDF_REAL r, HPDF_REAL g, HPDF_REAL b); HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetBackgroundColor(HPDF_Dict view, HPDF_REAL r, HPDF_REAL g, HPDF_REAL b);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetPerspectiveProjection(HPDF_Dict view, HPDF_REAL fov); HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetPerspectiveProjection(HPDF_Dict view, HPDF_REAL fov);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetOrthogonalProjection(HPDF_Dict view, HPDF_REAL mag); HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetOrthogonalProjection(HPDF_Dict view, HPDF_REAL mag);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCamera(HPDF_Dict view, HPDF_REAL coox, HPDF_REAL cooy, HPDF_REAL cooz, HPDF_REAL c2cx, HPDF_REAL c2cy, HPDF_REAL c2cz, HPDF_REAL roo, HPDF_REAL roll); HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCamera(HPDF_Dict view, HPDF_REAL coox, HPDF_REAL cooy, HPDF_REAL cooz, HPDF_REAL c2cx, HPDF_REAL c2cy, HPDF_REAL c2cz, HPDF_REAL roo, HPDF_REAL roll);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCameraByMatrix(HPDF_Dict view, HPDF_3DMatrix Mat3D, HPDF_REAL co);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCrossSectionOn(HPDF_Dict view, HPDF_Point3D center, HPDF_REAL Roll, HPDF_REAL Pitch, HPDF_REAL opacity, HPDF_BOOL showintersection);
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCrossSectionOff(HPDF_Dict view);
HPDF_Dict HPDF_Dict
HPDF_3DView_New ( HPDF_MMgr mmgr, HPDF_3DView_New ( HPDF_MMgr mmgr,
......
/* automatically generated by configure */ /* automatically generated by configure */
/* edit configure.in to change version number */ /* edit configure.in to change version number */
#define HPDF_MAJOR_VERSION 2 #define HPDF_MAJOR_VERSION 2
#define HPDF_MINOR_VERSION 3 #define HPDF_MINOR_VERSION 4
#define HPDF_BUGFIX_VERSION 0 #define HPDF_BUGFIX_VERSION 0
#define HPDF_EXTRA_VERSION "RC2" #define HPDF_EXTRA_VERSION "dev"
#define HPDF_VERSION_TEXT "2.3.0RC2" #define HPDF_VERSION_TEXT "2.4.0dev"
#define HPDF_VERSION_ID 20300 #define HPDF_VERSION_ID 20400
...@@ -39,6 +39,7 @@ static const char * const HPDF_ANNOT_TYPE_NAMES[] = { ...@@ -39,6 +39,7 @@ static const char * const HPDF_ANNOT_TYPE_NAMES[] = {
"Squiggly", "Squiggly",
"Line", "Line",
"Projection" "Projection"
"Widget"
}; };
static const char * const HPDF_ANNOT_ICON_NAMES_NAMES[] = { static const char * const HPDF_ANNOT_ICON_NAMES_NAMES[] = {
...@@ -222,6 +223,21 @@ HPDF_Annotation_SetBorderStyle (HPDF_Annotation annot, ...@@ -222,6 +223,21 @@ HPDF_Annotation_SetBorderStyle (HPDF_Annotation annot,
return HPDF_OK; return HPDF_OK;
} }
HPDF_Annotation
HPDF_WidgetAnnot_New (HPDF_MMgr mmgr,
HPDF_Xref xref,
HPDF_Rect rect)
{
HPDF_Annotation annot;
HPDF_PTRACE((" HPDF_WidgetAnnot_New\n"));
annot = HPDF_Annotation_New (mmgr, xref, HPDF_ANNOT_WIDGET, rect);
if (!annot)
return NULL;
return annot;
}
HPDF_Annotation HPDF_Annotation
HPDF_LinkAnnot_New (HPDF_MMgr mmgr, HPDF_LinkAnnot_New (HPDF_MMgr mmgr,
...@@ -237,8 +253,11 @@ HPDF_LinkAnnot_New (HPDF_MMgr mmgr, ...@@ -237,8 +253,11 @@ HPDF_LinkAnnot_New (HPDF_MMgr mmgr,
if (!annot) if (!annot)
return NULL; return NULL;
if (dst)
{
if (HPDF_Dict_Add (annot, "Dest", dst) != HPDF_OK) if (HPDF_Dict_Add (annot, "Dest", dst) != HPDF_OK)
return NULL; return NULL;
}
return annot; return annot;
} }
...@@ -279,6 +298,35 @@ HPDF_URILinkAnnot_New (HPDF_MMgr mmgr, ...@@ -279,6 +298,35 @@ HPDF_URILinkAnnot_New (HPDF_MMgr mmgr,
return annot; return annot;
} }
HPDF_EXPORT(HPDF_STATUS)
HPDF_LinkAnnot_SetJavaScript(HPDF_Annotation annot, HPDF_JavaScript javascript)
{
HPDF_Dict action;
HPDF_STATUS ret;
HPDF_PTRACE((" HPDF_LinkAnnot_SetJavaScript\n"));
if (!CheckSubType (annot, HPDF_ANNOT_LINK))
return HPDF_INVALID_ANNOTATION;
/* create action dictionary */
action = HPDF_Dict_New (annot->mmgr);
if (!action)
return HPDF_CheckError ( annot->error);
ret = HPDF_Dict_Add (annot, "A", action);
if (ret != HPDF_OK)
return HPDF_CheckError (annot->error);
ret += HPDF_Dict_Add (action, "JS", javascript);
ret += HPDF_Dict_AddName (action, "S", "JavaScript");
if (ret != HPDF_OK)
return HPDF_CheckError (annot->error);
return HPDF_OK;
}
HPDF_EXPORT(HPDF_STATUS) HPDF_EXPORT(HPDF_STATUS)
HPDF_LinkAnnot_SetBorderStyle (HPDF_Annotation annot, HPDF_LinkAnnot_SetBorderStyle (HPDF_Annotation annot,
HPDF_REAL width, HPDF_REAL width,
...@@ -366,7 +414,10 @@ HPDF_Annotation ...@@ -366,7 +414,10 @@ HPDF_Annotation
HPDF_3DAnnot_New (HPDF_MMgr mmgr, HPDF_3DAnnot_New (HPDF_MMgr mmgr,
HPDF_Xref xref, HPDF_Xref xref,
HPDF_Rect rect, HPDF_Rect rect,
HPDF_U3D u3d) HPDF_BOOL tb,
HPDF_BOOL np,
HPDF_U3D u3d,
HPDF_Image ap)
{ {
HPDF_Annotation annot; HPDF_Annotation annot;
HPDF_Dict action, appearance, stream; HPDF_Dict action, appearance, stream;
...@@ -379,6 +430,13 @@ HPDF_3DAnnot_New (HPDF_MMgr mmgr, ...@@ -379,6 +430,13 @@ HPDF_3DAnnot_New (HPDF_MMgr mmgr,
return NULL; return NULL;
} }
// include the flags
HPDF_Dict_AddNumber (annot, "F", 68);
//Bit 3:Print If set, print the annotation when the page is printed.
//Bit 7:If set, do not allow the annotation to interact with the user.
// The annotation may be displayed or printed (depending on the settings of the NoView and Print flags)
// but should not respond to mouse clicks or change its appearance in response to mouse motions.
HPDF_Dict_Add(annot, "Contents", HPDF_String_New (mmgr, "3D Model", NULL)); HPDF_Dict_Add(annot, "Contents", HPDF_String_New (mmgr, "3D Model", NULL));
action = HPDF_Dict_New (mmgr); action = HPDF_Dict_New (mmgr);
...@@ -391,9 +449,20 @@ HPDF_3DAnnot_New (HPDF_MMgr mmgr, ...@@ -391,9 +449,20 @@ HPDF_3DAnnot_New (HPDF_MMgr mmgr,
return NULL; return NULL;
} }
ret += HPDF_Dict_AddName (action, "A", "PV"); // enable visibility on page open
ret += HPDF_Dict_AddName (action, "A", "PO");
// enable visibility of ToolBar
ret += HPDF_Dict_AddBoolean(action, "TB", tb);
// enable visibility of Navigation Panel
ret += HPDF_Dict_AddBoolean(action, "NP", np);
ret += HPDF_Dict_AddBoolean(action, "TB", HPDF_FALSE); // Set behavior of Annotation on Disabling
ret += HPDF_Dict_AddName(action, "DIS", "U");
// Set behavior of Annotation upon activation
ret += HPDF_Dict_AddName(action, "AIS", "L");
if (ret != HPDF_OK) { if (ret != HPDF_OK) {
return NULL; return NULL;
...@@ -413,11 +482,18 @@ HPDF_3DAnnot_New (HPDF_MMgr mmgr, ...@@ -413,11 +482,18 @@ HPDF_3DAnnot_New (HPDF_MMgr mmgr,
return NULL; return NULL;
} }
if (ap) {
if (HPDF_Dict_Add (appearance, "N", ap) != HPDF_OK)
return NULL;
}
else{
stream = HPDF_Dict_New (mmgr); stream = HPDF_Dict_New (mmgr);
if (!stream) { if (!stream) {
return NULL; return NULL;
} }
ret = HPDF_Dict_Add (appearance, "N", stream); ret = HPDF_Dict_Add (appearance, "N", stream);
}
if (ret != HPDF_OK) { if (ret != HPDF_OK) {
return NULL; return NULL;
} }
...@@ -425,23 +501,6 @@ HPDF_3DAnnot_New (HPDF_MMgr mmgr, ...@@ -425,23 +501,6 @@ HPDF_3DAnnot_New (HPDF_MMgr mmgr,
return annot; return annot;
} }
HPDF_EXPORT(HPDF_STATUS)
HPDF_3DAnnot_Set3DView (HPDF_Annotation annot)
{
HPDF_Boolean b;
HPDF_PTRACE((" HPDF_3DAnnot_Set3DView\n"));
if (!CheckSubType (annot, HPDF_ANNOT_3D))
return HPDF_INVALID_ANNOTATION;
b = HPDF_Boolean_New (annot->mmgr, 0);
if (!b)
return HPDF_CheckError (annot->error);
return HPDF_Dict_Add (annot, "3DD", b);
}
HPDF_Annotation HPDF_Annotation
HPDF_MarkupAnnot_New (HPDF_MMgr mmgr, HPDF_MarkupAnnot_New (HPDF_MMgr mmgr,
HPDF_Xref xref, HPDF_Xref xref,
......
...@@ -149,6 +149,18 @@ HPDF_Array_AddReal (HPDF_Array array, ...@@ -149,6 +149,18 @@ HPDF_Array_AddReal (HPDF_Array array,
return HPDF_Array_Add (array, r); return HPDF_Array_Add (array, r);
} }
HPDF_STATUS
HPDF_Array_AddNull (HPDF_Array array)
{
HPDF_Null n = HPDF_Null_New (array->mmgr);
HPDF_PTRACE((" HPDF_Array_AddNull\n"));
if (!n)
return HPDF_Error_GetCode (array->error);
else
return HPDF_Array_Add (array, n);
}
HPDF_STATUS HPDF_STATUS
HPDF_Array_AddName (HPDF_Array array, HPDF_Array_AddName (HPDF_Array array,
......
...@@ -497,6 +497,7 @@ HPDF_SetEncryptionMode (HPDF_Doc pdf, ...@@ -497,6 +497,7 @@ HPDF_SetEncryptionMode (HPDF_Doc pdf,
/* if encryption mode is specified revision-3, the version of /* if encryption mode is specified revision-3, the version of
* pdf file is set to 1.4 * pdf file is set to 1.4
*/ */
if (pdf->pdf_version < HPDF_VER_14)
pdf->pdf_version = HPDF_VER_14; pdf->pdf_version = HPDF_VER_14;
if (key_len >= 5 && key_len <= 16) if (key_len >= 5 && key_len <= 16)
......
...@@ -77,7 +77,7 @@ typedef struct { ...@@ -77,7 +77,7 @@ typedef struct {
#define Fax3State(tif) (&(tif)->tif_data->b) #define Fax3State(tif) (&(tif)->tif_data->b)
#define EncoderState(tif) ((tif)->tif_data) #define EncoderState(tif) ((tif)->tif_data)
#define isAligned(p,t) ((((unsigned long)(p)) & (sizeof (t)-1)) == 0) #define isAligned(p,t) ((((size_t)(p)) & (sizeof (t)-1)) == 0)
/* NB: the uint32 casts are to silence certain ANSI-C compilers */ /* NB: the uint32 casts are to silence certain ANSI-C compilers */
#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) #define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
......
...@@ -281,8 +281,8 @@ ReadTransparentPngData (HPDF_Dict image, ...@@ -281,8 +281,8 @@ ReadTransparentPngData (HPDF_Dict image,
case PNG_COLOR_TYPE_RGB_ALPHA: case PNG_COLOR_TYPE_RGB_ALPHA:
row_len = 3 * width * sizeof(png_byte); row_len = 3 * width * sizeof(png_byte);
for (j = 0; j < height; j++) { for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
row = row_ptr[j]; row = row_ptr[j];
for (i = 0; i < width; i++) {
memmove(row + (3 * i), row + (4*i), 3); memmove(row + (3 * i), row + (4*i), 3);
smask_data[width * j + i] = row[4 * i + 3]; smask_data[width * j + i] = row[4 * i + 3];
} }
...@@ -296,8 +296,8 @@ ReadTransparentPngData (HPDF_Dict image, ...@@ -296,8 +296,8 @@ ReadTransparentPngData (HPDF_Dict image,
case PNG_COLOR_TYPE_GRAY_ALPHA: case PNG_COLOR_TYPE_GRAY_ALPHA:
row_len = width * sizeof(png_byte); row_len = width * sizeof(png_byte);
for (j = 0; j < height; j++) { for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
row = row_ptr[j]; row = row_ptr[j];
for (i = 0; i < w