Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion reader/uiframe/CentralDocPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ void CentralDocPage::prepareSearch()

bool CentralDocPage::isFullScreen()
{
qCInfo(appLog) << "isFullScreen";
// qCInfo(appLog) << "isFullScreen";
MainWindow *mainWindow = dynamic_cast<MainWindow *>(parentWidget()->parentWidget()->parentWidget());

if (nullptr == mainWindow)
Expand Down
26 changes: 10 additions & 16 deletions reader/uiframe/DocSheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ void DocSheet::onOpened(deepin_reader::Document::Error error)

bool DocSheet::isFullScreen()
{
qCDebug(appLog) << "isFullScreen";
// qCDebug(appLog) << "isFullScreen";
CentralDocPage *doc = static_cast<CentralDocPage *>(parent());

if (nullptr == doc)
Expand Down Expand Up @@ -1684,23 +1684,17 @@ void DocSheet::onPopPrintDialog()

//pdf若是Linearized类型的,需要另存为Normal类型,然后打印
if (Dr::PDF == fileType()) {
deepin_reader::Document *document = nullptr;
deepin_reader::Document::Error error = deepin_reader::Document ::NoError;
document = DocumentFactory::getDocument(m_fileType,
m_filePath,
convertedFileDir(),
m_password, nullptr, error);

QString pdfPath = filePath();
qCInfo(appLog) << pdfPath << "isLinearized:" << document->properties().value("Linearized").toBool();
if (document->properties().value("Linearized").toBool()) {
pdfPath = QTemporaryDir("LinearizedConverted.pdf").path();
if (!m_renderer->saveAs(pdfPath)) {
qCInfo(appLog) << "saveAs failed when print Linearized pdf";
return;
}
// 使用 pdftocairo 转换为嵌入矢量pdf,解决打印乱码和模糊问题
QString tmpPdfPath = convertedFileDir() + "/pdftocairoPrint.pdf";
QProcess process;
process.start("pdftocairo", QStringList() << "-pdf" << pdfPath << tmpPdfPath);
process.waitForFinished();
if (process.exitCode() != 0) {
qCWarning(appLog) << "pdftocairo failed:" << process.readAllStandardError();
return;
}
preview->setPrintFromPath(pdfPath);
preview->setPrintFromPath(tmpPdfPath);
}
connect(preview, QOverload<DPrinter *, const QVector<int> &>::of(&DPrintPreviewDialog::paintRequested), this, QOverload<DPrinter *, const QVector<int> &>::of(&DocSheet::onPrintRequested));
#else
Expand Down
4 changes: 2 additions & 2 deletions reader/widgets/AttrScrollWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void AttrScrollWidget::createLabel(QGridLayout *layout, const int &index, const

bool AttrScrollWidget::eventFilter(QObject *object, QEvent *event)
{
qCDebug(appLog) << "Event filter triggered, type:" << event->type();
// qCDebug(appLog) << "Event filter triggered, type:" << event->type();
if (object == this) {
if (event->type() == QEvent::Resize) {
QLocale locale;
Expand All @@ -147,6 +147,6 @@ bool AttrScrollWidget::eventFilter(QObject *object, QEvent *event)
}
}
bool result = DFrame::eventFilter(object, event);
qCDebug(appLog) << "Event filter processed, result:" << result;
// qCDebug(appLog) << "Event filter processed, result:" << result;
return result;
}