alfadel's blog

By alfadel, history, 6 years ago, In English

Hello Codeforces, yesterday I published a new light tool to extract CodeForces problems in PDF format, you can find the tool and the story behind it in this GitHub repository.

Have fun and if there are any comments about it, please let me know :)

  • Vote: I like it
  • +30
  • Vote: I do not like it

| Write comment?
»
6 years ago, # |
  Vote: I like it +5 Vote: I do not like it

You can also convert these pages: http://mirror.codeforces.com/contest/992/problems

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It looks like pretty easy, I will work to add this feature to the tool.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Now you can extract entire contests using the contest ID from CodeForces URL, please check and try it if you can.

»
6 years ago, # |
  Vote: I like it +3 Vote: I do not like it

there's an issue with pictures in problems, here: pdf and problem

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thank you for reporting this, I will work to fix the issue as soon as possible.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Now you can extract problems with images, please check and try it if you can.

»
6 years ago, # |
  Vote: I like it +12 Vote: I do not like it
  1. Could you add requirements.txt for easier installation?
  2. What's the purpose of the minified CSS file in repository? If it's yours, you'd better put it not minified; if it's just Codeforces CSS, you'd better fetch this from CF.
  3. I think using selenium for just downloading the page and extracting subtree of the DOM is a bit overkill.
  • »
    »
    6 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it
    1. I've created requirements.txt can you check it?
    2. The css.css file contains the styles for problem statement block in the page from CodeForces, the file is static for all problems in the sit, so I've decided to put it with the code and not to fetch it every time someone trying to download new problem.
    3. I know, and Selenium make it very slow, but if you provide me a method to render MathJax characters from HTML into PDF and get this n, I will remove Selenium and use regular HTTP get request.
    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it
      1. It's fine now, thanks
      2. It could change on Codeforces, so I'd still prefer to fetch it from CF but that's just faultfinding.
      3. Oh, I forgot that CF problem pages are not static. That's okay in this case, sorry for faultfinding again.
    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Can't you convert the TeX representation of MathJax characters to PDF?

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        No, are you have any resource to do it?

        • »
          »
          »
          »
          »
          6 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          You could try htlatex tool which is part of core distribution.

          • »
            »
            »
            »
            »
            »
            6 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            Can you mention any GitHub repository or tutorial?