Browse Source

texlive-bin: update pdftoepdf-poppler*.cc and pdftosrc-poppler*.cc

build-on-device
Leonid Plyushch 5 years ago
parent
commit
3e3627d4ea
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 4
      packages/texlive-bin/build.sh
  2. 16
      packages/texlive-bin/pdftoepdf-poppler0.83.0.cc
  3. 9
      packages/texlive-bin/pdftosrc-poppler0.83.0.cc

4
packages/texlive-bin/build.sh

@ -129,6 +129,6 @@ termux_step_pre_configure() {
{} + {} +
# These files are from upstream master: # These files are from upstream master:
cp "$TERMUX_PKG_BUILDER_DIR"/pdftoepdf-poppler0.76.0.cc "$TERMUX_PKG_SRCDIR"/texk/web2c/pdftexdir/pdftoepdf.cc # commit 473d82b cp "$TERMUX_PKG_BUILDER_DIR"/pdftoepdf-poppler0.83.0.cc "$TERMUX_PKG_SRCDIR"/texk/web2c/pdftexdir/pdftoepdf.cc # commit 473d82b
cp "$TERMUX_PKG_BUILDER_DIR"/pdftosrc-poppler0.76.0.cc "$TERMUX_PKG_SRCDIR"/texk/web2c/pdftexdir/pdftosrc.cc # commit 473d82b cp "$TERMUX_PKG_BUILDER_DIR"/pdftosrc-poppler0.83.0.cc "$TERMUX_PKG_SRCDIR"/texk/web2c/pdftexdir/pdftosrc.cc # commit 473d82b
} }

16
packages/texlive-bin/pdftoepdf-poppler0.76.0.cc → packages/texlive-bin/pdftoepdf-poppler0.83.0.cc

@ -22,7 +22,7 @@ This is based on the patch texlive-poppler-0.59.patch <2017-09-19> at
https://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk https://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk
by Arch Linux. A little modifications are made to avoid a crash for by Arch Linux. A little modifications are made to avoid a crash for
some kind of pdf images, such as figure_missing.pdf in gnuplot. some kind of pdf images, such as figure_missing.pdf in gnuplot.
The poppler should be 0.76.0 or newer versions. The poppler should be 0.83.0 or newer versions.
POPPLER_VERSION should be defined. POPPLER_VERSION should be defined.
*/ */
@ -710,7 +710,7 @@ static const PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
int int
read_pdf_info(char *image_name, char *page_name, int page_num, read_pdf_info(char *image_name, char *page_name, int page_num,
int pagebox_spec, int minor_pdf_version_wanted, int pagebox_spec, int major_pdf_version_wanted, int minor_pdf_version_wanted,
int pdf_inclusion_errorlevel) int pdf_inclusion_errorlevel)
{ {
PdfDocument *pdf_doc; PdfDocument *pdf_doc;
@ -723,7 +723,7 @@ read_pdf_info(char *image_name, char *page_name, int page_num,
#endif #endif
// initialize // initialize
if (!isInit) { if (!isInit) {
globalParams = new GlobalParams(); globalParams = std::make_unique<GlobalParams>();
globalParams->setErrQuiet(false); globalParams->setErrQuiet(false);
isInit = true; isInit = true;
} }
@ -738,16 +738,16 @@ read_pdf_info(char *image_name, char *page_name, int page_num,
#ifdef POPPLER_VERSION #ifdef POPPLER_VERSION
pdf_major_version_found = pdf_doc->doc->getPDFMajorVersion(); pdf_major_version_found = pdf_doc->doc->getPDFMajorVersion();
pdf_minor_version_found = pdf_doc->doc->getPDFMinorVersion(); pdf_minor_version_found = pdf_doc->doc->getPDFMinorVersion();
if ((pdf_major_version_found > 1) if ((pdf_major_version_found > major_pdf_version_wanted)
|| (pdf_minor_version_found > minor_pdf_version_wanted)) { || (pdf_minor_version_found > minor_pdf_version_wanted)) {
const char *msg = const char *msg =
"PDF inclusion: found PDF version <%d.%d>, but at most version <1.%d> allowed"; "PDF inclusion: found PDF version <%d.%d>, but at most version <%d.%d> allowed";
if (pdf_inclusion_errorlevel > 0) { if (pdf_inclusion_errorlevel > 0) {
pdftex_fail(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted); pdftex_fail(msg, pdf_major_version_found, pdf_minor_version_found, major_pdf_version_wanted, minor_pdf_version_wanted);
} else if (pdf_inclusion_errorlevel < 0) { } else if (pdf_inclusion_errorlevel < 0) {
; /* do nothing */ ; /* do nothing */
} else { /* = 0, give warning */ } else { /* = 0, give warning */
pdftex_warn(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted); pdftex_warn(msg, pdf_major_version_found, pdf_minor_version_found, major_pdf_version_wanted, minor_pdf_version_wanted);
} }
} }
#else #else
@ -1107,7 +1107,5 @@ void epdf_check_mem()
n = p->next; n = p->next;
delete_document(p); delete_document(p);
} }
// see above for globalParams
delete globalParams;
} }
} }

9
packages/texlive-bin/pdftosrc-poppler0.76.0.cc → packages/texlive-bin/pdftosrc-poppler0.83.0.cc

@ -20,7 +20,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
/* /*
This is based on the patch texlive-poppler-0.59.patch <2017-09-19> at This is based on the patch texlive-poppler-0.59.patch <2017-09-19> at
https://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk https://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk
by Arch Linux. The poppler should be 0.76.0 or newer versions. by Arch Linux. The poppler should be 0.83.0 or newer versions.
POPPLER_VERSION should be defined. POPPLER_VERSION should be defined.
*/ */
@ -79,7 +79,7 @@ int main(int argc, char *argv[])
exit(1); exit(1);
} }
fileName = new GString(argv[1]); fileName = new GString(argv[1]);
globalParams = new GlobalParams(); globalParams = std::make_unique<GlobalParams>();
doc = new PDFDoc(fileName); doc = new PDFDoc(fileName);
if (!doc->isOk()) { if (!doc->isOk()) {
fprintf(stderr, "Invalid PDF file\n"); fprintf(stderr, "Invalid PDF file\n");
@ -99,8 +99,8 @@ int main(int argc, char *argv[])
srcStream = Object(objNull); srcStream = Object(objNull);
if (objnum == 0) { if (objnum == 0) {
srcStream = catalogDict.dictLookup("SourceObject"); srcStream = catalogDict.dictLookup("SourceObject");
static char const_SourceFile[] = "SourceFile"; static const char *const_SourceFile = "SourceFile";
if (!srcStream.isStream(const_SourceFile)) { if (!srcStream.isDict(const_SourceFile)) {
fprintf(stderr, "No SourceObject found\n"); fprintf(stderr, "No SourceObject found\n");
exit(1); exit(1);
} }
@ -202,5 +202,4 @@ int main(int argc, char *argv[])
fprintf(stderr, "Cross-reference table extracted to %s\n", outname); fprintf(stderr, "Cross-reference table extracted to %s\n", outname);
fclose(outfile); fclose(outfile);
delete doc; delete doc;
delete globalParams;
} }
Loading…
Cancel
Save