Support indirect objects

This commit is contained in:
Grégory Soutadé 2021-12-18 17:26:01 +01:00
parent 8c49c53dde
commit 29a93e2cfc

View File

@ -33,12 +33,18 @@ namespace uPDFParser
std::stringstream res;
res << _objectId << " " << _generationNumber << " obj\n";
res << _dictionary.str();
std::vector<DataType*>::iterator it;
for(it=_data.begin(); it!=_data.end(); it++)
res << (*it)->str();
if (isIndirect())
res << " " << indirectOffset << "\n";
else
{
if (!_dictionary.empty())
res << _dictionary.str();
std::vector<DataType*>::iterator it;
for(it=_data.begin(); it!=_data.end(); it++)
res << (*it)->str();
}
res << "endobj\n";
return res.str();