mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Bug fixing, report warnings only once
This commit is contained in:
@ -130,6 +130,11 @@ LIBS += -L$$PDFFORQT_DEPENDENCIES_PATH/libjpeg/bin/ -ljpeg
|
|||||||
INCLUDEPATH += $$PDFFORQT_DEPENDENCIES_PATH/libjpeg/include
|
INCLUDEPATH += $$PDFFORQT_DEPENDENCIES_PATH/libjpeg/include
|
||||||
DEPENDPATH += $$PDFFORQT_DEPENDENCIES_PATH/libjpeg/include
|
DEPENDPATH += $$PDFFORQT_DEPENDENCIES_PATH/libjpeg/include
|
||||||
|
|
||||||
|
# Add libjpeg to installations
|
||||||
|
libjpeg.files = $$PDFFORQT_DEPENDENCIES_PATH/libjpeg/bin/jpeg.dll
|
||||||
|
libjpeg.path = $$DESTDIR/install
|
||||||
|
INSTALLS += libjpeg
|
||||||
|
|
||||||
# Link OpenSSL
|
# Link OpenSSL
|
||||||
LIBS += -L$$PDFFORQT_DEPENDENCIES_PATH/OpenSSL/ -llibcrypto -llibssl
|
LIBS += -L$$PDFFORQT_DEPENDENCIES_PATH/OpenSSL/ -llibcrypto -llibssl
|
||||||
INCLUDEPATH += $$PDFFORQT_DEPENDENCIES_PATH/OpenSSL/include
|
INCLUDEPATH += $$PDFFORQT_DEPENDENCIES_PATH/OpenSSL/include
|
||||||
|
@ -464,7 +464,7 @@ PDFImage PDFImage::createImage(const PDFDocument* document, const PDFStream* str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (imageFilterName == "CCITTFaxDecode")
|
else if (imageFilterName == "CCITTFaxDecode" || imageFilterName == "CCF")
|
||||||
{
|
{
|
||||||
throw PDFRendererException(RenderErrorType::NotImplemented, PDFTranslationContext::tr("Not implemented image filter 'CCITFaxDecode'."));
|
throw PDFRendererException(RenderErrorType::NotImplemented, PDFTranslationContext::tr("Not implemented image filter 'CCITFaxDecode'."));
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,6 @@ PDFPageContentProcessor::PDFPageContentProcessor(const PDFPage* page,
|
|||||||
m_textBeginEndState(0),
|
m_textBeginEndState(0),
|
||||||
m_compatibilityBeginEndState(0),
|
m_compatibilityBeginEndState(0),
|
||||||
m_drawingUncoloredTilingPatternState(0),
|
m_drawingUncoloredTilingPatternState(0),
|
||||||
m_isWarningColorOperatorsInUncoloredTilingPatternReported(false),
|
|
||||||
m_patternBaseMatrix(pagePointToDevicePointMatrix),
|
m_patternBaseMatrix(pagePointToDevicePointMatrix),
|
||||||
m_pagePointToDevicePointMatrix(pagePointToDevicePointMatrix),
|
m_pagePointToDevicePointMatrix(pagePointToDevicePointMatrix),
|
||||||
m_meshQualitySettings(meshQualitySettings)
|
m_meshQualitySettings(meshQualitySettings)
|
||||||
@ -1628,6 +1627,15 @@ void PDFPageContentProcessor::setRenderingIntentByName(QByteArray renderingInten
|
|||||||
m_graphicState.setRenderingIntentName(renderingIntentName);
|
m_graphicState.setRenderingIntentName(renderingIntentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PDFPageContentProcessor::reportRenderErrorOnce(RenderErrorType type, QString message)
|
||||||
|
{
|
||||||
|
if (!m_onceReportedErrors.count(message))
|
||||||
|
{
|
||||||
|
m_onceReportedErrors.insert(message);
|
||||||
|
reportRenderError(type, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PDFPageContentProcessor::processApplyGraphicState(const PDFDictionary* graphicStateDictionary)
|
void PDFPageContentProcessor::processApplyGraphicState(const PDFDictionary* graphicStateDictionary)
|
||||||
{
|
{
|
||||||
PDFDocumentDataLoaderDecorator loader(m_document);
|
PDFDocumentDataLoaderDecorator loader(m_document);
|
||||||
@ -1717,7 +1725,7 @@ void PDFPageContentProcessor::processApplyGraphicState(const PDFDictionary* grap
|
|||||||
bool isNone = (softMaskObject.isName() && softMaskObject.getString() == "None");
|
bool isNone = (softMaskObject.isName() && softMaskObject.getString() == "None");
|
||||||
if (!isNone)
|
if (!isNone)
|
||||||
{
|
{
|
||||||
reportRenderError(RenderErrorType::NotSupported, PDFTranslationContext::tr("Soft masks not supported."));
|
reportRenderErrorOnce(RenderErrorType::NotSupported, PDFTranslationContext::tr("Soft masks not supported."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2679,11 +2687,7 @@ void PDFPageContentProcessor::paintXObjectImage(const PDFStream* stream)
|
|||||||
|
|
||||||
void PDFPageContentProcessor::reportWarningAboutColorOperatorsInUTP()
|
void PDFPageContentProcessor::reportWarningAboutColorOperatorsInUTP()
|
||||||
{
|
{
|
||||||
if (!m_isWarningColorOperatorsInUncoloredTilingPatternReported)
|
reportRenderErrorOnce(RenderErrorType::Warning, PDFTranslationContext::tr("Color operators are not allowed in uncolored tilling pattern."));
|
||||||
{
|
|
||||||
m_isWarningColorOperatorsInUncoloredTilingPatternReported = true;
|
|
||||||
m_errorList.push_back(PDFRenderError(RenderErrorType::Warning, PDFTranslationContext::tr("Color operators are not allowed in uncolored tilling pattern.")));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PDFPageContentProcessor::operatorPaintXObject(PDFPageContentProcessor::PDFOperandName name)
|
void PDFPageContentProcessor::operatorPaintXObject(PDFPageContentProcessor::PDFOperandName name)
|
||||||
|
@ -168,6 +168,10 @@ public:
|
|||||||
|
|
||||||
virtual void reportRenderError(RenderErrorType type, QString message) override;
|
virtual void reportRenderError(RenderErrorType type, QString message) override;
|
||||||
|
|
||||||
|
/// Reports render error, but only once - if same error was already reported,
|
||||||
|
/// then no new error is reported.
|
||||||
|
void reportRenderErrorOnce(RenderErrorType type, QString message);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
class PDFLineDashPattern
|
class PDFLineDashPattern
|
||||||
@ -883,9 +887,6 @@ private:
|
|||||||
/// Is drawing uncolored tiling pattern?
|
/// Is drawing uncolored tiling pattern?
|
||||||
int m_drawingUncoloredTilingPatternState;
|
int m_drawingUncoloredTilingPatternState;
|
||||||
|
|
||||||
/// Is warning about uncolored tiling patterns reported?
|
|
||||||
bool m_isWarningColorOperatorsInUncoloredTilingPatternReported;
|
|
||||||
|
|
||||||
/// Actually realized physical font
|
/// Actually realized physical font
|
||||||
PDFCachedItem<PDFRealizedFontPointer> m_realizedFont;
|
PDFCachedItem<PDFRealizedFontPointer> m_realizedFont;
|
||||||
|
|
||||||
@ -906,6 +907,9 @@ private:
|
|||||||
|
|
||||||
/// Mesh quality settings
|
/// Mesh quality settings
|
||||||
PDFMeshQualitySettings m_meshQualitySettings;
|
PDFMeshQualitySettings m_meshQualitySettings;
|
||||||
|
|
||||||
|
/// Set with rendering errors, which were reported (and should be reported once)
|
||||||
|
std::set<QString> m_onceReportedErrors;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace pdf
|
} // namespace pdf
|
||||||
|
@ -199,14 +199,14 @@ void PDFPainter::performUpdateGraphicsState(const PDFPageContentProcessorState&
|
|||||||
|
|
||||||
if (!PDFBlendModeInfo::isSupportedByQt(blendMode))
|
if (!PDFBlendModeInfo::isSupportedByQt(blendMode))
|
||||||
{
|
{
|
||||||
reportRenderError(RenderErrorType::NotSupported, PDFTranslationContext::tr("Blend mode '%1' not supported.").arg(PDFBlendModeInfo::getBlendModeName(blendMode)));
|
reportRenderErrorOnce(RenderErrorType::NotSupported, PDFTranslationContext::tr("Blend mode '%1' not supported.").arg(PDFBlendModeInfo::getBlendModeName(blendMode)));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_painter->setCompositionMode(compositionMode);
|
m_painter->setCompositionMode(compositionMode);
|
||||||
}
|
}
|
||||||
else if (blendMode != BlendMode::Normal && blendMode != BlendMode::Compatible)
|
else if (blendMode != BlendMode::Normal && blendMode != BlendMode::Compatible)
|
||||||
{
|
{
|
||||||
reportRenderError(RenderErrorType::NotSupported, PDFTranslationContext::tr("Blend mode '%1' is in transparency group, which is not supported.").arg(PDFBlendModeInfo::getBlendModeName(blendMode)));
|
reportRenderErrorOnce(RenderErrorType::NotSupported, PDFTranslationContext::tr("Blend mode '%1' is in transparency group, which is not supported.").arg(PDFBlendModeInfo::getBlendModeName(blendMode)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,7 +366,4 @@ bool PDFPainter::canSetBlendMode(BlendMode mode) const
|
|||||||
return std::all_of(m_transparencyGroupDataStack.cbegin(), m_transparencyGroupDataStack.cend(), [](const PDFTransparencyGroupPainterData& group) { return group.blendMode == BlendMode::Normal || group.blendMode == BlendMode::Compatible; });
|
return std::all_of(m_transparencyGroupDataStack.cbegin(), m_transparencyGroupDataStack.cend(), [](const PDFTransparencyGroupPainterData& group) { return group.blendMode == BlendMode::Normal || group.blendMode == BlendMode::Compatible; });
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Check all graphic state parameter dictionaries, warn about missing ones
|
|
||||||
// TODO: Recompile libraries in MSVC 2019
|
|
||||||
|
|
||||||
} // namespace pdf
|
} // namespace pdf
|
||||||
|
Reference in New Issue
Block a user