Writing PDF files from RunRev

Dave Cragg dcragg at lacscentre.co.uk
Thu Dec 4 12:47:09 EST 2003


At 9:43 am -0700 4/12/03, Alex Rice wrote:
>On Dec 4, 2003, at 3:18 AM, Alejandro Tejada wrote:
>>
>>  If you could visit the link, please read the
>>  article and try it by yourself.
>>
>>  What I'm doing wrong?
>
>Alejandro, I've no idea. I read the article and tried creating the 
>example PDF with Emacs editor using various line endings, including 
>just a ^M which is what another PDF file appeared to use. No matter 
>what, I cannot view the doc with Preview.app on OS X.
>
>If it's this hard to write a Hello World, just imagine how much work 
>it would be to write actual content.
>
>There is a reason the saying "I'd rather write postscript by hand 
>than [...]" is often used sarcastically.

There certainly is. Below is some sample "Hello World" PDF code from 
the Adobe PDF 1.3 spec.
<http://partners.adobe.com/asn/tech/pdf/specifications.jsp>

This worked, but you may have to modify it as there are various 
offset values included which have probably changed because of e-mail 
formatting.

Cheers
Dave

---------------------------------------------------
%PDF-1.3
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 /Font << /F1 7 0 R >> >> >>
endobj
5 0 obj
<< /Length 43 >>
stream
BT /F1 24 Tf 100 100 Td (Hello World) Tj ET
endstream
endobj
6 0 obj
[/PDF /Text]
endobj
7 0 obj
<< /Type /Font /Subtype /TrueType /Name /F1 /BaseFont /Arial 
/Encoding /MacRomanEncoding >>
endobj
xref
0 8
0000000000 65535 f
0000000009 00000 n
0000000074 00000 n
0000000120 00000 n
0000000177 00000 n
0000000323 00000 n
0000000416 00000 n
0000000444 00000 n
trailer
<< /Size 8 /Root 1 0 R >>
startxref
551
%%EOF
-----------------------------------------------



More information about the use-livecode mailing list