|
|
49383d |
diff -up texlive-2012/source/texk/web2c/luatexdir/image/epdf.h.than texlive-2012/source/texk/web2c/luatexdir/image/epdf.h
|
|
|
49383d |
--- texlive-2012/source/texk/web2c/luatexdir/image/epdf.h.than 2015-04-30 22:34:17.765098640 +0200
|
|
|
49383d |
+++ texlive-2012/source/texk/web2c/luatexdir/image/epdf.h 2015-04-30 22:35:01.391427071 +0200
|
|
|
49383d |
@@ -48,6 +48,7 @@ extern "C" {
|
|
|
49383d |
# include "Dict.h"
|
|
|
49383d |
# include "XRef.h"
|
|
|
49383d |
# include "Catalog.h"
|
|
|
49383d |
+# include <StructTreeRoot.h>
|
|
|
49383d |
# include "Link.h"
|
|
|
49383d |
# include "Page.h"
|
|
|
49383d |
# include "GfxFont.h"
|
|
|
49383d |
diff -up texlive-2012/source/texk/web2c/luatexdir/lua/lepdflib.cc.than texlive-2012/source/texk/web2c/luatexdir/lua/lepdflib.cc
|
|
|
49383d |
--- texlive-2012/source/texk/web2c/luatexdir/lua/lepdflib.cc.than 2015-04-30 22:30:17.574796564 +0200
|
|
|
49383d |
+++ texlive-2012/source/texk/web2c/luatexdir/lua/lepdflib.cc 2015-04-30 23:10:21.712979610 +0200
|
|
|
49383d |
@@ -65,6 +65,7 @@ static const char *ErrorCodeNames[] = {
|
|
|
49383d |
#define M_PDFRectangle "PDFRectangle"
|
|
|
49383d |
#define M_Ref "Ref"
|
|
|
49383d |
#define M_Stream "Stream"
|
|
|
49383d |
+#define M_StructTreeRoot "StructTreeRoot"
|
|
|
49383d |
#define M_XRefEntry "XRefEntry"
|
|
|
49383d |
#define M_XRef "XRef"
|
|
|
49383d |
|
|
|
49383d |
@@ -96,6 +97,7 @@ new_poppler_userdata(Page);
|
|
|
49383d |
new_poppler_userdata(PDFRectangle);
|
|
|
49383d |
new_poppler_userdata(Ref);
|
|
|
49383d |
new_poppler_userdata(Stream);
|
|
|
49383d |
+new_poppler_userdata(StructTreeRoot);
|
|
|
49383d |
new_poppler_userdata(XRef);
|
|
|
49383d |
|
|
|
49383d |
//**********************************************************************
|
|
|
49383d |
@@ -573,8 +575,11 @@ static int m_Catalog_getPageRef(lua_Stat
|
|
|
49383d |
|
|
|
49383d |
m_poppler_get_GOOSTRING(Catalog, getBaseURI);
|
|
|
49383d |
m_poppler_get_GOOSTRING(Catalog, readMetadata);
|
|
|
49383d |
+#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
|
|
|
49383d |
m_poppler_get_poppler(Catalog, Object, getStructTreeRoot);
|
|
|
49383d |
-
|
|
|
49383d |
+#else
|
|
|
49383d |
+m_poppler_get_poppler(Catalog, StructTreeRoot, getStructTreeRoot);
|
|
|
49383d |
+#endif
|
|
|
49383d |
static int m_Catalog_findPage(lua_State * L)
|
|
|
49383d |
{
|
|
|
49383d |
int num, gen, i;
|
|
|
49383d |
@@ -2146,14 +2151,22 @@ static int m_PDFDoc_readMetadata(lua_Sta
|
|
|
49383d |
|
|
|
49383d |
static int m_PDFDoc_getStructTreeRoot(lua_State * L)
|
|
|
49383d |
{
|
|
|
49383d |
+#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
|
|
|
49383d |
Object *obj;
|
|
|
49383d |
+#else
|
|
|
49383d |
+ StructTreeRoot *obj;
|
|
|
49383d |
+#endif
|
|
|
49383d |
udstruct *uin, *uout;
|
|
|
49383d |
uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
|
|
|
49383d |
if (uin->pd != NULL && uin->pd->pc != uin->pc)
|
|
|
49383d |
pdfdoc_changed_error(L);
|
|
|
49383d |
if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
|
|
|
49383d |
obj = ((PdfDocument *) uin->d)->doc->getStructTreeRoot();
|
|
|
49383d |
+#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
|
|
|
49383d |
uout = new_Object_userdata(L);
|
|
|
49383d |
+#else
|
|
|
49383d |
+ uout = new_StructTreeRoot_userdata(L);
|
|
|
49383d |
+#endif
|
|
|
49383d |
uout->d = obj;
|
|
|
49383d |
uout->pc = uin->pc;
|
|
|
49383d |
uout->pd = uin->pd;
|