2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 02:49:00 +00:00

newline before endstream fix for object streams (fixes #205)

This commit is contained in:
Jay Berkenbilt 2018-05-12 13:09:13 -04:00
parent b8ccbff413
commit 078cf9bf90
4 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2018-05-12 Jay Berkenbilt <ejb@ql.org>
* In newline before endstream mode, an extra newline was not
inserted prior to the endstream that ends object streams.
Fixes #205.
2018-04-15 Jay Berkenbilt <ejb@ql.org>
* Arbitrarily limit the depth of data structures represented by

View File

@ -1907,6 +1907,10 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object)
pushEncryptionFilter();
writeBuffer(stream_buffer);
popPipelineStack();
if (this->m->newline_before_endstream)
{
writeString("\n");
}
writeString("endstream");
this->m->cur_data_key.clear();
closeObject(new_id);

View File

@ -964,7 +964,7 @@ $td->runtest("check output",
show_ntests();
# ----------
$td->notify("--- Newline before endstream ---");
$n_tests += 10;
$n_tests += 12;
# From issue 133, http://verapdf.org/software/ is an open source
# package that can verify PDF/A compliance. This could potentially be
@ -975,6 +975,8 @@ foreach my $d (
['--qdf', 'qdf', 'qdf'],
['--newline-before-endstream', 'newline', 'nl'],
['--qdf --newline-before-endstream', 'newline and qdf', 'nl-qdf'],
['--object-streams=generate --newline-before-endstream',
'newline and object streams', 'nl-objstm'],
)
{
my ($flags, $description, $suffix) = @$d;

Binary file not shown.