[okular] [Bug 443055] Pdf File's Size Changed to 0 Bytes After Sudden Power Outage
Jason Liam
bugzilla_noreply at kde.org
Wed Sep 29 06:42:38 BST 2021
https://bugs.kde.org/show_bug.cgi?id=443055
--- Comment #4 from Jason Liam <jlame646 at gmail.com> ---
(In reply to David Hurka from comment #3)
> If you say you created at least X bytes worth of annotations, but you can’t
> find a docdata file which is bigger than X bytes, I am afraid, you can not
> recover the annotations. :(
>
These are the things i noticed:
1) I have 976 number of files correspoinding to the pdf i lost. By looking at
the date/time of their modification i see that they range from 26 August 2021
to 28 September 2021. During this one month i added a lot of annotations every
day. The pdf file that i started with originally(without annotation) is of 3.2
MB. Now when i was adding annotations everyday i noticed that the size of the
pdf gets bigger and bigger everyday. And at the last day(28 August 2021) it was
taking around 4.3 MB of space. So the size increased by around 1 MB during a
span of one month.
2) Whenever i added some text annotation into my pdf lets say i added a text
annotation saying "this is some example text annotation inside the pdf", i was
able to press Ctrl+F and search for this particular string "this is some
example text annotation inside the pdf" or "this is some" etc etc. This makes
me wonder if the annotations that i was adding day by day were actually
embedded inside the pdf instead of being in the xml files. I am not sure if the
version of okular that i am using (1.3.3) have this embedded annotations
feature.
3) Now to confirm that the xml files that i have have nothing to do with the
annotations that i add and the annotations are actually embedded inside the pdf
itself, i took this pdf lets say named MyBook.pdf. Now i checked the docdata
folder to see(make sure) that there are no xml files corresponding to this pdf.
So at this point i had no xml files corresponding to MyBook.pdf. Now i opened
the MyBook.pdf using Okular and added some annotation like created a rectagle
and added a text annotation saying "some xyz text for testing" and pressed
Ctrl+S. Now i went back to the docdata folder and found that there are now 4
xml files corresponding to MyBook.pdf. When i right click on any of these xml
files and see how much space each takes it is around 943 bytes(each). Now when
i open all of them simultaneously in sublime text i see that they all have
almost the same content and there is no tag for rectangle or the text
annotations that i made. Below is the content inside one of the xml files:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE documentInfo>
<documentInfo url="/home/username/Documents/MyBook.pdf">
<generalInfo>
<history>
<oldPage viewport="199;C2:0.5:0.99783:1"/>
<oldPage viewport="200;C2:0.5:1.0038:1"/>
<oldPage viewport="201;C2:0.5:0.990287:1"/>
<oldPage viewport="202;C2:0.5:0.970861:1"/>
<oldPage viewport="203;C2:0.5:0.975084:1"/>
<oldPage viewport="204;C2:0.5:0.956503:1"/>
<oldPage viewport="205;C2:0.5:0.0713682:1"/>
<oldPage viewport="204;C2:0.5:0.000422297:1"/>
<oldPage viewport="203;C2:0.5:0.00802365:1"/>
<oldPage viewport="202;C2:0.5:0.0646115:1"/>
<current viewport="201;C2:0.5:0.467483:1"/>
</history>
<views>
<view name="PageView">
<zoom mode="0" value="1.28479"/>
</view>
</views>
</generalInfo>
</documentInfo>
Now i am confused that if there is no need for xml files since they do not have
anything to do with the annotations i add in the pdf then why are they created
in the first place? What is the need of these xml files they do not correspond
to the actual annotations that i make? Is this a bug in this version of okular
1.3.3. Just FYI the 4 files are named like follows:
3187327.MyBook.pdf.xml
...
...
Moreover these files takes around 900 bytes each so they waste memory
unnecessarily it seems.
> Except there is another location where Okular stored annotations in these
> days. It was definitifely an XML file. But as far as I remember, it was
> these docdata files.
>
> > > I am surprised that the PDF file has been lost. Your Okular version should
> > > theoretically not modify it...
> >
> > Yes if instead a temporary file were used to write and checked if the write
> > was successful this problem could have been avoided.
>
> Okular should theoretically open a PDF file only for reading, not for
> writing. So it should stay in its state on disk.
>
> But actually I remember a bug report where a PDF file has shrunken to 0
> bytes after a power outage.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Okular-devel
mailing list