replace \n with space as PS treats it as a space but PDF just removes them. we also need this so that we get the correct bounding box for PDFs considering that we do not address multi-line strings yet.
| 54 | // we also need this so that we get the correct bounding box for PDFs |
| 55 | // considering that we do not address multi-line strings yet. |
| 56 | void GetSpaceStr(const char* str, std::string* spaceStr) |
| 57 | { |
| 58 | *spaceStr = str; |
| 59 | std::string::size_type eolPos = 0; |
| 60 | while ((eolPos = spaceStr->find('\n', eolPos)) != std::string::npos) |
| 61 | { |
| 62 | spaceStr->replace(eolPos, 1, 1, ' '); |
| 63 | ++eolPos; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Computes the bottom left corner 'blpos' and a string with \n replaced |