forked from libharu/libharu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhpdf_exdata.c
69 lines (51 loc) · 1.55 KB
/
hpdf_exdata.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* << Haru Free PDF Library >> -- hpdf_annotation.c
*
* URL: http://libharu.org
*
* Copyright (c) 1999-2006 Takeshi Kanno <[email protected]>
* Copyright (c) 2007-2009 Antony Dovgal <[email protected]>
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation.
* It is provided "as is" without express or implied warranty.
*
*/
#include "hpdf_conf.h"
#include "hpdf_utils.h"
#include "hpdf_info.h"
#include "hpdf_exdata.h"
#include "hpdf.h"
/*----------------------------------------------------------------------------*/
/*------ HPDF_ExData -----------------------------------------------------*/
HPDF_ExData
HPDF_3DAnnotExData_New(HPDF_MMgr mmgr,
HPDF_Xref xref)
{
HPDF_ExData exdata;
HPDF_STATUS ret = HPDF_OK;
HPDF_PTRACE((" HPDF_ExData_New\n"));
exdata = HPDF_Dict_New (mmgr);
if (!exdata)
return NULL;
if (HPDF_Xref_Add (xref, exdata) != HPDF_OK)
return NULL;
ret += HPDF_Dict_AddName (exdata, "Type", "ExData");
ret += HPDF_Dict_AddName (exdata, "Subtype", "3DM");
if (ret != HPDF_OK)
return NULL;
return exdata;
}
HPDF_EXPORT(HPDF_STATUS)
HPDF_3DAnnotExData_Set3DMeasurement(HPDF_ExData exdata,
HPDF_3DMeasure measure)
{
HPDF_STATUS ret = HPDF_OK;
ret = HPDF_Dict_Add (exdata, "M3DREF", measure);
if (ret != HPDF_OK)
return ret;
return ret;
}