I'm trying to generate a simple PDF file (text only) programmatically.
With most PDF reader the file looks exactly like I want but some PDF readers won't open the file and report it as damaged.
I've removed every elements from the file leaving only the first void page to debug the code and found the problem but without any results, it's still recognized as damaged.
This is the raw PDF data:
%PDF-1.4
1 0 obj
<< /Type /Catalog
/Pages 2 0 R
>>
endobj
2 0 obj
<< /Type /Pages
/Count 1
/Kids [ 3 0 R ]
>>
endobj
3 0 obj
<< /Type /Page
/Parent 2 0 R
/Resources <<
>>
/MediaBox [ 0 0 595 842 ]
>>
endobj
xref
0 4
0000000000 65536 f
0000000010 00000 n
0000000067 00000 n
0000000138 00000 n
trailer
<< /Size 4
/Root 1 0 R
>>
startxref
248
%%EOF
Can anyone tell me what's wrong with this PDF?
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…