|
@ -1,5 +1,5 @@ |
|
|
--- ./texk/web2c/pdftexdir/pdftoepdf.cc 2016-11-25 18:09:21.000000000 +0000
|
|
|
--- ./texk/web2c/pdftexdir/pdftoepdf.cc 2016-11-25 18:24:37.000000000 +0000
|
|
|
+++ ../pdftoepdf.cc 2018-01-23 08:50:08.583460101 +0000
|
|
|
+++ ../pdftoepdf-newpoppler.cc 2018-04-30 18:45:14.463926082 +0000
|
|
|
@@ -1,5 +1,5 @@
|
|
|
@@ -1,5 +1,5 @@
|
|
|
/* |
|
|
/* |
|
|
-Copyright 1996-2016 Han The Thanh, <thanh@pdftex.org>
|
|
|
-Copyright 1996-2016 Han The Thanh, <thanh@pdftex.org>
|
|
@ -91,8 +91,9 @@ |
|
|
static void copyDictEntry(Object * obj, int i) |
|
|
static void copyDictEntry(Object * obj, int i) |
|
|
{ |
|
|
{ |
|
|
- PdfObject obj1;
|
|
|
- PdfObject obj1;
|
|
|
|
|
|
- copyName(obj->dictGetKey(i));
|
|
|
+ Object obj1;
|
|
|
+ Object obj1;
|
|
|
copyName(obj->dictGetKey(i)); |
|
|
+ copyName((char *)obj->dictGetKey(i));
|
|
|
pdf_puts(" "); |
|
|
pdf_puts(" "); |
|
|
- obj->dictGetValNF(i, &obj1);
|
|
|
- obj->dictGetValNF(i, &obj1);
|
|
|
+ obj1 = obj->dictGetValNF(i);
|
|
|
+ obj1 = obj->dictGetValNF(i);
|
|
@ -118,7 +119,7 @@ |
|
|
- procset->getTypeName());
|
|
|
- procset->getTypeName());
|
|
|
- copyName(procset->getName());
|
|
|
- copyName(procset->getName());
|
|
|
+ procset.getTypeName());
|
|
|
+ procset.getTypeName());
|
|
|
+ copyName(procset.getName());
|
|
|
+ copyName((char *)procset.getName());
|
|
|
pdf_puts(" "); |
|
|
pdf_puts(" "); |
|
|
} |
|
|
} |
|
|
pdf_puts("]\n"); |
|
|
pdf_puts("]\n"); |
|
@ -188,7 +189,7 @@ |
|
|
+ && fontdescRef.isRef()
|
|
|
+ && fontdescRef.isRef()
|
|
|
+ && fontdesc.isDict()
|
|
|
+ && fontdesc.isDict()
|
|
|
+ && embeddableFont(&fontdesc)
|
|
|
+ && embeddableFont(&fontdesc)
|
|
|
+ && (fontmap = lookup_fontmap(basefont.getName())) != NULL) {
|
|
|
+ && (fontmap = lookup_fontmap((char *)basefont.getName())) != NULL) {
|
|
|
// round /StemV value, since the PDF input is a float |
|
|
// round /StemV value, since the PDF input is a float |
|
|
// (see Font Descriptors in PDF reference), but we only store an |
|
|
// (see Font Descriptors in PDF reference), but we only store an |
|
|
// integer, since we don't want to change the struct. |
|
|
// integer, since we don't want to change the struct. |
|
@ -202,7 +203,7 @@ |
|
|
+ charset = fontdesc.dictLookup("CharSet");
|
|
|
+ charset = fontdesc.dictLookup("CharSet");
|
|
|
+ if (!charset.isNull() &&
|
|
|
+ if (!charset.isNull() &&
|
|
|
+ charset.isString() && is_subsetable(fontmap))
|
|
|
+ charset.isString() && is_subsetable(fontmap))
|
|
|
+ epdf_mark_glyphs(fd, charset.getString()->getCString());
|
|
|
+ epdf_mark_glyphs(fd, (char *)charset.getString()->getCString());
|
|
|
else |
|
|
else |
|
|
embed_whole_font(fd); |
|
|
embed_whole_font(fd); |
|
|
- addFontDesc(fontdescRef->getRef(), fd);
|
|
|
- addFontDesc(fontdescRef->getRef(), fd);
|
|
@ -232,8 +233,9 @@ |
|
|
+ if (fontRef.isRef())
|
|
|
+ if (fontRef.isRef())
|
|
|
copyFont(obj->dictGetKey(i), &fontRef); |
|
|
copyFont(obj->dictGetKey(i), &fontRef); |
|
|
- else if (fontRef->isDict()) { // some programs generate pdf with embedded font object
|
|
|
- else if (fontRef->isDict()) { // some programs generate pdf with embedded font object
|
|
|
|
|
|
- copyName(obj->dictGetKey(i));
|
|
|
+ else if (fontRef.isDict()) { // some programs generate pdf with embedded font object
|
|
|
+ else if (fontRef.isDict()) { // some programs generate pdf with embedded font object
|
|
|
copyName(obj->dictGetKey(i)); |
|
|
+ copyName((char *)obj->dictGetKey(i));
|
|
|
pdf_puts(" "); |
|
|
pdf_puts(" "); |
|
|
copyObject(&fontRef); |
|
|
copyObject(&fontRef); |
|
|
} |
|
|
} |
|
@ -253,7 +255,23 @@ |
|
|
int i, l, c; |
|
|
int i, l, c; |
|
|
Ref ref; |
|
|
Ref ref; |
|
|
char *p; |
|
|
char *p; |
|
|
@@ -601,8 +595,8 @@
|
|
|
@@ -571,7 +565,7 @@
|
|
|
|
|
|
} else if (obj->isNum()) { |
|
|
|
|
|
pdf_printf("%s", convertNumToPDF(obj->getNum())); |
|
|
|
|
|
} else if (obj->isString()) { |
|
|
|
|
|
- s = obj->getString();
|
|
|
|
|
|
+ s = (GooString *)obj->getString();
|
|
|
|
|
|
p = s->getCString(); |
|
|
|
|
|
l = s->getLength(); |
|
|
|
|
|
if (strlen(p) == (unsigned int) l) { |
|
|
|
|
|
@@ -595,14 +589,14 @@
|
|
|
|
|
|
pdf_puts(">"); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (obj->isName()) { |
|
|
|
|
|
- copyName(obj->getName());
|
|
|
|
|
|
+ copyName((char *)obj->getName());
|
|
|
|
|
|
} else if (obj->isNull()) { |
|
|
|
|
|
pdf_puts("null"); |
|
|
} else if (obj->isArray()) { |
|
|
} else if (obj->isArray()) { |
|
|
pdf_puts("["); |
|
|
pdf_puts("["); |
|
|
for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { |
|
|
for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { |
|
@ -418,8 +436,8 @@ |
|
|
+*/
|
|
|
+*/
|
|
|
+// begin modification
|
|
|
+// begin modification
|
|
|
+ groupDict = pageDict->lookup("Group");
|
|
|
+ groupDict = pageDict->lookup("Group");
|
|
|
+ Dict dic1 = page->getGroup();
|
|
|
+ const Dict& dic1 = page->getGroup();
|
|
|
+ Dict dic2 = groupDict.getDict();
|
|
|
+ const Dict& dic2 = groupDict.getDict();
|
|
|
+ // replace dic2 in groupDict with dic1
|
|
|
+ // replace dic2 in groupDict with dic1
|
|
|
+ l = dic2.getLength();
|
|
|
+ l = dic2.getLength();
|
|
|
+ for (i = 0; i < l; i++) {
|
|
|
+ for (i = 0; i < l; i++) {
|
|
@ -512,15 +530,8 @@ |
|
|
if (i < l - 1) |
|
|
if (i < l - 1) |
|
|
pdf_newline(); // add a newline after each stream except the last |
|
|
pdf_newline(); // add a newline after each stream except the last |
|
|
} |
|
|
} |
|
|
--- ./texk/web2c/pdftexdir/pdftosrc.cc 2016-11-25 18:09:21.000000000 +0000
|
|
|
--- ./texk/web2c/pdftexdir/pdftosrc.cc 2017-10-17 04:24:27.000000000 +0000
|
|
|
+++ ../pdftosrc.cc 2018-01-23 08:50:03.531537552 +0000
|
|
|
+++ ../pdftosrc-newpoppler.cc 2018-04-30 18:45:24.223917354 +0000
|
|
|
@@ -1,5 +1,5 @@
|
|
|
|
|
|
/* |
|
|
|
|
|
-Copyright 1996-2014 Han The Thanh, <thanh@pdftex.org>
|
|
|
|
|
|
+Copyright 1996-2017 Han The Thanh, <thanh@pdftex.org>
|
|
|
|
|
|
|
|
|
|
|
|
This file is part of pdfTeX. |
|
|
|
|
|
|
|
|
|
|
|
@@ -16,6 +16,14 @@
|
|
|
@@ -16,6 +16,14 @@
|
|
|
You should have received a copy of the GNU General Public License along |
|
|
You should have received a copy of the GNU General Public License along |
|
|
with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
with this program. If not, see <http://www.gnu.org/licenses/>. |
|
@ -548,7 +559,7 @@ |
|
|
#endif |
|
|
#endif |
|
|
#include <assert.h> |
|
|
#include <assert.h> |
|
|
|
|
|
|
|
|
@@ -86,22 +91,20 @@
|
|
|
@@ -86,31 +91,29 @@
|
|
|
objgen = atoi(argv[3]); |
|
|
objgen = atoi(argv[3]); |
|
|
} |
|
|
} |
|
|
xref = doc->getXRef(); |
|
|
xref = doc->getXRef(); |
|
@ -575,7 +586,9 @@ |
|
|
if (!srcName.isString()) { |
|
|
if (!srcName.isString()) { |
|
|
fprintf(stderr, "No SourceName found\n"); |
|
|
fprintf(stderr, "No SourceName found\n"); |
|
|
exit(1); |
|
|
exit(1); |
|
|
@@ -110,7 +113,7 @@
|
|
|
} |
|
|
|
|
|
- outname = srcName.getString()->getCString();
|
|
|
|
|
|
+ outname = (char *)srcName.getString()->getCString();
|
|
|
// We cannot free srcName, as objname shares its string. |
|
|
// We cannot free srcName, as objname shares its string. |
|
|
// srcName.free(); |
|
|
// srcName.free(); |
|
|
} else if (objnum > 0) { |
|
|
} else if (objnum > 0) { |
|
@ -584,14 +597,7 @@ |
|
|
if (!srcStream.isStream()) { |
|
|
if (!srcStream.isStream()) { |
|
|
fprintf(stderr, "Not a Stream object\n"); |
|
|
fprintf(stderr, "Not a Stream object\n"); |
|
|
exit(1); |
|
|
exit(1); |
|
|
@@ -153,35 +156,34 @@
|
|
|
@@ -160,34 +163,27 @@
|
|
|
(e->type == xrefEntryFree ? "f" : "n")); |
|
|
|
|
|
else { // e->offset is the object number of the object stream |
|
|
|
|
|
Stream *str; |
|
|
|
|
|
+ Lexer *lexer;
|
|
|
|
|
|
Parser *parser; |
|
|
|
|
|
Object objStr, obj1, obj2; |
|
|
|
|
|
int nObjects, first, n; |
|
|
|
|
|
int localOffset = 0; |
|
|
int localOffset = 0; |
|
|
Guint firstOffset; |
|
|
Guint firstOffset; |
|
|
|
|
|
|
|
@ -612,10 +618,9 @@ |
|
|
objStr.streamReset(); |
|
|
objStr.streamReset(); |
|
|
- obj1.initNull();
|
|
|
- obj1.initNull();
|
|
|
- str = new EmbedStream(objStr.getStream(), &obj1, gTrue, first);
|
|
|
- str = new EmbedStream(objStr.getStream(), &obj1, gTrue, first);
|
|
|
- parser = new Parser(xref, new Lexer(xref, str), gFalse);
|
|
|
|
|
|
+ str = new EmbedStream(objStr.getStream(), Object(objNull), gTrue, first);
|
|
|
+ str = new EmbedStream(objStr.getStream(), Object(objNull), gTrue, first);
|
|
|
+ lexer = new Lexer(xref, str);
|
|
|
lexer = new Lexer(xref, str); |
|
|
+ parser = new Parser(xref, lexer, gFalse);
|
|
|
parser = new Parser(xref, lexer, gFalse); |
|
|
for (n = 0; n < nObjects; ++n) { |
|
|
for (n = 0; n < nObjects; ++n) { |
|
|
- parser->getObj(&obj1);
|
|
|
- parser->getObj(&obj1);
|
|
|
- parser->getObj(&obj2);
|
|
|
- parser->getObj(&obj2);
|
|
@ -626,13 +631,17 @@ |
|
|
- obj1.free();
|
|
|
- obj1.free();
|
|
|
- obj2.free();
|
|
|
- obj2.free();
|
|
|
} |
|
|
} |
|
|
|
|
|
-#if defined(POPPLER_VERSION) || defined(XPDF304)
|
|
|
while (str->getChar() != EOF) ; |
|
|
while (str->getChar() != EOF) ; |
|
|
|
|
|
-#else /* xpdf 4.00 */
|
|
|
|
|
|
- lexer->skipToEOF();
|
|
|
|
|
|
-#endif
|
|
|
delete parser; |
|
|
delete parser; |
|
|
- objStr.free();
|
|
|
- objStr.free();
|
|
|
|
|
|
|
|
|
fprintf(outfile, "%.10lu 00000 n\n", |
|
|
fprintf(outfile, "%.10lu 00000 n\n", |
|
|
(long unsigned)(firstOffset + localOffset)); |
|
|
(long unsigned)(firstOffset + localOffset)); |
|
|
@@ -192,7 +194,6 @@
|
|
|
@@ -198,7 +194,6 @@
|
|
|
s->reset(); |
|
|
s->reset(); |
|
|
while ((c = s->getChar()) != EOF) |
|
|
while ((c = s->getChar()) != EOF) |
|
|
fputc(c, outfile); |
|
|
fputc(c, outfile); |
|
@ -640,7 +649,7 @@ |
|
|
} |
|
|
} |
|
|
if (objnum == 0) |
|
|
if (objnum == 0) |
|
|
fprintf(stderr, "Source file extracted to %s\n", outname); |
|
|
fprintf(stderr, "Source file extracted to %s\n", outname); |
|
|
@@ -201,7 +202,6 @@
|
|
|
@@ -207,7 +202,6 @@
|
|
|
else |
|
|
else |
|
|
fprintf(stderr, "Cross-reference table extracted to %s\n", outname); |
|
|
fprintf(stderr, "Cross-reference table extracted to %s\n", outname); |
|
|
fclose(outfile); |
|
|
fclose(outfile); |