How to print html with cyrillic symbols? I tried to do this:
QTextDocument *document = new QTextDocument();
document->setHtml(htmlContent);
document->print(printer);
But document printed in wrong encoding. Html encoding is utf-8.
Assuming htmlContent is QString, you probably created it with wrong encoding. For example, if original HTML data (which is bytes) is UTF-8, then you should maybe use something like
htmlContent = QString::fromUtf8(myHtmlDataCharPtr);
If htmlContent is char pointer to UTF-8 data, then you should use
document->setHtml(QString::fromUtf8(htmlContent));
printer->setPaperSize(QSizeF(114,162), QPrinter::Millimeter); printer->setOrientation(QPrinter::Portrait); printer->setPageMargins(0,0,0,0, QPrinter::Millimeter); printer->setOutputFormat(QPrinter::NativeFormat);
Yes, cups is running on debian. Printer's model CUSTOM Engineering VKP80. – axon