title: Minimal PDF example in PDF specification
body: <p>I took the minimal PDF example in the PDF specification from <a href="https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf" rel="nofollow noreferrer">PDF Specification</a>, copied it to NotePad, renamed the file to have the extension <em>.pdf</em>. </p>
  
  <p>I can open it with other PDF viewer (PDF-XChange, SumatraPDF, MuPDF). But when I open it with Adobe Reader, it says the file is broken.</p>
  
  <p>I am not sure if other viewers treat this "broken" file as blank file or not.</p>
  
  <p>The file is supposed to display one blank page, since it is a minimal example.</p>
  
  <p>In fact, I modify the minimal example. Because when I copy it from PDF specification to notepad, and open the .txt file by a Hex Editor, I see a new line in <em>.txt</em> file give me 2 space. For example,</p>
  
  <pre><code>1 0 obj
  &lt;&lt; /Type /Catalog
  </code></pre>
  
  <p>gives me (in Hex Editor)</p>
  
  <pre><code>1 0 obj  &lt;&lt; /Type /Catalog
  </code></pre>
  
  <p>which is (in hex values)</p>
  
  <pre><code>31 20 30 20 6F 62 6A 0D 0A 3C 3C 20 2F 54 79 70
  65 20 2F 43 61 74 61 6C 6F 67
  </code></pre>
  
  <p>The 2 spaces between <code>j</code> and <code>&lt;</code> are <code>0D 0A</code>.</p>
  
  <p>Hence I don't make new lines in NotePad, and modify the values in the <code>xref</code> part.</p>
  
  <p>Below is the full code.</p>
  
  <p>Do you know what's wrong with this example? Why does Adobe Reader say it is broken? Is this because I gave the wrong values in <code>xref</code>?</p>
  
  <pre><code>%PDF-1.4 1 0 obj &lt;&lt; /Type /Catalog /Outlines 2 0 R /Pages 3 0 R &gt;&gt; endobj 2 0 obj &lt;&lt; /Type Outlines /Count 0 &gt;&gt; endobj 3 0 obj &lt;&lt; /Type /Pages /Kids [4 0 R] /Count 1 &gt;&gt; endobj 4 0 obj &lt;&lt; /Type /Page /Parent 3 0 R /MediaBox [0 0 612 792] /Contents 5 0 R /Resources &lt;&lt; /ProcSet 6 0 R &gt;&gt; &gt;&gt; endobj 5 0 obj &lt;&lt; /Length 35 &gt;&gt; stream … Page-marking operators … endstream endobj 6 0 obj [/PDF] endobj xref 0 7 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000119 00000 n 0000000176 00000 n 0000000295 00000 n 0000000373 00000 n trailer &lt;&lt; /Size 7 /Root 1 0 R &gt;&gt; startxref 395 %%EOF
  </code></pre>