ecef5a5
diff -up gambas-3.14.3/gb.pdf/configure.ac.poppler090 gambas-3.14.3/gb.pdf/configure.ac
ecef5a5
--- gambas-3.14.3/gb.pdf/configure.ac.poppler090	2020-01-17 18:33:39.000000000 -0500
ecef5a5
+++ gambas-3.14.3/gb.pdf/configure.ac	2020-07-14 11:17:19.271386755 -0400
ecef5a5
@@ -29,6 +29,8 @@ if test "$have_poppler" = "yes"; then
ecef5a5
   AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_76, $((1-$?)), Poppler version >= 0.76)
ecef5a5
   pkg-config --atleast-version=0.83.0 poppler
ecef5a5
   AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_83, $((1-$?)), Poppler version >= 0.83)
ecef5a5
+  pkg-config --atleast-version=0.90.0 poppler
ecef5a5
+  AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_90, $((1-$?)), Poppler version >= 0.90)
ecef5a5
 fi
ecef5a5
 
ecef5a5
 AC_OUTPUT( \
ecef5a5
diff -up gambas-3.14.3/gb.pdf/src/CPdfDocument.cpp.poppler090 gambas-3.14.3/gb.pdf/src/CPdfDocument.cpp
ecef5a5
--- gambas-3.14.3/gb.pdf/src/CPdfDocument.cpp.poppler090	2020-07-14 11:17:19.263386882 -0400
ecef5a5
+++ gambas-3.14.3/gb.pdf/src/CPdfDocument.cpp	2020-07-14 12:16:19.518914007 -0400
ecef5a5
@@ -104,7 +104,11 @@ END_PROPERTY
ecef5a5
 
ecef5a5
 static void return_unicode_string(const Unicode *unicode, int len)
ecef5a5
 {
ecef5a5
+#if POPPLER_VERSION_0_90
ecef5a5
+	const UnicodeMap *uMap = NULL;
ecef5a5
+#else
ecef5a5
 	static UnicodeMap *uMap = NULL;
ecef5a5
+#endif
ecef5a5
 	
ecef5a5
 	GooString gstr;
ecef5a5
 	char buf[8]; /* 8 is enough for mapping an unicode char to a string */
ecef5a5
@@ -112,10 +116,14 @@ static void return_unicode_string(const
ecef5a5
 
ecef5a5
 	if (uMap == NULL) 
ecef5a5
 	{
ecef5a5
+#if POPPLER_VERSION_0_90
ecef5a5
+		uMap = globalParams->getUnicodeMap("UTF-8");
ecef5a5
+#else
ecef5a5
 		GooString *enc = new GooString("UTF-8");
ecef5a5
 		uMap = globalParams->getUnicodeMap(enc);
ecef5a5
 		uMap->incRefCnt();
ecef5a5
 		delete enc;
ecef5a5
+#endif
ecef5a5
 	}
ecef5a5
 		
ecef5a5
 	for (i = 0; i < len; ++i) {
ecef5a5
@@ -224,15 +232,24 @@ static void aux_return_date_info(void *_
ecef5a5
 	#endif
ecef5a5
 }
ecef5a5
 
ecef5a5
-static const_LinkDest *get_dest(const_LinkAction *act)
ecef5a5
+#if POPPLER_VERSION_0_90
ecef5a5
+static std::unique_ptr<LinkDest> get_dest(const_LinkAction *act)
ecef5a5
+#else
ecef5a5
+static LinkDest *get_dest(const_LinkAction *act)
ecef5a5
+#endif
ecef5a5
 {
ecef5a5
 	if (!act)
ecef5a5
 		return 0;
ecef5a5
 	
ecef5a5
 	switch (act->getKind())
ecef5a5
 	{
ecef5a5
+#if POPPLER_VERSION_0_90
ecef5a5
+		case actionGoTo: return std::unique_ptr<LinkDest>(((LinkGoTo*)act)->getDest()->copy());
ecef5a5
+		case actionGoToR: return std::unique_ptr<LinkDest>(((LinkGoToR*)act)->getDest()->copy());
ecef5a5
+#else
ecef5a5
 		case actionGoTo: return ((LinkGoTo*)act)->getDest();
ecef5a5
 		case actionGoToR: return ((LinkGoToR*)act)->getDest();
ecef5a5
+#endif
ecef5a5
 		default: return 0;
ecef5a5
 	}
ecef5a5
 }
ecef5a5
@@ -240,7 +257,11 @@ static const_LinkDest *get_dest(const_Li
ecef5a5
 static uint32_t aux_get_page_from_action(void *_object, const_LinkAction *act)
ecef5a5
 {
ecef5a5
 	Ref pref;       
ecef5a5
+#if POPPLER_VERSION_0_90
ecef5a5
+	static std::unique_ptr<LinkDest> dest = get_dest(act);
ecef5a5
+#else
ecef5a5
 	const_LinkDest *dest = get_dest(act);
ecef5a5
+#endif
ecef5a5
 	const_GooString *name;
ecef5a5
 
ecef5a5
 	if (!dest)
ecef5a5
@@ -280,7 +301,11 @@ static uint32_t aux_get_page_from_action
ecef5a5
 
ecef5a5
 static void aux_get_dimensions_from_action(const_LinkAction *act, CPDFRECT *rect)
ecef5a5
 {
ecef5a5
+#if POPPLER_VERSION_0_90
ecef5a5
+	std::unique_ptr<LinkDest> dest = get_dest(act);
ecef5a5
+#else
ecef5a5
 	const_LinkDest *dest = get_dest(act);
ecef5a5
+#endif
ecef5a5
 	if (!dest)
ecef5a5
 		return;
ecef5a5
 	
ecef5a5
@@ -292,7 +317,11 @@ static void aux_get_dimensions_from_acti
ecef5a5
 
ecef5a5
 static double aux_get_zoom_from_action(const_LinkAction *act)
ecef5a5
 {
ecef5a5
+#if POPPLER_VERSION_0_90
ecef5a5
+	std::unique_ptr<LinkDest> dest = get_dest(act);
ecef5a5
+#else
ecef5a5
 	const_LinkDest *dest = get_dest(act);
ecef5a5
+#endif
ecef5a5
 	if (dest)
ecef5a5
 		return dest->getZoom();
ecef5a5
 	else
ecef5a5
@@ -303,18 +332,27 @@ static char* aux_get_target_from_action(
ecef5a5
 {
ecef5a5
 	char *vl=NULL;
ecef5a5
 	char *uni=NULL;	
ecef5a5
+#if POPPLER_VERSION_0_90
ecef5a5
+	std::string tmp;
ecef5a5
+#else
ecef5a5
 	const_GooString *tmp=NULL;
ecef5a5
+#endif
ecef5a5
+	const_GooString *tmpfn=NULL;
ecef5a5
 
ecef5a5
 	switch (act->getKind())
ecef5a5
 	{
ecef5a5
 		case actionGoToR:
ecef5a5
-			tmp=((LinkGoToR*)act)->getFileName(); break;
ecef5a5
+			tmpfn=((LinkGoToR*)act)->getFileName(); break;
ecef5a5
 
ecef5a5
 		case actionLaunch:
ecef5a5
-			tmp=((LinkLaunch*)act)->getFileName(); break;
ecef5a5
+			tmpfn=((LinkLaunch*)act)->getFileName(); break;
ecef5a5
 
ecef5a5
 		case actionURI:
ecef5a5
+#if POPPLER_VERSION_0_90
ecef5a5
+			tmp=((LinkURI*)act)->getURI().c_str(); break;
ecef5a5
+#else
ecef5a5
 			tmp=((LinkURI*)act)->getURI(); break;
ecef5a5
+#endif
ecef5a5
 			
ecef5a5
 		case actionNamed:
ecef5a5
 			tmp=((LinkNamed*)act)->getName(); break;
ecef5a5
@@ -326,17 +364,24 @@ static char* aux_get_target_from_action(
ecef5a5
 			break;
ecef5a5
 	}
ecef5a5
 
ecef5a5
-	if (!tmp) return NULL;
ecef5a5
+	if (tmp.empty() && !tmpfn) return NULL;
ecef5a5
 
ecef5a5
-	if (tmp->hasUnicodeMarker())
ecef5a5
+	if (tmpfn)
ecef5a5
 	{
ecef5a5
-			GB.ConvString (&uni,tmp->c_str()+2,tmp->getLength()-2,"UTF-16BE","UTF-8");
ecef5a5
-			vl = GB.AddString(vl, uni, 0);	
ecef5a5
-	}	
ecef5a5
+		if (tmpfn->hasUnicodeMarker())
ecef5a5
+		{
ecef5a5
+				GB.ConvString (&uni,tmpfn->c_str()+2,tmpfn->getLength()-2,"UTF-16BE","UTF-8");
ecef5a5
+				vl = GB.AddString(vl, uni, 0);	
ecef5a5
+		}	
ecef5a5
+		else
ecef5a5
+				vl = GB.AddString(vl,tmpfn->c_str(),tmpfn->getLength());
ecef5a5
+	}
ecef5a5
 	else
ecef5a5
-			vl = GB.AddString(vl,tmp->c_str(),tmp->getLength());
ecef5a5
-	
ecef5a5
-
ecef5a5
+#if POPPLER_VERSION_0_90
ecef5a5
+		vl = GB.AddString(vl,tmp.c_str(),tmp.size());
ecef5a5
+#else
ecef5a5
+		vl = GB.AddString(vl,tmp->c_str(),tmp->getLength());
ecef5a5
+#endif
ecef5a5
 	return vl;
ecef5a5
 
ecef5a5
 }
ecef5a5
diff -up gambas-3.14.3/gb.pdf/src/CPdfDocument.h.poppler090 gambas-3.14.3/gb.pdf/src/CPdfDocument.h