diff options
author | Hartmut Henkel <hartmut_henkel@gmx.de> | 2010-04-06 21:04:12 +0000 |
---|---|---|
committer | Hartmut Henkel <hartmut_henkel@gmx.de> | 2010-04-06 21:04:12 +0000 |
commit | 20433427e63ae84544e3a314f2345cb5b7d51b1c (patch) | |
tree | 08a64b972d363aa6dfc4aebf0975280be9edafa8 /Build/source | |
parent | 8df732286e6f6d11222d83f90b15ec42f7059d7c (diff) |
add local xpdf patch needed by luatex in pdftoepdf.cc
(reported to Derek)
git-svn-id: svn://tug.org/texlive/trunk@17734 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
5 files changed, 133 insertions, 5 deletions
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog index 6d64ef89fd0..f21b732be73 100644 --- a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog +++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog @@ -1,3 +1,7 @@ +2010-04-06 Hartmut Henkel <hartmut_henkel@gmx.de> + + * patch-45-getmetadatanf needed by pdftoepdf.cc + 2009-09-15 Peter Breitenlohner <peb@mppmu.mpg.de> * patch-04-pl4 (new): Official 3.02pl4 patch plus change of diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-45-getmetadatanf b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-45-getmetadatanf new file mode 100644 index 00000000000..b40b0915795 --- /dev/null +++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-45-getmetadatanf @@ -0,0 +1,103 @@ +--- xpdf-orig/xpdf/Page.cc 2007-02-27 23:05:52.000000000 +0100 ++++ xpdf-3.02/xpdf/Page.cc 2010-04-06 21:22:17.000000000 +0200 +@@ -5,6 +5,9 @@ + // Copyright 1996-2007 Glyph & Cog, LLC + // + //======================================================================== ++// ++// Copyright 2009 Hartmut Henkel <hartmut_henkel@gmx.de> ++// for added metadataNF and resourcesNF needed by luatex + + #include <aconf.h> + +@@ -126,6 +129,10 @@ + dict->lookup("BoxColorInfo", &boxColorInfo); + dict->lookup("Group", &group); + dict->lookup("Metadata", &metadata); ++ ++ // much better would be to get direct access to the page dictionary, but how? ++ dict->lookupNF("Metadata", &metadataNF); ++ + dict->lookup("PieceInfo", &pieceInfo); + dict->lookup("SeparationInfo", &separationInfo); + +@@ -136,6 +143,7 @@ + obj1.copy(&resources); + } + obj1.free(); ++ dict->lookupNF("Resources", &resourcesNF); + } + + PageAttrs::~PageAttrs() { +@@ -143,9 +151,11 @@ + boxColorInfo.free(); + group.free(); + metadata.free(); ++ metadataNF.free(); + pieceInfo.free(); + separationInfo.free(); + resources.free(); ++ resourcesNF.free(); + } + + GBool PageAttrs::readBox(Dict *dict, char *key, PDFRectangle *box) { +--- xpdf-orig/xpdf/Page.h 2007-02-27 23:05:52.000000000 +0100 ++++ xpdf-3.02/xpdf/Page.h 2010-04-06 21:21:51.000000000 +0200 +@@ -5,6 +5,10 @@ + // Copyright 1996-2003 Glyph & Cog, LLC + // + //======================================================================== ++// ++// Copyright 2009 Hartmut Henkel <hartmut_henkel@gmx.de> ++// for added metadataNF, resourcesNF, getMetadataNF, and getResourcesNF ++// needed by luatex + + #ifndef PAGE_H + #define PAGE_H +@@ -68,6 +72,10 @@ + { return group.isDict() ? group.getDict() : (Dict *)NULL; } + Stream *getMetadata() + { return metadata.isStream() ? metadata.getStream() : (Stream *)NULL; } ++ ++ // much better would be to get direct access to the page dictionary, but how? ++ Object * getMetadataNF() { return &metadataNF; } ++ + Dict *getPieceInfo() + { return pieceInfo.isDict() ? pieceInfo.getDict() : (Dict *)NULL; } + Dict *getSeparationInfo() +@@ -76,6 +84,9 @@ + Dict *getResourceDict() + { return resources.isDict() ? resources.getDict() : (Dict *)NULL; } + ++ // much better would be to get direct access to the page dictionary, but how? ++ Object *getResourcesNF() { return &resourcesNF; } ++ + private: + + GBool readBox(Dict *dict, char *key, PDFRectangle *box); +@@ -91,9 +102,11 @@ + Object boxColorInfo; + Object group; + Object metadata; ++ Object metadataNF; + Object pieceInfo; + Object separationInfo; + Object resources; ++ Object resourcesNF; + }; + + //------------------------------------------------------------------------ +@@ -133,11 +146,13 @@ + Dict *getBoxColorInfo() { return attrs->getBoxColorInfo(); } + Dict *getGroup() { return attrs->getGroup(); } + Stream *getMetadata() { return attrs->getMetadata(); } ++ Object *getMetadataNF() { return attrs->getMetadataNF(); } + Dict *getPieceInfo() { return attrs->getPieceInfo(); } + Dict *getSeparationInfo() { return attrs->getSeparationInfo(); } + + // Get resource dictionary. + Dict *getResourceDict() { return attrs->getResourceDict(); } ++ Object *getResourcesNF() { return attrs->getResourcesNF(); } + + // Get annotations array. + Object *getAnnots(Object *obj) { return annots.fetch(xref, obj); } diff --git a/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.cc b/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.cc index 6b52ba936ff..ebf13b9e8bb 100644 --- a/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.cc +++ b/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.cc @@ -5,6 +5,9 @@ // Copyright 1996-2007 Glyph & Cog, LLC // //======================================================================== +// +// Copyright 2009 Hartmut Henkel <hartmut_henkel@gmx.de> +// for added metadataNF and resourcesNF needed by luatex #include <aconf.h> @@ -126,6 +129,10 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) { dict->lookup("BoxColorInfo", &boxColorInfo); dict->lookup("Group", &group); dict->lookup("Metadata", &metadata); + + // much better would be to get direct access to the page dictionary, but how? + dict->lookupNF("Metadata", &metadataNF); + dict->lookup("PieceInfo", &pieceInfo); dict->lookup("SeparationInfo", &separationInfo); @@ -136,6 +143,7 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) { obj1.copy(&resources); } obj1.free(); + dict->lookupNF("Resources", &resourcesNF); } PageAttrs::~PageAttrs() { @@ -143,9 +151,11 @@ PageAttrs::~PageAttrs() { boxColorInfo.free(); group.free(); metadata.free(); + metadataNF.free(); pieceInfo.free(); separationInfo.free(); resources.free(); + resourcesNF.free(); } GBool PageAttrs::readBox(Dict *dict, char *key, PDFRectangle *box) { diff --git a/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.h b/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.h index 2b011756e85..3526c65e3bc 100644 --- a/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.h +++ b/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.h @@ -5,6 +5,10 @@ // Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== +// +// Copyright 2009 Hartmut Henkel <hartmut_henkel@gmx.de> +// for added metadataNF, resourcesNF, getMetadataNF, and getResourcesNF +// needed by luatex #ifndef PAGE_H #define PAGE_H @@ -68,6 +72,10 @@ public: { return group.isDict() ? group.getDict() : (Dict *)NULL; } Stream *getMetadata() { return metadata.isStream() ? metadata.getStream() : (Stream *)NULL; } + + // much better would be to get direct access to the page dictionary, but how? + Object * getMetadataNF() { return &metadataNF; } + Dict *getPieceInfo() { return pieceInfo.isDict() ? pieceInfo.getDict() : (Dict *)NULL; } Dict *getSeparationInfo() @@ -76,6 +84,9 @@ public: Dict *getResourceDict() { return resources.isDict() ? resources.getDict() : (Dict *)NULL; } + // much better would be to get direct access to the page dictionary, but how? + Object *getResourcesNF() { return &resourcesNF; } + private: GBool readBox(Dict *dict, char *key, PDFRectangle *box); @@ -91,9 +102,11 @@ private: Object boxColorInfo; Object group; Object metadata; + Object metadataNF; Object pieceInfo; Object separationInfo; Object resources; + Object resourcesNF; }; //------------------------------------------------------------------------ @@ -133,11 +146,13 @@ public: Dict *getBoxColorInfo() { return attrs->getBoxColorInfo(); } Dict *getGroup() { return attrs->getGroup(); } Stream *getMetadata() { return attrs->getMetadata(); } + Object *getMetadataNF() { return attrs->getMetadataNF(); } Dict *getPieceInfo() { return attrs->getPieceInfo(); } Dict *getSeparationInfo() { return attrs->getSeparationInfo(); } // Get resource dictionary. Dict *getResourceDict() { return attrs->getResourceDict(); } + Object *getResourcesNF() { return attrs->getResourcesNF(); } // Get annotations array. Object *getAnnots(Object *obj) { return annots.fetch(xref, obj); } diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc index 8a177163a76..ef799111cac 100644 --- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc +++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc @@ -20,7 +20,7 @@ static const char _svn_version[] = "$Id: pdftoepdf.cc 3431 2010-02-17 20:35:50Z oneiros $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.60.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc $"; + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/image/pdftoepdf.cc $"; #include "epdf.h" @@ -656,15 +656,12 @@ static void write_epdf1(PDF pdf, image_dict * idict) pdftex_warn ("PDF inclusion: /Resources missing. 'This practice is not recommended' (PDF Ref.)"); } else { -#if 0 // TEMP, waiting for XPDF patch resourcesNF = page->getResourcesNF(); pdf_puts(pdf, "/Resources "); copyObject(pdf, pdf_doc, resourcesNF); -#endif } // write the page /Metadata if it's there (as a stream it must be indirect) if (page->getMetadata() != NULL) { -#if 0 // TEMP, waiting for XPDF patch metadataNF = page->getMetadataNF(); // *NF = "don't resolve indirects" if (!metadataNF->isRef()) pdftex_warn("PDF inclusion: /Metadata must be indirect object"); @@ -672,7 +669,6 @@ static void write_epdf1(PDF pdf, image_dict * idict) pdf_printf(pdf, "/Metadata %d 0 R", addInObj(pdf, pdf_doc, metadataNF->getRef())); } -#endif } // write the page /Group if it's there if (page->getGroup() != NULL) { |