Redaction bugfixing

This commit is contained in:
Jakub Melka
2020-12-31 15:51:03 +01:00
parent 00e67ec2b1
commit b29791b890
6 changed files with 84 additions and 4 deletions

View File

@ -367,6 +367,20 @@ bool PDFOptimizer::performMergeIdenticalObjects()
auto processEntry = [this, &counter, &objects, &mutex, &replacementMap](size_t index)
{
const PDFObjectStorage::Entry& entry = objects[index];
// We do not merge special objects, such as pages
if (const PDFDictionary* dictionary = m_storage.getDictionaryFromObject(entry.object))
{
PDFObject nameObject = m_storage.getObject(dictionary->get("Type"));
if (nameObject.isName())
{
if (nameObject.getString() == "Page")
{
return;
}
}
}
for (size_t i = 0; i < index; ++i)
{
if (objects[i].object.isNull())