mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Optional content - first part
This commit is contained in:
@ -182,7 +182,8 @@ PDFPageContentProcessor::PDFPageContentProcessor(const PDFPage* page, const PDFD
|
||||
m_fontDictionary(nullptr),
|
||||
m_xobjectDictionary(nullptr),
|
||||
m_extendedGraphicStateDictionary(nullptr),
|
||||
m_textBeginEndState(0)
|
||||
m_textBeginEndState(0),
|
||||
m_compatibilityBeginEndState(0)
|
||||
{
|
||||
Q_ASSERT(page);
|
||||
Q_ASSERT(document);
|
||||
@ -790,6 +791,18 @@ void PDFPageContentProcessor::processCommand(const QByteArray& command)
|
||||
break;
|
||||
}
|
||||
|
||||
case Operator::CompatibilityBegin:
|
||||
{
|
||||
operatorCompatibilityBegin();
|
||||
break;
|
||||
}
|
||||
|
||||
case Operator::CompatibilityEnd:
|
||||
{
|
||||
operatorCompatibilityEnd();
|
||||
break;
|
||||
}
|
||||
|
||||
case Operator::Invalid:
|
||||
{
|
||||
m_errorList.append(PDFRenderError(RenderErrorType::Error, PDFTranslationContext::tr("Unknown operator '%1'.").arg(QString::fromLatin1(command))));
|
||||
@ -1876,6 +1889,19 @@ void PDFPageContentProcessor::operatorPaintXObject(PDFPageContentProcessor::PDFO
|
||||
}
|
||||
}
|
||||
|
||||
void PDFPageContentProcessor::operatorCompatibilityBegin()
|
||||
{
|
||||
++m_compatibilityBeginEndState;
|
||||
}
|
||||
|
||||
void PDFPageContentProcessor::operatorCompatibilityEnd()
|
||||
{
|
||||
if (--m_compatibilityBeginEndState < 0)
|
||||
{
|
||||
throw PDFRendererException(RenderErrorType::Error, PDFTranslationContext::tr("Compatibility operator begin/end mismatch."));
|
||||
}
|
||||
}
|
||||
|
||||
void PDFPageContentProcessor::drawText(const TextSequence& textSequence)
|
||||
{
|
||||
if (textSequence.items.empty())
|
||||
|
Reference in New Issue
Block a user