aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2009-03-09 17:27:13 +0100
committerJay Berkenbilt <ejb@ql.org>2009-03-09 17:27:13 +0100
commitf62bec3ee53a377548ec197423efc20d4f4dc206 (patch)
tree0058163a191363e8a5a7b1879206050bef48b579 /libqpdf
parentaa92e1ddb2bc18b45f9d2a09235beaa9da9ac006 (diff)
downloadqpdf-f62bec3ee53a377548ec197423efc20d4f4dc206.tar.zst
update test suite to handle original object ID comments
git-svn-id: svn+q:///qpdf/trunk@663 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDFWriter.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index 18f420b5..acaf52a8 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -32,6 +32,7 @@ QPDFWriter::QPDFWriter(QPDF& pdf, char const* filename) :
stream_data_mode(s_compress),
qdf_mode(false),
static_id(false),
+ suppress_original_object_ids(false),
direct_stream_lengths(true),
encrypted(false),
preserve_encryption(true),
@@ -105,6 +106,12 @@ QPDFWriter::setStaticID(bool val)
}
void
+QPDFWriter::setSuppressOriginalObjectIDs(bool val)
+{
+ this->suppress_original_object_ids = val;
+}
+
+void
QPDFWriter::setPreserveEncryption(bool val)
{
this->preserve_encryption = val;
@@ -932,9 +939,13 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object)
{
writeString("%% Object stream: object " +
QUtil::int_to_string(new_obj) + ", index " +
- QUtil::int_to_string(count) +
- "; original object ID: " +
- QUtil::int_to_string(obj) + "\n");
+ QUtil::int_to_string(count));
+ if (! this->suppress_original_object_ids)
+ {
+ writeString("; original object ID: " +
+ QUtil::int_to_string(obj));
+ }
+ writeString("\n");
}
if (pass == 1)
{
@@ -1028,7 +1039,7 @@ QPDFWriter::writeObject(QPDFObjectHandle object, int object_stream_index)
}
if (object_stream_index == -1)
{
- if (this->qdf_mode)
+ if (this->qdf_mode && (! this->suppress_original_object_ids))
{
writeString("%% Original object ID: " +
QUtil::int_to_string(object.getObjectID()) + " " +