diff --git a/src/uPDFParser.cpp b/src/uPDFParser.cpp index 7b61a45..2a791f4 100644 --- a/src/uPDFParser.cpp +++ b/src/uPDFParser.cpp @@ -33,12 +33,18 @@ namespace uPDFParser std::stringstream res; res << _objectId << " " << _generationNumber << " obj\n"; - res << _dictionary.str(); - - std::vector::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::iterator it; + for(it=_data.begin(); it!=_data.end(); it++) + res << (*it)->str(); + } + res << "endobj\n"; return res.str();