I am attempting to dynamically produce a PDF while using TCPDF library inside a document greatly like this one. The creation of the PDF is HTML, that we can represent having a string inside a variable, as with the example above:

$html = <<<EOD
<html>bar</html>
EOD;

This content I would like is Wordpress publish metadata that we call inside the theme while using More Fields wordpress plugin like so:

<?php more_fields('foo','','',1); ?>

...which results some HTML which I have specified by the wordpress plugin configurations. Unless of course I am wrong, I can not make that call again from my PDF-producing script without authoring my very own wordpress plugin. So how do i use JS to transmit the HTML towards the script from the clickable "View PDF" link? Actually, it is a full-page of text, not only a couple of figures, in the event that matters.

Hidden Forms?

<form method="post" action="la.php"><input type="hidden" name="foo" value="<?php echo $value; ?>"></form>