| 1 |
#include <podofo/private/PdfDeclarationsPrivate.h> |
| 2 |
#include <podofo/podofo.h> |
| 3 |
|
| 4 |
|
| 5 |
// All PoDoFo classes are member of the PoDoFo namespace. |
| 6 |
using namespace std; |
| 7 |
using namespace PoDoFo; |
| 8 |
|
| 9 |
int main(int argc, char* argv[]) |
| 10 |
{ |
| 11 |
fstream file(R"(D:\OneDrive\ShareWork\Podofo\MacExpertEncoding.txt)", ios::in); |
| 12 |
CodePointSpan codePoints; |
| 13 |
string name; |
| 14 |
string encoding; |
| 15 |
string temp; |
| 16 |
std::getline(file, name); |
| 17 |
while (file) |
| 18 |
{ |
| 19 |
if (name == ".notdef") |
| 20 |
{ |
| 21 |
encoding.append("0x0000,\n"); |
| 22 |
std::getline(file, name); |
| 23 |
continue; |
| 24 |
} |
| 25 |
|
| 26 |
if (!PdfDifferenceEncoding::TryGetCodePointsFromCharName(name, codePoints)) |
| 27 |
throw runtime_error(name); |
| 28 |
|
| 29 |
utls::FormatTo(temp, "0x{:04X},\n", (unsigned)*codePoints); |
| 30 |
encoding.append(temp); |
| 31 |
std::getline(file, name); |
| 32 |
} |
| 33 |
|
| 34 |
return 0; |
| 35 |
} |