summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-03-25 12:44:48 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-03-25 12:44:48 +0000
commitfa3e48ffa8e9e44b7d15902701f839babbfb6421 (patch)
tree9747ef1145378f1c7399ffddf1f413edfb43d391 /Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
parentd9b87d6ab23197117e56d07a09b0f0d9cf7be572 (diff)
web2c/luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@40135 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/image/pdftoepdf.w')
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.w25
1 files changed, 14 insertions, 11 deletions
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
index b9d496ac9f0..d86504f82bc 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
@@ -707,7 +707,7 @@ void read_pdf_info(image_dict * idict)
that can happen during PDF inclusion will arise here.
*/
-void write_epdf(PDF pdf, image_dict * idict)
+void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info)
{
PdfDocument *pdf_doc = NULL;
PDFDoc *doc = NULL;
@@ -719,7 +719,7 @@ void write_epdf(PDF pdf, image_dict * idict)
PDFRectangle *pagebox;
int i, l;
double bbox[4];
- char s[256];
+ /* char s[256]; */
const char *pagedictkeys[] = {
"Group", "LastModified", "Metadata", "PieceInfo", "Resources", "SeparationInfo", NULL
};
@@ -743,20 +743,23 @@ void write_epdf(PDF pdf, image_dict * idict)
pdf_begin_dict(pdf);
pdf_dict_add_name(pdf, "Type", "XObject");
pdf_dict_add_name(pdf, "Subtype", "Form");
- if (img_attr(idict) != NULL && strlen(img_attr(idict)) > 0)
+ if (img_attr(idict) != NULL && strlen(img_attr(idict)) > 0) {
pdf_printf(pdf, "\n%s\n", img_attr(idict));
+ }
pdf_dict_add_int(pdf, "FormType", 1);
/* write additional information */
pdf_dict_add_img_filename(pdf, idict);
- snprintf(s, 30, "%s.PageNumber", pdfkeyprefix);
- pdf_dict_add_int(pdf, s, (int) img_pagenum(idict));
- doc->getDocInfoNF(&obj1);
- if (obj1.isRef()) {
- /* the info dict must be indirect (PDF Ref p. 61) */
- snprintf(s, 30, "%s.InfoDict", pdfkeyprefix);
- pdf_dict_add_ref(pdf, s, addInObj(pdf, pdf_doc, obj1.getRef()));
+ if ((suppress_optional_info & 4) == 0) {
+ pdf_dict_add_int(pdf, "PTEX.PageNumber", (int) img_pagenum(idict));
+ }
+ if ((suppress_optional_info & 8) == 0) {
+ doc->getDocInfoNF(&obj1);
+ if (obj1.isRef()) {
+ /* the info dict must be indirect (PDF Ref p. 61) */
+ pdf_dict_add_ref(pdf, "PTEX.InfoDict", addInObj(pdf, pdf_doc, obj1.getRef()));
+ }
+ obj1.free();
}
- obj1.free();
if (img_is_bbox(idict)) {
bbox[0] = sp2bp(img_bbox(idict)[0]);
bbox[1] = sp2bp(img_bbox(idict)[1]);