<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Some forms are not saved"
href="https://bugs.freedesktop.org/show_bug.cgi?id=93882">93882</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Some forms are not saved
</td>
</tr>
<tr>
<th>Product</th>
<td>poppler
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Assignee</th>
<td>poppler-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mkasik@redhat.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=121323" name="attach_121323" title="Mark holes in xref table as free entries">attachment 121323</a> <a href="attachment.cgi?id=121323&action=edit" title="Mark holes in xref table as free entries">[details]</a></span>
Mark holes in xref table as free entries
I've got downstream report with a PDF form which doesn't save entered data.
I've looked at this in more detail and it seems that the problem is caused by
reconstruction of xref table before saving of the form which causes "reset" of
the form.
The reconstruction is performed because there is a call for XRef::getEntry() on
entry which does not exist (with i = 7 btw). This entry doesn't exist because
there is a hole in the xref table. I was not sure whether the table is correct
then but from <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - "Error: Invalid XRef entry" messages for a valid PDF"
href="show_bug.cgi?id=48679">https://bugs.freedesktop.org/show_bug.cgi?id=48679</a> it seems that
it is (and note 17 on section 3.4.3 in specification of PDF 1.7 says that we
should treat such holes as free entries).
Attached is a patch which works for me but I'm not sure whether it doesn't add
another bug elsewhere. It marks newly added entries which where not listed in
previous sections of xref table as free. It doesn't do this if previous size of
the xref table was 0 because this indicates that the PDF is probably linearized
and it would mark some entries as free even if those will be populated later.
It doesn't "chain" the free entries but it seems that it work even without that
(otherwise we would need to reuse the code from beginning of XRef::writeXRef()
which does this).
The original report and the reproducer can be found here:
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1301016">https://bugzilla.redhat.com/show_bug.cgi?id=1301016</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>