Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8601969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:58:02+00:00 2026-06-12T01:58:02+00:00

I took the minimal PDF example in the PDF specification from PDF Specification ,

  • 0

I took the minimal PDF example in the PDF specification from PDF Specification, copied it to NotePad, renamed the file to have the extension .pdf.

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.

I am not sure if other viewers treat this “broken” file as blank file or not.

The file is supposed to display one blank page, since it is a minimal example.

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 .txt file give me 2 space. For example,

1 0 obj
<< /Type /Catalog

gives me (in Hex Editor)

1 0 obj  << /Type /Catalog

which is (in hex values)

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

The 2 spaces between j and < are 0D 0A.

Hence I don’t make new lines in NotePad, and modify the values in the xref part.

Below is the full code.

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 xref?

%PDF-1.4 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [4 0 R] /Count 1 >> endobj 4 0 obj << /Type /Page /Parent 3 0 R /MediaBox [0 0 612 792] /Contents 5 0 R /Resources << /ProcSet 6 0 R >> >> endobj 5 0 obj << /Length 35 >> 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 << /Size 7 /Root 1 0 R >> startxref 395 %%EOF
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:58:03+00:00Added an answer on June 12, 2026 at 1:58 am

    First: when you ‘copied’ the example from the PDF specification, very likely a few things happened which made your copy to not work as expected:

    • …you didn’t ‘copy’ by re-typing the example in a text editor, but
    • …you used copy’n’paste, using a PDF as the source file.

    Depending on your text editor, that method probably caused the conversion of the newline convention to be changed from [cr]+[lf] to [cr] or vice-versa. This in turn means that the byte offset numbers in the object ‘table of contents’ (the ‘xref‘-table) are no longer valid.

    Another problem with the PDF source code you posted is that it doesn’t now contain any linebreaks at all. Some viewers may be able to still silently parse the thing, but not all are. And it certainly is against the spec, because according to the spec, in chapter 7.5.2 it is clearly spelled out that

    “The first line of a PDF file shall be a header consisting of the 5 characters %PDF– followed by a version number of the form 1.N, where N is a digit between 0 and 7.

    Your header violates that rule.

    Also, the ‘stream’ in 5 0 obj isn’t any valid PDF code, it is just place holder text (… Page-marking operators …). Some viewers may be tilting when they come across such ‘garbage’.

    Lastly, your startxref value wasn’t correct.

    So here is a file that works. I repaired it in a text editor, and I put your original code as a comment after the %%EOF for comparison and reference:

    %PDF-1.4
    1 0 obj
    << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >>
    endobj
    2 0 obj
    << /Type Outlines /Count 0 >>
    endobj
    3 0 obj
    << /Type /Pages /Kids [4 0 R] /Count 1 >>
    endobj
    4 0 obj
    << /Type /Page /Parent 3 0 R /MediaBox [0 0 612 792] /Contents 5 0 R /Resources << /ProcSet 6 0 R >> >>
    endobj
    5 0 obj
    << /Length 35 >>
    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 
    0000000376 00000 n 
    trailer 
    << /Size 7 /Root 1 0 R >>
    startxref
    394
    %%EOF
    
    %% %PDF-1.4 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [4 0 R] /Count 1 >> endobj 4 0 obj << /Type /Page /Parent 3 0 R /MediaBox [0 0 612 792] /Contents 5 0 R /Resources << /ProcSet 6 0 R >> >> endobj 5 0 obj << /Length 35 >> 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 << /Size 7 /Root 1 0 R >> startxref 395
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I took the example code from the Kendo UI demos at http://demos.kendoui.com/web/grid/remote-data.html , binding
It took me FOREVER to finally find code that can download a doc file
I took the rendered page from the SWT Browser and exported it to an
I took some code from some questions here in SO as well as some
Here's a minimal version of the code that took me a lot of time
I took the facebook example but it does use the old versions of libraries
I took these variables from user @KullaniciAdi nvarchar(30), @KullaniciSoyadi nvarchar(30), @KullaniciMailAdresi nvarchar(max), @KullaniciTelNo tinyint,
I took this code from Facebook's documentation to get me started in learning how
I took many hours trying to solve this problem I have attempted, without success.
I took this code as example to write a service. And I made some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.