Jason (jcreed) wrote,
Jason
jcreed

I hate computers some days.

So I tried following the latest PDF spec to the letter, putting in every required field and shit, and created the following PDF:

http://www.cs.cmu.edu/~jcreed/transfer/Test.pdf

The only description of embedding TrueType fonts I could find led me to believe that possibly I could just take the binary data of a .ttf file and stuff it into a "stream object" and link things up properly. I did this, and indeed it works fine if I run gv on the pdf, although Acrobat reader chokes on the embedded font.

Also, gv only works as long as I refer to the file by a relative path not involving "..". An absolute path or use of .. leads to a blank page of, I concede, the right size. What the fuck, people. Apparently this has nothing to do with embedded fonts or any other particular pdf feature.

Still don't know what I'm doing wrong to not satisfy acrobat, though, grr.

---

Apparently PDF files can refer to external files; If I keep the truetype font external, then I get the same results: works fine in gv, gets an error in Acrobat. So it's probably not the font data itself that's bad, but something in the extra font-related data that I'm putting in the PDF itself. It's really annoying programming against a standard when I don't have the source code of a guaranteed standards-compliant viewer. At least I assume that gv is in the wrong here vis-a-vis the standard, being too liberal in what it accepts. Maybe I could try tracing through why Evince breaks or something.
Tags: angst, pdf, programming
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 11 comments