From df1064ff39db7a7fe3bc1adeb3f8abe63c1b0354 Mon Sep 17 00:00:00 2001 From: ThePhatak <111195860+uddhavphatak@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:20:44 +0530 Subject: [PATCH] Update pdfio.md --- doc/pdfio.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/doc/pdfio.md b/doc/pdfio.md index 24d21c8..83b9c4e 100644 --- a/doc/pdfio.md +++ b/doc/pdfio.md @@ -138,6 +138,76 @@ Understanding PDF Files A PDF file is structure in a way, so that it would be displayed in the same way across multiple devices and platforms. The basic structure of PDF File is as follows: +### A small PDF File +The following is a PDF which says "Hello, World" on one page: +``` +%PDF-1.0 **Header starts here** +%âãÏÓ +1 0 obj **Body starts here** +<< +/Kids [2 0 R] +/Count 1 +/Type /Pages +>> +endobj +2 0 obj +<< +/Rotate 0 +/Parent 1 0 R +/Resources 3 0 R +/MediaBox [0 0 612 792] +/Contents [4 0 R]/Type /Page +>> +endobj +3 0 obj +<< +/Font +<< +/F0 +<< +/BaseFont /Times-Italic +/Subtype /Type1 +/Type /Font +>> +>> +>> +endobj +4 0 obj +<< +/Length 65 +>> +stream +1. 0. 0. 1. 50. 700. cm +BT +/F0 36. Tf +(Hello, World!) Tj +ET +endstream +endobj +5 0 obj +<< +/Pages 1 0 R +/Type /Catalog +>> +endobj +xref **Cross-reference table starts here** +0 6 +0000000000 65535 f +0000000015 00000 n +0000000074 00000 n +0000000192 00000 n +0000000291 00000 n +0000000409 00000 n +trailer **Trailer starts here** +<< +/Root 5 0 R +/Size 6 +>> +startxref +459 +%%EOF +``` + ### Header This is the first line of a PDF File. This specifies the version of PDF Format used. - Example: '%PDF-1.0'