Security handler fix: if metadata are not encrypted, encryption produces invalid PDF document

This commit is contained in:
Jakub Melka 2022-06-29 18:44:40 +02:00
parent c92120c48c
commit be753b2965

View File

@ -2025,6 +2025,8 @@ PDFSecurityHandlerPointer PDFSecurityHandlerFactory::createSecurityHandler(const
}
}
handler->m_filterDefault.encryptMetadata = settings.encryptContents == All;
switch (settings.encryptContents)
{
case All:
@ -2050,8 +2052,6 @@ PDFSecurityHandlerPointer PDFSecurityHandlerFactory::createSecurityHandler(const
break;
}
handler->m_filterDefault.encryptMetadata = settings.encryptContents == All;
if (standardHandler)
{
handler->m_cryptFilters["StdCF"] = handler->m_filterDefault;