I need to read the xref table in PDF, and replace all free (signed with 'f'
at the end) with text string from file. This is the example of xref
table in PDF
.
xref
0 256
0000000029 65535 f
0000000017 00000 n
0000000125 00000 n
0000000216 00000 n
0000000030 65535 f
0000000031 65535 f
0000000032 65535 f
and I want to replace with string [A443DD719B11118D12D99E5EA18E5EA9934]
then it'll become:
0000000029 65535 f
0000000017 00000 n
0000000125 00000 n
0000000216 00000 n
0000000030 A443D f
0000000031 D719B f
0000000032 11118 f
. . .
I'm working with iText
or PDFBox
in Java but can't find the way how to read or access the stream of xref
table and replace it with text from a file. Please help.