Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unexplained last few lines of a PDF

Tags:

pdf

This is a massive long shot, but I'm giving it a go anyway.

I'm reverse-engineering part of a daemon of a scanner, since it was never compiled for the architecture I require it on, and the producer has dropped support. As part of this process, I'm reading a PDF file directly from a TCP socket.

After filtering out a few control bytes that appear in and around the PDF file, I believe I have succesfully extracted the file from the data stream. However, the end of file still displays a slight corruption (the yellow-to-black gradient). I guess it's better illustrated with an image:

last few lines of the pdf

I recall seeing this a while ago, but I do not recall the context.. Is this a broader problem that sometimes happens in PDFs when you missconfigure a parameter?

Is this perhaps an indicator that I am providing less content than one of the headers promises I will?

like image 969
Joost Avatar asked Nov 11 '22 10:11

Joost


1 Answers

It looks like a bitmap ran out of bounds. Damaged bitmaps are usually not fatal errors in a PDF; a good viewer will plod on nevertheless.

like image 150
Jongware Avatar answered Jan 04 '23 01:01

Jongware