Dcm2pdf sometimes incorrectly removes the last byte of the pdf.
See dcm2pdf.cc line 315 and further:
315 /* strip pad byte at end of file, if there is one. The PDF format expects
316 * files to end with %%EOF followed by CR/LF. If the last character of the
317 * file is not a CR or LF, we assume it is a pad byte and remove it.
318 */
319 if (pdfDocument[len-1] != 10 && pdfDocument[len-1] != 13)
320 {
321 --len;
322 }
Some pdf files do not end with a CR/LF character after the %%EOF marker.
When this is the case and there also is no pad byte, the code removes the 'F' character (from the %%EOF marker).
Dcm2pdf sometimes creates corrupted pdf.
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2548
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Dcm2pdf sometimes creates corrupted pdf.
There is a new CP in the pipeline that will probably solve issues like this (in the future): ftp://medical.nema.org/medical/dicom/cp ... oteven.pdf
I will also forward your report to the author of "dcm2pdf".
I will also forward your report to the author of "dcm2pdf".
-
- OFFIS DICOM Team
- Posts: 1506
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Re: Dcm2pdf sometimes creates corrupted pdf.
The bug has been fixed meanwhile in commit #52cf5b48c.
Who is online
Users browsing this forum: No registered users and 1 guest