Access formatting or font information via Qt API
This issue is more a problem I'm facing when trying to use poppler Qt API.
Given the following code snippet:
if (auto document = Poppler::Document::load(fileName)) {
if (document->isLocked()) {
qCritical() << "Document is locked:" << fileName << "\n";
} else {
qDebug() << "pages: " << document->numPages() << "\n";
for (int i = 0; i < document->numPages(); i++) {
qDebug() << "page:" << i << "\n";
auto page = document->page(i);
for (auto &text : page->textList()) {
qDebug() << "\ttext: " << text->boundingBox().x()
<< " / " << text->boundingBox().y()
<< " " << text->text()
<< "\n";
}
for (auto annotation : page->annotations()) {
qDebug() << "annotation:" << annotation->uniqueName()
<< " " << annotation->author() << "\n";
}
auto image = page->renderToImage(300, 300);
image.save(QString("%0.%1.jpg")
.arg(fileName,
QString::number(i).rightJustified(3, '0')));
break;
}
for (auto font : document->fonts()) {
qDebug() << font.name();
}
}
}
How can I access formatting/font information ?