2018-02-17 23:47:57 +00:00
|
|
|
#include <qpdf/QPDFObjectHandle.hh>
|
|
|
|
#include <qpdf/QUtil.hh>
|
2023-05-20 11:22:32 +00:00
|
|
|
#include <cstdlib>
|
|
|
|
#include <cstring>
|
2018-02-17 23:47:57 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
2023-05-20 11:46:50 +00:00
|
|
|
static char const* whoami = nullptr;
|
2018-02-17 23:47:57 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
usage()
|
|
|
|
{
|
|
|
|
std::cerr << "Usage: " << whoami << " infile" << std::endl;
|
|
|
|
exit(2);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char* argv[])
|
|
|
|
{
|
2023-05-20 11:46:50 +00:00
|
|
|
if ((whoami = strrchr(argv[0], '/')) == nullptr) {
|
2022-02-08 14:18:08 +00:00
|
|
|
whoami = argv[0];
|
2018-02-17 23:47:57 +00:00
|
|
|
} else {
|
2022-02-08 14:18:08 +00:00
|
|
|
++whoami;
|
2018-02-17 23:47:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (argc != 2) {
|
|
|
|
usage();
|
|
|
|
}
|
|
|
|
char const* infilename = argv[1];
|
2022-05-21 14:18:15 +00:00
|
|
|
for (auto const& line: QUtil::read_lines_from_file(infilename)) {
|
2022-04-30 17:23:18 +00:00
|
|
|
QPDFObjectHandle str = QPDFObjectHandle::newString(line);
|
2018-02-17 23:47:57 +00:00
|
|
|
std::cout << str.getUTF8Value() << std::endl;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|