4ea8c1
diff -up texlive-base-20190410/source/texk/web2c/pdftexdir/pdftoepdf.cc.poppler-0.73 texlive-base-20190410/source/texk/web2c/pdftexdir/pdftoepdf.cc
4ea8c1
--- texlive-base-20190410/source/texk/web2c/pdftexdir/pdftoepdf.cc.poppler-0.73	2019-05-23 15:50:17.849768543 -0400
4ea8c1
+++ texlive-base-20190410/source/texk/web2c/pdftexdir/pdftoepdf.cc	2019-05-23 16:00:41.022262790 -0400
4ea8c1
@@ -120,7 +120,7 @@ struct UsedEncoding {
4ea8c1
 
4ea8c1
 static InObj *inObjList;
4ea8c1
 static UsedEncoding *encodingList;
4ea8c1
-static GBool isInit = gFalse;
4ea8c1
+static bool isInit = false;
4ea8c1
 
4ea8c1
 // --------------------------------------------------------------------
4ea8c1
 // Maintain list of open embedded PDF files
4ea8c1
@@ -275,7 +275,7 @@ static int getNewObjectNumber(Ref ref)
4ea8c1
 
4ea8c1
 static void copyObject(Object *);
4ea8c1
 
4ea8c1
-static void copyName(char *s)
4ea8c1
+static void copyName(const char *s)
4ea8c1
 {
4ea8c1
     pdf_puts("/");
4ea8c1
     for (; *s != 0; s++) {
4ea8c1
@@ -310,7 +310,7 @@ static void copyDict(Object * obj)
4ea8c1
 static void copyFontDict(Object * obj, InObj * r)
4ea8c1
 {
4ea8c1
     int i, l;
4ea8c1
-    char *key;
4ea8c1
+    const char *key;
4ea8c1
     if (!obj->isDict())
4ea8c1
         pdftex_fail("PDF inclusion: invalid dict type <%s>",
4ea8c1
                     obj->getTypeName());
4ea8c1
@@ -382,7 +382,7 @@ static bool embeddableFont(Object * font
4ea8c1
     return false;
4ea8c1
 }
4ea8c1
 
4ea8c1
-static void copyFont(char *tag, Object * fontRef)
4ea8c1
+static void copyFont(const char *tag, Object * fontRef)
4ea8c1
 {
4ea8c1
     Object fontdict, subtype, basefont, fontdescRef, fontdesc, charset,
4ea8c1
         stemV;
4ea8c1
@@ -418,7 +418,7 @@ static void copyFont(char *tag, Object *
4ea8c1
         && fontdescRef.isRef()
4ea8c1
         && fontdesc.isDict()
4ea8c1
         && embeddableFont(&fontdesc)
4ea8c1
-        && (fontmap = lookup_fontmap(basefont.getName())) != NULL) {
4ea8c1
+        && (fontmap = lookup_fontmap((char *)basefont.getName())) != NULL) {
4ea8c1
         // round /StemV value, since the PDF input is a float
4ea8c1
         // (see Font Descriptors in PDF reference), but we only store an
4ea8c1
         // integer, since we don't want to change the struct.
4ea8c1
@@ -427,7 +427,7 @@ static void copyFont(char *tag, Object *
4ea8c1
         charset = fontdesc.dictLookup("CharSet");
4ea8c1
         if (!charset.isNull() &&
4ea8c1
             charset.isString() && is_subsetable(fontmap))
4ea8c1
-            epdf_mark_glyphs(fd, charset.getString()->getCString());
4ea8c1
+            epdf_mark_glyphs(fd, (char *)charset.getString()->c_str());
4ea8c1
         else
4ea8c1
             embed_whole_font(fd);
4ea8c1
         addFontDesc(fontdescRef.getRef(), fd);
4ea8c1
@@ -467,7 +467,7 @@ static void copyFontResources(Object * o
4ea8c1
     pdf_puts(">>\n");
4ea8c1
 }
4ea8c1
 
4ea8c1
-static void copyOtherResources(Object * obj, char *key)
4ea8c1
+static void copyOtherResources(Object * obj, const char *key)
4ea8c1
 {
4ea8c1
     // copies all other resources (write_epdf handles Fonts and ProcSets),
4ea8c1
 
4ea8c1
@@ -554,8 +554,8 @@ static void copyObject(Object * obj)
4ea8c1
     Object obj1;
4ea8c1
     int i, l, c;
4ea8c1
     Ref ref;
4ea8c1
-    char *p;
4ea8c1
-    GString *s;
4ea8c1
+    const char *p;
4ea8c1
+    const GString *s;
4ea8c1
     if (obj->isBool()) {
4ea8c1
         pdf_printf("%s", obj->getBool()? "true" : "false");
4ea8c1
     } else if (obj->isInt()) {
4ea8c1
@@ -566,7 +566,7 @@ static void copyObject(Object * obj)
4ea8c1
         pdf_printf("%s", convertNumToPDF(obj->getNum()));
4ea8c1
     } else if (obj->isString()) {
4ea8c1
         s = obj->getString();
4ea8c1
-        p = s->getCString();
4ea8c1
+        p = s->c_str();
4ea8c1
         l = s->getLength();
4ea8c1
         if (strlen(p) == (unsigned int) l) {
4ea8c1
             pdf_puts("(");
4ea8c1
@@ -664,7 +664,7 @@ static void writeEncodings()
4ea8c1
                     ("PDF inclusion: CID fonts are not supported"
4ea8c1
                      " (try to disable font replacement to fix this)");
4ea8c1
             }
4ea8c1
-            if ((s = ((Gfx8BitFont *) r->font)->getCharName(i)) != 0)
4ea8c1
+            if ((s = (char *) ((Gfx8BitFont *) r->font)->getCharName(i)) != 0)
4ea8c1
                 glyphNames[i] = s;
4ea8c1
             else
4ea8c1
                 glyphNames[i] = notdef;
4ea8c1
@@ -683,7 +683,7 @@ static void writeEncodings()
4ea8c1
 }
4ea8c1
 
4ea8c1
 // get the pagebox according to the pagebox_spec
4ea8c1
-static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
4ea8c1
+static const PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
4ea8c1
 {
4ea8c1
     if (pagebox_spec == pdfboxspecmedia)
4ea8c1
         return page->getMediaBox();
4ea8c1
@@ -715,7 +715,7 @@ read_pdf_info(char *image_name, char *pa
4ea8c1
 {
4ea8c1
     PdfDocument *pdf_doc;
4ea8c1
     Page *page;
4ea8c1
-    PDFRectangle *pagebox;
4ea8c1
+    const PDFRectangle *pagebox;
4ea8c1
 #ifdef POPPLER_VERSION
4ea8c1
     int pdf_major_version_found, pdf_minor_version_found;
4ea8c1
 #else
4ea8c1
@@ -724,8 +724,8 @@ read_pdf_info(char *image_name, char *pa
4ea8c1
     // initialize
4ea8c1
     if (!isInit) {
4ea8c1
         globalParams = new GlobalParams();
4ea8c1
-        globalParams->setErrQuiet(gFalse);
4ea8c1
-        isInit = gTrue;
4ea8c1
+        globalParams->setErrQuiet(false);
4ea8c1
+        isInit = true;
4ea8c1
     }
4ea8c1
     // open PDF file
4ea8c1
     pdf_doc = find_add_document(image_name);
4ea8c1
@@ -822,7 +822,7 @@ void write_epdf(void)
4ea8c1
     Object groupDict;
4ea8c1
     bool writeSepGroup = false;
4ea8c1
     Object info;
4ea8c1
-    char *key;
4ea8c1
+    const char *key;
4ea8c1
     char s[256];
4ea8c1
     int i, l;
4ea8c1
     int rotate;
4ea8c1
@@ -849,7 +849,7 @@ void write_epdf(void)
4ea8c1
     pageObj = xref->fetch(pageRef->num, pageRef->gen);
4ea8c1
     pageDict = pageObj.getDict();
4ea8c1
     rotate = page->getRotate();
4ea8c1
-    PDFRectangle *pagebox;
4ea8c1
+    const PDFRectangle *pagebox;
4ea8c1
     // write the Page header
4ea8c1
     pdf_puts("/Type /XObject\n");
4ea8c1
     pdf_puts("/Subtype /Form\n");
4ea8c1
@@ -977,7 +977,7 @@ The changes below seem to work fine.
4ea8c1
             }
4ea8c1
             l = dic1.getLength();
4ea8c1
             for (i = 0; i < l; i++) {
4ea8c1
-                groupDict.dictAdd(copyString(dic1.getKey(i)),
4ea8c1
+                groupDict.dictAdd(dic1.getKey(i),
4ea8c1
                                   dic1.getValNF(i));
4ea8c1
             }
4ea8c1
 // end modification
4ea8c1
diff -up texlive-base-20190410/source/texk/web2c/pdftexdir/pdftosrc.cc.poppler-0.73 texlive-base-20190410/source/texk/web2c/pdftexdir/pdftosrc.cc
4ea8c1
--- texlive-base-20190410/source/texk/web2c/pdftexdir/pdftosrc.cc.poppler-0.73	2019-05-23 15:50:17.850768522 -0400
4ea8c1
+++ texlive-base-20190410/source/texk/web2c/pdftexdir/pdftosrc.cc	2019-05-23 15:50:17.858768349 -0400
4ea8c1
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
4ea8c1
             fprintf(stderr, "No SourceName found\n");
4ea8c1
             exit(1);
4ea8c1
         }
4ea8c1
-        outname = srcName.getString()->getCString();
4ea8c1
+        outname = (char *)srcName.getString()->c_str();
4ea8c1
         // We cannot free srcName, as objname shares its string.
4ea8c1
         // srcName.free();
4ea8c1
     } else if (objnum > 0) {
4ea8c1
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
4ea8c1
             fprintf(stderr, "Not a Stream object\n");
4ea8c1
             exit(1);
4ea8c1
         }
4ea8c1
-        sprintf(buf, "%s", fileName->getCString());
4ea8c1
+        sprintf(buf, "%s", fileName->c_str());
4ea8c1
         if ((p = strrchr(buf, '.')) == 0)
4ea8c1
             p = strchr(buf, 0);
4ea8c1
         if (objgen == 0)
4ea8c1
@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
4ea8c1
         outname = buf;
4ea8c1
     } else {                    // objnum < 0 means we are extracting the XRef table
4ea8c1
         extract_xref_table = true;
4ea8c1
-        sprintf(buf, "%s", fileName->getCString());
4ea8c1
+        sprintf(buf, "%s", fileName->c_str());
4ea8c1
         if ((p = strrchr(buf, '.')) == 0)
4ea8c1
             p = strchr(buf, 0);
4ea8c1
         sprintf(p, ".xref");
4ea8c1
@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
4ea8c1
                 Object objStr, obj1, obj2;
4ea8c1
                 int nObjects, first, n;
4ea8c1
                 int localOffset = 0;
4ea8c1
-                Guint firstOffset;
4ea8c1
+                unsigned int firstOffset;
4ea8c1
 
4ea8c1
                 objStr = xref->fetch(e->offset, 0);
4ea8c1
                 assert(objStr.isStream());
4ea8c1
@@ -173,9 +173,9 @@ int main(int argc, char *argv[])
4ea8c1
 
4ea8c1
                 // parse the header: object numbers and offsets
4ea8c1
                 objStr.streamReset();
4ea8c1
-                str = new EmbedStream(objStr.getStream(), Object(objNull), gTrue, first);
4ea8c1
+                str = new EmbedStream(objStr.getStream(), Object(objNull), true, first);
4ea8c1
                 lexer = new Lexer(xref, str);
4ea8c1
-                parser = new Parser(xref, lexer, gFalse);
4ea8c1
+                parser = new Parser(xref, lexer, false);
4ea8c1
                 for (n = 0; n < nObjects; ++n) {
4ea8c1
                     obj1 = parser->getObj();
4ea8c1
                     obj2 = parser->getObj();
4ea8c1
diff -up texlive-base-20190410/source/texk/web2c/xetexdir/pdfimage.cpp.poppler-0.73 texlive-base-20190410/source/texk/web2c/xetexdir/pdfimage.cpp
4ea8c1
--- texlive-base-20190410/source/texk/web2c/xetexdir/pdfimage.cpp.poppler-0.73	2018-12-25 00:48:22.000000000 -0500
4ea8c1
+++ texlive-base-20190410/source/texk/web2c/xetexdir/pdfimage.cpp	2019-05-23 15:50:17.858768349 -0400
4ea8c1
@@ -78,26 +78,29 @@ pdf_get_rect(char* filename, int page_nu
4ea8c1
 
4ea8c1
 	Page*		page = doc->getCatalog()->getPage(page_num);
4ea8c1
 
4ea8c1
-	const PDFRectangle*	r;
4ea8c1
+	PDFRectangle*	r;
4ea8c1
+	const PDFRectangle*	cr;
4ea8c1
 	switch (pdf_box) {
4ea8c1
 		default:
4ea8c1
 		case pdfbox_crop:
4ea8c1
-			r = page->getCropBox();
4ea8c1
+			cr = page->getCropBox();
4ea8c1
 			break;
4ea8c1
 		case pdfbox_media:
4ea8c1
-			r = page->getMediaBox();
4ea8c1
+			cr = page->getMediaBox();
4ea8c1
 			break;
4ea8c1
 		case pdfbox_bleed:
4ea8c1
-			r = page->getBleedBox();
4ea8c1
+			cr = page->getBleedBox();
4ea8c1
 			break;
4ea8c1
 		case pdfbox_trim:
4ea8c1
-			r = page->getTrimBox();
4ea8c1
+			cr = page->getTrimBox();
4ea8c1
 			break;
4ea8c1
 		case pdfbox_art:
4ea8c1
-			r = page->getArtBox();
4ea8c1
+			cr = page->getArtBox();
4ea8c1
 			break;
4ea8c1
 	}
4ea8c1
 
4ea8c1
+	r = new PDFRectangle (cr->x1, cr->y1, cr->x2, cr->y2);
4ea8c1
+
4ea8c1
 	int RotAngle = 0;
4ea8c1
 	RotAngle = (int)page->getRotate() % 360;
4ea8c1
 	if (RotAngle < 0)
4ea8c1
@@ -112,6 +115,7 @@ pdf_get_rect(char* filename, int page_nu
4ea8c1
 	box->x  = 72.27 / 72 * my_fmin(r->x1, r->x2);
4ea8c1
 	box->y  = 72.27 / 72 * my_fmin(r->y1, r->y2);
4ea8c1
 
4ea8c1
+	delete r;
4ea8c1
 	delete doc;
4ea8c1
 
4ea8c1
 	return 0;