mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Draw space controller
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "pdfparser.h"
|
||||
#include "pdfconstants.h"
|
||||
#include "pdfflatmap.h"
|
||||
#include "pdfstreamfilters.h"
|
||||
|
||||
#include <regex>
|
||||
|
||||
@@ -44,6 +45,7 @@ private slots:
|
||||
void test_invalid_input();
|
||||
void test_header_regexp();
|
||||
void test_flat_map();
|
||||
void test_lzw_filter();
|
||||
|
||||
private:
|
||||
void scanWholeStream(const char* stream);
|
||||
@@ -295,6 +297,17 @@ void LexicalAnalyzerTest::test_flat_map()
|
||||
}
|
||||
}
|
||||
|
||||
void LexicalAnalyzerTest::test_lzw_filter()
|
||||
{
|
||||
// This example is from PDF 1.7 Reference
|
||||
QByteArray byteArray = QByteArray::fromHex("800B6050220C0C8501");
|
||||
pdf::PDFLzwDecodeFilter filter;
|
||||
QByteArray decoded = filter.apply(byteArray, nullptr, pdf::PDFObject());
|
||||
QByteArray valid = "-----A---B";
|
||||
|
||||
QCOMPARE(decoded, valid);
|
||||
}
|
||||
|
||||
void LexicalAnalyzerTest::scanWholeStream(const char* stream)
|
||||
{
|
||||
pdf::PDFLexicalAnalyzer analyzer(stream, stream + strlen(stream));
|
||||
|
Reference in New Issue
Block a user