diff --git a/include/tesseract/renderer.h b/include/tesseract/renderer.h index 0f5f4d6f..40135bd9 100644 --- a/include/tesseract/renderer.h +++ b/include/tesseract/renderer.h @@ -25,6 +25,7 @@ // complexity of includes here. Use forward declarations wherever possible // and hide includes of complex types in baseapi.cpp. #include // for std::string +#include // for std::vector struct Pix; @@ -230,8 +231,8 @@ class TESS_API TessPDFRenderer : public TessResultRenderer { // used to make everything that isn't easily handled in a // streaming fashion. long int obj_; // counter for PDF objects - GenericVector offsets_; // offset of every PDF object in bytes - GenericVector pages_; // object number for every /Page object + std::vector offsets_; // offset of every PDF object in bytes + std::vector pages_; // object number for every /Page object std::string datadir_; // where to find the custom font bool textonly_; // skip images if set // Bookkeeping only. DIY = Do It Yourself. diff --git a/src/api/pdfrenderer.cpp b/src/api/pdfrenderer.cpp index 7c176e13..b2ace8d0 100644 --- a/src/api/pdfrenderer.cpp +++ b/src/api/pdfrenderer.cpp @@ -891,9 +891,9 @@ bool TessPDFRenderer::EndDocumentHandler() { stream << kPagesObjectNumber << " 0 obj\n<<\n /Type /Pages\n /Kids [ "; AppendString(stream.str().c_str()); size_t pages_objsize = stream.str().size(); - for (size_t i = 0; i < pages_.unsigned_size(); i++) { + for (const auto& page : pages_) { stream.str(""); - stream << pages_[i] << " 0 R "; + stream << page << " 0 R "; AppendString(stream.str().c_str()); pages_objsize += stream.str().size(); }