pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Nibali <rnib...@gmail.com>
Subject Re: Last commit in SVN HEAD broke the PDFWriter
Date Mon, 27 Jul 2015 14:14:08 GMT
Hi

On Mon, Jul 27, 2015 at 3:21 PM, Andreas Lehmkuehler <andreas@lehmi.de>
wrote:

> Am 27.07.2015 um 12:49 schrieb Roberto Nibali:
>
>> Hi Andreas
>>
>>    Due to signed NDAs, I cannot send you the PDF. If we can't solve the
>>>
>>>> issue, I'll try to generate a stripped down version for you, however
>>>>
>>> that's
>>>
>>>> going to take a day or so, and I have other pending issues which I'd
>>>> like
>>>> to address first, as the deadline for the final delivery of the tool is
>>>>
>>> now
>>>
>>>> definitely coming up.
>>>>
>>> OK, I see you are not using an incremental update feature. The name of
>>> the
>>> modified method "doWriteXRefInc" pretends to be limited to incremental
>>> updates,
>>> but it isn't.
>>>
>>>
>> I have uploaded the PDFs here (for a limited time):
>>
>> ​
>>   ccalt-simple.pdf
>> <
>> https://drive.google.com/file/d/0B7Bzk_1dcyc5RmcyWVo1ZURyV0k/view?usp=drive_web
>> >
>> ​​
>>   cctemp-simple.pdf
>> <
>> https://drive.google.com/file/d/0B7Bzk_1dcyc5UHUtNWh6ampVMnc/view?usp=drive_web
>> >
>> ​
>>
>> You should already have the code to reproduce my issue from a previous
>> email to this thread.
>>
>>
>>
>>>>  I just had another idea. Can you please check the following change
>>>>>
>>>>> if (trailer.getItem(COSName.PREV != null))
>>>>> {
>>>>>      trailer.setLong(COSName.PREV, doc.getStartXref())
>>>>> }
>>>>>
>>>>>
>>>>>  I modified to the following code, so it compiles:
>>>>
>>>> COSDictionary trailer = doc.getTrailer();
>>>> // use previous startXref value as new PREV value
>>>> //trailer.setLong(COSName.PREV, doc.getStartXref());
>>>> //trailer.removeItem(COSName.PREV);
>>>> if (trailer.getItem(COSName.PREV) != null)
>>>> {
>>>>      trailer.setLong(COSName.PREV, doc.getStartXref());
>>>> }
>>>>
>>>> No change, it still breaks my simple test case.
>>>>
>>> I'm not at home, so that I can't check that myself, but I guess the
>>> following
>>> should do the trick
>>> if (incrementalUpdate)
>>> {
>>>      trailer.setLong(COSName.PREV, doc.getStartXref());
>>> }
>>>
>>
>>
>> Nope, this does not work either. The following does, but that's probably
>> not what you had in mind:
>>
>> if (incrementalUpdate) {
>>     trailer.setLong(COSName.PREV, doc.getStartXref());
>> } else {
>>     trailer.removeItem(COSName.PREV);
>> }
>>
>
> That is exacatly what I have in my mind and I've comitted it already. I'm
> going to run some additional tests later.
>

Tested with the last SVN head, dropping my changes:

Revision: 1692809
Last Changed Author: lehmi
Last Changed Rev: 1692730
Last Changed Date: 2015-07-26 18:36:39 +0200 (Sun, 26 Jul 2015)

It (obviously) works.

Cheers
Roberto

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message