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