2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 02:49:00 +00:00

Fix QPDFEFStreamObjectHelper::{get,set}Subtype

The /Subtype entry that specifies the mime type of an embedded file is
inside the embedded file stream dictionary directly, not it in the
parameter dictionary.

See Table 45 and 46 in the PDF 1.7 specification:
https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=112
This commit is contained in:
Fredrik Fornwall 2021-09-10 00:05:48 +02:00 committed by Jay Berkenbilt
parent d2e7f2a384
commit e0775238b8
6 changed files with 55 additions and 54 deletions

View File

@ -76,7 +76,7 @@ QPDFEFStreamObjectHelper::getSize()
std::string
QPDFEFStreamObjectHelper::getSubtype()
{
auto val = getParam("/Subtype");
auto val = this->oh.getDict().getKey("/Subtype");
if (val.isName())
{
auto n = val.getName();
@ -141,7 +141,8 @@ QPDFEFStreamObjectHelper::setModDate(std::string const& date)
QPDFEFStreamObjectHelper&
QPDFEFStreamObjectHelper::setSubtype(std::string const& subtype)
{
setParam("/Subtype", QPDFObjectHandle::newName("/" + subtype));
this->oh.getDict().replaceKey(
"/Subtype", QPDFObjectHandle::newName("/" + subtype));
return *this;
}

View File

@ -101,8 +101,8 @@ endobj
/CreationDate (D:20210210091359-05'00')
/ModDate (D:20210210141359Z)
/Size 12
/Subtype /text#2fplain
>>
/Subtype /text#2fplain
/Type /EmbeddedFile
/Length 9 0 R
>>
@ -204,20 +204,20 @@ xref
0000000587 00000 n
0000000709 00000 n
0000000904 00000 n
0000001199 00000 n
0000001218 00000 n
0000001488 00000 n
0000001508 00000 n
0000001778 00000 n
0000001821 00000 n
0000001922 00000 n
0000001942 00000 n
0000002061 00000 n
0000001197 00000 n
0000001216 00000 n
0000001486 00000 n
0000001506 00000 n
0000001776 00000 n
0000001819 00000 n
0000001920 00000 n
0000001940 00000 n
0000002059 00000 n
trailer <<
/Root 1 0 R
/Size 18
/ID [<31415926535897932384626433832795><31415926535897932384626433832795>]
>>
startxref
2097
2095
%%EOF

View File

@ -144,8 +144,8 @@ endobj
/CreationDate (D:20210210091359-05'00')
/ModDate (D:20210210141359Z)
/Size 12
/Subtype /text#2fplain
>>
/Subtype /text#2fplain
/Type /EmbeddedFile
/Length 12 0 R
>>
@ -208,8 +208,8 @@ endobj
/CreationDate (D:20210210091359-05'00')
/ModDate (D:20210210141359Z)
/Size 12
/Subtype /text#2fplain
>>
/Subtype /text#2fplain
/Type /EmbeddedFile
/Length 18 0 R
>>
@ -314,26 +314,26 @@ xref
0000001039 00000 n
0000001161 00000 n
0000001357 00000 n
0000001654 00000 n
0000001674 00000 n
0000001944 00000 n
0000001964 00000 n
0000002234 00000 n
0000002254 00000 n
0000002551 00000 n
0000002571 00000 n
0000002841 00000 n
0000002861 00000 n
0000003131 00000 n
0000003174 00000 n
0000003275 00000 n
0000003295 00000 n
0000003414 00000 n
0000001652 00000 n
0000001672 00000 n
0000001942 00000 n
0000001962 00000 n
0000002232 00000 n
0000002252 00000 n
0000002547 00000 n
0000002567 00000 n
0000002837 00000 n
0000002857 00000 n
0000003127 00000 n
0000003170 00000 n
0000003271 00000 n
0000003291 00000 n
0000003410 00000 n
trailer <<
/Root 1 0 R
/Size 27
/ID [<31415926535897932384626433832795><31415926535897932384626433832795>]
>>
startxref
3450
3446
%%EOF

View File

@ -108,8 +108,8 @@ endobj
/CreationDate (D:20210207191121-05'00')
/ModDate (D:20210208001122Z)
/Size 9
/Subtype /text#2fplain
>>
/Subtype /text#2fplain
/Type /EmbeddedFile
/Length 9 0 R
>>
@ -129,8 +129,8 @@ endobj
/Params <<
/CheckSum <2fce9c8228e360ba9b04a1bd1bf63d6b>
/Size 11
/Subtype /text#2fplain
>>
/Subtype /text#2fplain
/Type /EmbeddedFile
/Length 11 0 R
>>
@ -150,8 +150,8 @@ endobj
/Params <<
/CheckSum <2236c155b1d62b7f00285bba081d4336>
/Size 11
/Subtype /text#2fplain
>>
/Subtype /text#2fplain
/Type /EmbeddedFile
/Length 13 0 R
>>
@ -214,20 +214,20 @@ xref
0000000707 00000 n
0000000876 00000 n
0000001098 00000 n
0000001389 00000 n
0000001435 00000 n
0000001654 00000 n
0000001702 00000 n
0000001921 00000 n
0000001991 00000 n
0000002092 00000 n
0000002139 00000 n
0000002285 00000 n
0000001387 00000 n
0000001433 00000 n
0000001650 00000 n
0000001698 00000 n
0000001915 00000 n
0000001985 00000 n
0000002086 00000 n
0000002133 00000 n
0000002279 00000 n
trailer <<
/Root 1 0 R
/Size 18
/ID [<31415926535897932384626433832795><31415926535897932384626433832795>]
>>
startxref
2321
2315
%%EOF

View File

@ -93,8 +93,8 @@ endobj
/CreationDate (D:20210207191121-05'00')
/ModDate (D:20210208001122Z)
/Size 9
/Subtype /text#2fplain
>>
/Subtype /text#2fplain
/Type /EmbeddedFile
/Length 8 0 R
>>
@ -114,8 +114,8 @@ endobj
/Params <<
/CheckSum <2236c155b1d62b7f00285bba081d4336>
/Size 11
/Subtype /text#2fplain
>>
/Subtype /text#2fplain
/Type /EmbeddedFile
/Length 10 0 R
>>
@ -177,18 +177,18 @@ xref
0000000541 00000 n
0000000708 00000 n
0000000930 00000 n
0000001221 00000 n
0000001267 00000 n
0000001485 00000 n
0000001556 00000 n
0000001657 00000 n
0000001705 00000 n
0000001852 00000 n
0000001219 00000 n
0000001265 00000 n
0000001481 00000 n
0000001552 00000 n
0000001653 00000 n
0000001701 00000 n
0000001848 00000 n
trailer <<
/Root 1 0 R
/Size 15
/ID [<31415926535897932384626433832795><31415926535897932384626433832795>]
>>
startxref
1888
1884
%%EOF