diff options
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDF.cc | 24 | ||||
-rw-r--r-- | libqpdf/QPDF_optimization.cc | 2 | ||||
-rw-r--r-- | libqpdf/QPDF_pages.cc | 2 |
3 files changed, 26 insertions, 2 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index e97da295..b0a8741c 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -17,6 +17,24 @@ std::string QPDF::qpdf_version = "2.3.1"; +static char const* EMPTY_PDF = + "%PDF-1.3\n" + "1 0 obj\n" + "<< /Type /Catalog /Pages 2 0 R >>\n" + "endobj\n" + "2 0 obj\n" + "<< /Type /Pages /Kids [] /Count 0 >>\n" + "endobj\n" + "xref\n" + "0 3\n" + "0000000000 65535 f \n" + "0000000009 00000 n \n" + "0000000058 00000 n \n" + "trailer << /Size 3 /Root 1 0 R >>\n" + "startxref\n" + "110\n" + "%%EOF\n"; + void QPDF::InputSource::setLastOffset(qpdf_offset_t offset) { @@ -350,6 +368,12 @@ QPDF::processMemoryFile(char const* description, } void +QPDF::emptyPDF() +{ + processMemoryFile("empty file", EMPTY_PDF, strlen(EMPTY_PDF)); +} + +void QPDF::setIgnoreXRefStreams(bool val) { this->ignore_xref_streams = val; diff --git a/libqpdf/QPDF_optimization.cc b/libqpdf/QPDF_optimization.cc index 10b56b60..f2d33863 100644 --- a/libqpdf/QPDF_optimization.cc +++ b/libqpdf/QPDF_optimization.cc @@ -365,7 +365,7 @@ QPDF::optimizePagesTreeInternal( throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), this->last_object_description, this->file->getLastOffset(), - "invalid Type in page tree"); + "invalid Type " + type + " in page tree"); } } diff --git a/libqpdf/QPDF_pages.cc b/libqpdf/QPDF_pages.cc index 2b8a831e..89f5f195 100644 --- a/libqpdf/QPDF_pages.cc +++ b/libqpdf/QPDF_pages.cc @@ -73,7 +73,7 @@ QPDF::getAllPagesInternal(QPDFObjectHandle cur_pages, throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), this->last_object_description, this->file->getLastOffset(), - ": invalid Type in page tree"); + "invalid Type " + type + " in page tree"); } } |