Inspired by this answer, I thought an interesting challenge would be to golf a PDF file. PDF files are based on the PostScript language, so I thought this might be acceptable as a programming challenge for this site; but I wanted to check first.

A proposed challenge might be something like:

Construct the smallest possible PDF file consisting of a single A4 page with the text "Hello, world!" printed on it somewhere. The text may be in any font, but the characters must be at least 12 points in size.

Scoring will be by number of bytes in the file. External tools may be used to construct the file, but the score would be based on the size of the output PDF file itself, not on the size of the script used to generate it.

Entries must conform to the ISO 32000-1 PDF standard, and be viewable on commonly used PDF viewers.

Would such a challenge be on topic?

  • 1
    \$\begingroup\$ I have constructed a very simple PDF file by hand (as suggested in your linked answer) many years ago. Since I believe there would be only one optimal answer I don't think this would make for an interesting question. \$\endgroup\$
    – CJ Dennis
    Commented Apr 22, 2016 at 8:14

3 Answers 3


Your question seems on-topic, so I'll try to go over concerns I'd have about it being on topic, but say why I think it is on topic.

with the text "Hello, world!" printed on it somewhere

This is somewhat vague, does printed mean it has to be "text" or can I make an image and use that? I'm not certain how effective workarounds like this would be, but they might cause the challenge to degenerate somewhat.

This may mean your challenge would be too broad for having too many possible answers, but should be on topic.

based on the size of the output PDF file itself

This is usually fine, and it is what the tag is for. However, Peter's comment addresses a potential problem with the way this is structured. Say I post and answer. Then, SomeUser copies the result that I got, but uses their massive server farm to compress it slightly. Now their score is better than mine. While there isn't really anything inherently wrong with this, and we've had several on-topic largest prime finding questions that function very similarly, I'd be worried that the challenge would quickly devolve into just spending more time compressing the current best answer.

Entries must conform to the ISO 32000-1 PDF standard, and be viewable on commonly used PDF viewers

This is a bit of a pain, but requiring conforming to a standard would mean you need to include the standard in your post. Instead of this, I would recommend changing this so that it only has to work on one free PDF viewer that is freely available and older than the challenge. This is more in line with how we handle programming languages as being valid for a challenge. (It also would help with the above, where finding lazier PDF viewers might help lower your score)

This may cause what you are asking to be unclear, but so long as you fully clarify what is going on your post is about writing a program to solve a task with an objective winning criterion and an objective validity criterion.

Some of this answer kind of crosses over to things that should be done in the sandbox, the core of your question: "Is this on topic" is yes, but the goodness of a challenge should probably be limited to the sandbox.


I think that such a question would be on topic, but would not be a good question for two reasons.

Firstly, as I commented, since the content of a PDF file can largely be DEFLATE-compressed, the battle for the last few bytes' saving would be a question of who has most CPU power to throw at kzip, zopfli, or whichever other nondeterministic extreme zip tool. This could be worked around by asking for PostScript instead of PDF.

However, that brings me to the second point. This is a single-language challenge, which are discouraged. If you want to promote golfing in printer languages, a better way would be to answer existing questions in those languages and optionally also to offer open bounties for answers which beat them.

  • \$\begingroup\$ Answer posted from phone, and will be a few days before I have access to a proper computer. If anyone wants to edit to add links, feel free. \$\endgroup\$ Commented Apr 22, 2016 at 16:56
  • 1
    \$\begingroup\$ But zipping is usually useless for small amounts of data. \$\endgroup\$
    – Qwertiy
    Commented Apr 22, 2016 at 17:15
  • 1
    \$\begingroup\$ @Qwertiy, then why was Bubblegum invented? The question is about the class of challenges, not specifically about Hello, World. \$\endgroup\$ Commented Apr 22, 2016 at 20:37

I think you should try.

Yes, it seems like ontopic and how good is it can determine only the challenge itself.

Sandbox is useless as noone tried anything like that, so they can't help with possible problems and their solutions. The only moment is about conforming to standard. Let's replace it by it should be correctly displayed in Adobe Reader on windows or in [most popular viewer name here] on linux.

What's wrong with the sandbox in this situation?

How sandbox helps to improve the question? People are using their experience to predict and solve problems and potential holes of the challenge.

But what if there is a new type of challenge? Do the have any experience in it? No. Can they find a loopholes? Maybe they can think about it, but they wouldn't check. Now here are ideas about deflate, but will it really help to win? It's just assumptions - noone is going to chek.

So the right way is simply post the chellenge without trying to limit loopholes. Even if somebody will find and use them - it's not bad for the first time. And we'll get knowlege to disallow such ways in further challenges. Or we just see that noone is actually interested in such kind of golfing.

That's the only way that can show us real problems not imaginary ones.

  • \$\begingroup\$ Any comments for downvotes? \$\endgroup\$
    – Qwertiy
    Commented Apr 22, 2016 at 17:14
  • 2
    \$\begingroup\$ What's wrong with the sandbox in this situation? People would respond with their opinions/criticisms there just like they have done here. \$\endgroup\$
    – Blue
    Commented Apr 22, 2016 at 18:12
  • \$\begingroup\$ @muddyfish, updated the answer. \$\endgroup\$
    – Qwertiy
    Commented Apr 22, 2016 at 18:23
  • 4
    \$\begingroup\$ I disagree with your reasoning about the sandbox. Several people, including myself, answer several questions there before the challenge goes live. In fact, I don't think people should post challenges that they don't have a working implementation for. Right now it probably isn't worth trying because the challenge is too volatile, too many little things could change and invalidate my work. That said, if Nate works on improving their challenge and adds it to the sandbox, I'd be glad to work on potential solutions before putting it on the main site. tbc... \$\endgroup\$ Commented Apr 22, 2016 at 19:18
  • 4
    \$\begingroup\$ We long ago decided this site is better without loopholes, I don't think choosing to ignore a group of people trying to help remove loopholes from a challenge is a good idea. \$\endgroup\$ Commented Apr 22, 2016 at 19:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .