0

I'm looking for a way to send a HTTP POST request to the TeXLive.net Server but I'm failing to do so. Could somebody please explain how such request should be done? I'm getting this error:

Bad form type
Unexpected param: pre0 Bad Form: no main document

Where pre0 is on the submit button

onclick="latexcgi("pre0")"    

The full code is as follows:

        <form style="display" id="pre0" name="pre0" enctype="multipart/form-data" action="https://texlive.net/cgi-bin/latexcgi" method="post" target="pre0">
        <textarea rows="8" cols="60" name="pre0">
            \\documentclass{article}
            \\usepackage{iftex}
            \\newcommand\test[1]{\\par\\expandafter#1\\string#1: true\\fi}
            \\begin{document}
            \\ttfamily
            \\test\\ifpdftex
            \\test\\ifluatex
            \\test\\ifxetex
            \\test\\ifptex
            \\test\\ifuptex
            \\end{document}
            </textarea>
            <button type="submit" onclick="latexcgi("pre0")" value="Submit">
        </form>        

I'd like to the generated pdf file be

\ifpdftex:  true
2
  • I am not sure that this is on topic really but you need to have the file contents in a filecontents[] parameter and for each such parameter have a filename[] parameter that gives the file name, one of which muxt be document.tex see davidcarlisle.github.io/latexcgi/#http-requests – David Carlisle May 9 at 10:32
  • note that the default runlatex.js code is looking for <pre> not <textarea> so would require a few adjustments – David Carlisle May 16 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.