File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -182,9 +182,9 @@ static const int kMaxBytesPerCodepoint = 20;
182
182
183
183
TessPDFRenderer::TessPDFRenderer (const char *outputbase, const char *datadir,
184
184
bool textonly)
185
- : TessResultRenderer(outputbase, " pdf" ) {
185
+ : TessResultRenderer(outputbase, " pdf" ),
186
+ datadir_ (datadir) {
186
187
obj_ = 0 ;
187
- datadir_ = datadir;
188
188
textonly_ = textonly;
189
189
offsets_.push_back (0 );
190
190
}
@@ -654,7 +654,7 @@ bool TessPDFRenderer::BeginDocumentHandler() {
654
654
if (n >= sizeof (buf)) return false ;
655
655
AppendPDFObject (buf);
656
656
657
- n = snprintf (buf, sizeof (buf), " %s/pdf.ttf" , datadir_);
657
+ n = snprintf (buf, sizeof (buf), " %s/pdf.ttf" , datadir_. c_str () );
658
658
if (n >= sizeof (buf)) return false ;
659
659
FILE *fp = fopen (buf, " rb" );
660
660
if (!fp) {
Original file line number Diff line number Diff line change 21
21
// To avoid collision with other typenames include the ABSOLUTE MINIMUM
22
22
// complexity of includes here. Use forward declarations wherever possible
23
23
// and hide includes of complex types in baseapi.cpp.
24
+ #include < string> // for std::string
24
25
#include " genericvector.h"
25
26
#include " platform.h"
26
27
@@ -202,7 +203,7 @@ class TESS_API TessPDFRenderer : public TessResultRenderer {
202
203
long int obj_; // counter for PDF objects
203
204
GenericVector<long int > offsets_; // offset of every PDF object in bytes
204
205
GenericVector<long int > pages_; // object number for every /Page object
205
- const char * datadir_; // where to find the custom font
206
+ std::string datadir_; // where to find the custom font
206
207
bool textonly_; // skip images if set
207
208
// Bookkeeping only. DIY = Do It Yourself.
208
209
void AppendPDFObjectDIY (size_t objectsize);
You can’t perform that action at this time.
0 commit comments