mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Bugfixing: correct handling of optional content
This commit is contained in:
@ -516,7 +516,17 @@ PDFOptionalContentMembershipObject PDFOptionalContentMembershipObject::create(co
|
||||
{
|
||||
// First, scan all optional content groups
|
||||
PDFDocumentDataLoaderDecorator loader(document);
|
||||
std::vector<PDFObjectReference> ocgs = loader.readReferenceArrayFromDictionary(dictionary, "OCGs");
|
||||
std::vector<PDFObjectReference> ocgs;
|
||||
|
||||
PDFObject singleOCG = dictionary->get("OCGs");
|
||||
if (singleOCG.isReference())
|
||||
{
|
||||
ocgs = { singleOCG.getReference() };
|
||||
}
|
||||
else
|
||||
{
|
||||
ocgs = loader.readReferenceArrayFromDictionary(dictionary, "OCGs");
|
||||
}
|
||||
|
||||
if (!ocgs.empty())
|
||||
{
|
||||
|
Reference in New Issue
Block a user