Line
Link Here
|
0 |
-- /texk/web2c/luatexdir/image/pdftoepdf.w |
0 |
++ /texk/web2c/luatexdir/image/pdftoepdf.w |
Lines 412-418
Link Here
|
412 |
Object obj1; |
412 |
Object obj1; |
413 |
pdf_begin_array(pdf); |
413 |
pdf_begin_array(pdf); |
414 |
for (i = 0, l = array->getLength(); i < l; ++i) { |
414 |
for (i = 0, l = array->getLength(); i < l; ++i) { |
415 |
obj1 = array->getNF(i); |
415 |
obj1 = array->get(i); |
416 |
copyObject(pdf, pdf_doc, &obj1); |
416 |
copyObject(pdf, pdf_doc, &obj1); |
417 |
} |
417 |
} |
418 |
pdf_end_array(pdf); |
418 |
pdf_end_array(pdf); |
Lines 425-431
Link Here
|
425 |
pdf_begin_dict(pdf); |
425 |
pdf_begin_dict(pdf); |
426 |
for (i = 0, l = dict->getLength(); i < l; ++i) { |
426 |
for (i = 0, l = dict->getLength(); i < l; ++i) { |
427 |
copyName(pdf, dict->getKey(i)); |
427 |
copyName(pdf, dict->getKey(i)); |
428 |
obj1 = dict->getValNF(i); |
428 |
obj1 = dict->getVal(i); |
429 |
copyObject(pdf, pdf_doc, &obj1); |
429 |
copyObject(pdf, pdf_doc, &obj1); |
430 |
} |
430 |
} |
431 |
pdf_end_dict(pdf); |
431 |
pdf_end_dict(pdf); |
Lines 788-799
Link Here
|
788 |
Now all relevant parts of the Page dictionary are copied. Metadata validity |
788 |
Now all relevant parts of the Page dictionary are copied. Metadata validity |
789 |
check is needed(as a stream it must be indirect). |
789 |
check is needed(as a stream it must be indirect). |
790 |
*/ |
790 |
*/ |
791 |
obj1 = pageDict->lookupNF("Metadata"); |
791 |
obj1 = pageDict->lookup("Metadata"); |
792 |
if (!obj1.isNull() && !obj1.isRef()) |
792 |
if (!obj1.isNull() && !obj1.isRef()) |
793 |
formatted_warning("pdf inclusion","/Metadata must be indirect object"); |
793 |
formatted_warning("pdf inclusion","/Metadata must be indirect object"); |
794 |
/* copy selected items in Page dictionary */ |
794 |
/* copy selected items in Page dictionary */ |
795 |
for (i = 0; pagedictkeys[i] != NULL; i++) { |
795 |
for (i = 0; pagedictkeys[i] != NULL; i++) { |
796 |
obj1 = pageDict->lookupNF(pagedictkeys[i]); |
796 |
obj1 = pageDict->lookup(pagedictkeys[i]); |
797 |
if (!obj1.isNull()) { |
797 |
if (!obj1.isNull()) { |
798 |
pdf_add_name(pdf, pagedictkeys[i]); |
798 |
pdf_add_name(pdf, pagedictkeys[i]); |
799 |
/* preserves indirection */ |
799 |
/* preserves indirection */ |
Lines 806-818
Link Here
|
806 |
PDF file, climbing up the tree until the Resources are found. |
806 |
PDF file, climbing up the tree until the Resources are found. |
807 |
(This fixes a problem with Scribus 1.3.3.14.) |
807 |
(This fixes a problem with Scribus 1.3.3.14.) |
808 |
*/ |
808 |
*/ |
809 |
obj1 = pageDict->lookupNF("Resources"); |
809 |
obj1 = pageDict->lookup("Resources"); |
810 |
if (obj1.isNull()) { |
810 |
if (obj1.isNull()) { |
811 |
op1 = &pagesobj1; |
811 |
op1 = &pagesobj1; |
812 |
op2 = &pagesobj2; |
812 |
op2 = &pagesobj2; |
813 |
*op1 = pageDict->lookup("Parent"); |
813 |
*op1 = pageDict->lookup("Parent"); |
814 |
while (op1->isDict()) { |
814 |
while (op1->isDict()) { |
815 |
obj1 = op1->dictLookupNF("Resources"); |
815 |
obj1 = op1->dictLookup("Resources"); |
816 |
if (!obj1.isNull()) { |
816 |
if (!obj1.isNull()) { |
817 |
pdf_add_name(pdf, "Resources"); |
817 |
pdf_add_name(pdf, "Resources"); |
818 |
copyObject(pdf, pdf_doc, &obj1); |
818 |
copyObject(pdf, pdf_doc, &obj1); |
819 |
-- /texk/web2c/luatexdir/lua/lepdflib.cc |
819 |
++ /texk/web2c/luatexdir/lua/lepdflib.cc |
Lines 736-742
Link Here
|
736 |
if (i > 0 && i <= len) { |
736 |
if (i > 0 && i <= len) { |
737 |
uout = new_Object_userdata(L); |
737 |
uout = new_Object_userdata(L); |
738 |
uout->d = new Object(); |
738 |
uout->d = new Object(); |
739 |
*((Object *) uout->d) = ((Array *) uin->d)->getNF(i - 1); |
739 |
*((Object *) uout->d) = ((Array *) uin->d)->get(i - 1); |
740 |
uout->atype = ALLOC_LEPDF; |
740 |
uout->atype = ALLOC_LEPDF; |
741 |
uout->pc = uin->pc; |
741 |
uout->pc = uin->pc; |
742 |
uout->pd = uin->pd; |
742 |
uout->pd = uin->pd; |
Lines 1037-1043
Link Here
|
1037 |
s = luaL_checkstring(L, 2); |
1037 |
s = luaL_checkstring(L, 2); |
1038 |
uout = new_Object_userdata(L); |
1038 |
uout = new_Object_userdata(L); |
1039 |
uout->d = new Object(); |
1039 |
uout->d = new Object(); |
1040 |
*((Object *) uout->d) = ((Dict *) uin->d)->lookupNF(s); |
1040 |
*((Object *) uout->d) = ((Dict *) uin->d)->lookup(s); |
1041 |
uout->atype = ALLOC_LEPDF; |
1041 |
uout->atype = ALLOC_LEPDF; |
1042 |
uout->pc = uin->pc; |
1042 |
uout->pc = uin->pc; |
1043 |
uout->pd = uin->pd; |
1043 |
uout->pd = uin->pd; |
Lines 1110-1116
Link Here
|
1110 |
if (i > 0 && i <= len) { |
1110 |
if (i > 0 && i <= len) { |
1111 |
uout = new_Object_userdata(L); |
1111 |
uout = new_Object_userdata(L); |
1112 |
uout->d = new Object(); |
1112 |
uout->d = new Object(); |
1113 |
*((Object *) uout->d) = ((Dict *) uin->d)->getValNF(i - 1); |
1113 |
*((Object *) uout->d) = ((Dict *) uin->d)->getVal(i - 1); |
1114 |
uout->atype = ALLOC_LEPDF; |
1114 |
uout->atype = ALLOC_LEPDF; |
1115 |
uout->pc = uin->pc; |
1115 |
uout->pc = uin->pc; |
1116 |
uout->pd = uin->pd; |
1116 |
uout->pd = uin->pd; |
Lines 1500-1506
Link Here
|
1500 |
pdfdoc_changed_error(L); |
1500 |
pdfdoc_changed_error(L); |
1501 |
num = luaL_checkint(L, 2); |
1501 |
num = luaL_checkint(L, 2); |
1502 |
gen = luaL_checkint(L, 3); |
1502 |
gen = luaL_checkint(L, 3); |
1503 |
*((Object *) uin->d) = Object(num, gen); |
1503 |
const Ref ref = {num, gen}; |
|
|
1504 |
*((Object *) uin->d) = Object(ref); |
1504 |
return 0; |
1505 |
return 0; |
1505 |
} |
1506 |
} |
1506 |
|
1507 |
|
Lines 1854-1860
Link Here
|
1854 |
if (i > 0 && i <= len) { |
1855 |
if (i > 0 && i <= len) { |
1855 |
uout = new_Object_userdata(L); |
1856 |
uout = new_Object_userdata(L); |
1856 |
uout->d = new Object(); |
1857 |
uout->d = new Object(); |
1857 |
*((Object *) uout->d) = ((Object *) uin->d)->arrayGetNF(i - 1); |
1858 |
*((Object *) uout->d) = ((Object *) uin->d)->arrayGet(i - 1); |
1858 |
uout->atype = ALLOC_LEPDF; |
1859 |
uout->atype = ALLOC_LEPDF; |
1859 |
uout->pc = uin->pc; |
1860 |
uout->pc = uin->pc; |
1860 |
uout->pd = uin->pd; |
1861 |
uout->pd = uin->pd; |
Lines 1947-1953
Link Here
|
1947 |
if (((Object *) uin->d)->isDict()) { |
1948 |
if (((Object *) uin->d)->isDict()) { |
1948 |
uout = new_Object_userdata(L); |
1949 |
uout = new_Object_userdata(L); |
1949 |
uout->d = new Object(); |
1950 |
uout->d = new Object(); |
1950 |
*((Object *) uout->d) = ((Object *) uin->d)->dictLookupNF(s); |
1951 |
*((Object *) uout->d) = ((Object *) uin->d)->dictLookup(s); |
1951 |
uout->atype = ALLOC_LEPDF; |
1952 |
uout->atype = ALLOC_LEPDF; |
1952 |
uout->pc = uin->pc; |
1953 |
uout->pc = uin->pc; |
1953 |
uout->pd = uin->pd; |
1954 |
uout->pd = uin->pd; |
Lines 2012-2018
Link Here
|
2012 |
if (i > 0 && i <= len) { |
2013 |
if (i > 0 && i <= len) { |
2013 |
uout = new_Object_userdata(L); |
2014 |
uout = new_Object_userdata(L); |
2014 |
uout->d = new Object(); |
2015 |
uout->d = new Object(); |
2015 |
*((Object *) uout->d) = ((Object *) uin->d)->dictGetValNF(i - 1); |
2016 |
*((Object *) uout->d) = ((Object *) uin->d)->dictGetVal(i - 1); |
2016 |
uout->atype = ALLOC_LEPDF; |
2017 |
uout->atype = ALLOC_LEPDF; |
2017 |
uout->pc = uin->pc; |
2018 |
uout->pc = uin->pc; |
2018 |
uout->pd = uin->pd; |
2019 |
uout->pd = uin->pd; |
2019 |
-- /texk/web2c/pdftexdir/pdftoepdf.cc |
2020 |
++ /texk/web2c/pdftexdir/pdftoepdf.cc |
Lines 287-293
Link Here
|
287 |
Object obj1; |
287 |
Object obj1; |
288 |
copyName((char *)obj->dictGetKey(i)); |
288 |
copyName((char *)obj->dictGetKey(i)); |
289 |
pdf_puts(" "); |
289 |
pdf_puts(" "); |
290 |
obj1 = obj->dictGetValNF(i); |
290 |
obj1 = obj->dictGetVal(i); |
291 |
copyObject(&obj1); |
291 |
copyObject(&obj1); |
292 |
pdf_puts("\n"); |
292 |
pdf_puts("\n"); |
293 |
} |
293 |
} |
Lines 346-352
Link Here
|
346 |
obj->getTypeName()); |
346 |
obj->getTypeName()); |
347 |
pdf_puts("/ProcSet [ "); |
347 |
pdf_puts("/ProcSet [ "); |
348 |
for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { |
348 |
for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { |
349 |
procset = obj->arrayGetNF(i); |
349 |
procset = obj->arrayGet(i); |
350 |
if (!procset.isName()) |
350 |
if (!procset.isName()) |
351 |
pdftex_fail("PDF inclusion: invalid ProcSet entry type <%s>", |
351 |
pdftex_fail("PDF inclusion: invalid ProcSet entry type <%s>", |
352 |
procset.getTypeName()); |
352 |
procset.getTypeName()); |
Lines 401-407
Link Here
|
401 |
if (fontdict.isDict()) { |
401 |
if (fontdict.isDict()) { |
402 |
subtype = fontdict.dictLookup("Subtype"); |
402 |
subtype = fontdict.dictLookup("Subtype"); |
403 |
basefont = fontdict.dictLookup("BaseFont"); |
403 |
basefont = fontdict.dictLookup("BaseFont"); |
404 |
fontdescRef = fontdict.dictLookupNF("FontDescriptor"); |
404 |
fontdescRef = fontdict.dictLookup("FontDescriptor"); |
405 |
if (fontdescRef.isRef()) { |
405 |
if (fontdescRef.isRef()) { |
406 |
fontdesc = fontdescRef.fetch(xref); |
406 |
fontdesc = fontdescRef.fetch(xref); |
407 |
} |
407 |
} |
Lines 447-453
Link Here
|
447 |
obj->getTypeName()); |
447 |
obj->getTypeName()); |
448 |
pdf_puts("/Font << "); |
448 |
pdf_puts("/Font << "); |
449 |
for (i = 0, l = obj->dictGetLength(); i < l; ++i) { |
449 |
for (i = 0, l = obj->dictGetLength(); i < l; ++i) { |
450 |
fontRef = obj->dictGetValNF(i); |
450 |
fontRef = obj->dictGetVal(i); |
451 |
if (fontRef.isRef()) |
451 |
if (fontRef.isRef()) |
452 |
copyFont(obj->dictGetKey(i), &fontRef); |
452 |
copyFont(obj->dictGetKey(i), &fontRef); |
453 |
else if (fontRef.isDict()) { // some programs generate pdf with embedded font object |
453 |
else if (fontRef.isDict()) { // some programs generate pdf with embedded font object |
Lines 590-596
Link Here
|
590 |
} else if (obj->isArray()) { |
590 |
} else if (obj->isArray()) { |
591 |
pdf_puts("["); |
591 |
pdf_puts("["); |
592 |
for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { |
592 |
for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { |
593 |
obj1 = obj->arrayGetNF(i); |
593 |
obj1 = obj->arrayGet(i); |
594 |
if (!obj1.isName()) |
594 |
if (!obj1.isName()) |
595 |
pdf_puts(" "); |
595 |
pdf_puts(" "); |
596 |
copyObject(&obj1); |
596 |
copyObject(&obj1); |
Lines 928-940
Link Here
|
928 |
pdf_puts(stripzeros(s)); |
928 |
pdf_puts(stripzeros(s)); |
929 |
|
929 |
|
930 |
// Metadata validity check (as a stream it must be indirect) |
930 |
// Metadata validity check (as a stream it must be indirect) |
931 |
dictObj = pageDict->lookupNF("Metadata"); |
931 |
dictObj = pageDict->lookup("Metadata"); |
932 |
if (!dictObj.isNull() && !dictObj.isRef()) |
932 |
if (!dictObj.isNull() && !dictObj.isRef()) |
933 |
pdftex_warn("PDF inclusion: /Metadata must be indirect object"); |
933 |
pdftex_warn("PDF inclusion: /Metadata must be indirect object"); |
934 |
|
934 |
|
935 |
// copy selected items in Page dictionary except Resources & Group |
935 |
// copy selected items in Page dictionary except Resources & Group |
936 |
for (i = 0; pageDictKeys[i] != NULL; i++) { |
936 |
for (i = 0; pageDictKeys[i] != NULL; i++) { |
937 |
dictObj = pageDict->lookupNF(pageDictKeys[i]); |
937 |
dictObj = pageDict->lookup(pageDictKeys[i]); |
938 |
if (!dictObj.isNull()) { |
938 |
if (!dictObj.isNull()) { |
939 |
pdf_newline(); |
939 |
pdf_newline(); |
940 |
pdf_printf("/%s ", pageDictKeys[i]); |
940 |
pdf_printf("/%s ", pageDictKeys[i]); |
Lines 943-949
Link Here
|
943 |
} |
943 |
} |
944 |
|
944 |
|
945 |
// handle page group |
945 |
// handle page group |
946 |
dictObj = pageDict->lookupNF("Group"); |
946 |
dictObj = pageDict->lookup("Group"); |
947 |
if (!dictObj.isNull()) { |
947 |
if (!dictObj.isNull()) { |
948 |
if (pdfpagegroupval == 0) { |
948 |
if (pdfpagegroupval == 0) { |
949 |
// another pdf with page group was included earlier on the |
949 |
// another pdf with page group was included earlier on the |