Render a pdf document
@param  string $html    The html to be rendered
@param  string $docname The name of the document to be served
196883
public function getpdf($html)
	{
		// test if dompdf config exists in symfony app folder
		$testFilePath = "/../../../../../../app/dompdf_config.inc.php";
		if (file_exists(dirname(__FILE__).$testFilePath)) {
			require_once(dirname(__FILE__).$testFilePath);
		}
		else {
			require_once dirname(__FILE__).'/../DomPDF/dompdf_config.inc.php';
		}

		$this->pdf = new \DOMPDF();

		$this->pdf->set_paper(DOMPDF_DEFAULT_PAPER_SIZE);
		$this->pdf->load_html($html);
		$this->pdf->render();
	}
1246580
public function loadHTML($html)
    {
        $dom = new \DOMDocument();
        $dom->formatOutput = true;

        // strip illegal XML UTF-8 chars
        // remove all control characters except CR, LF and tab
        $html = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/u', '', $html); // 00-09, 11-31, 127

        $dom->loadHTML($html);
        $this->loadDomDocument($dom);
    }
1349385
public function stream($filename = "document.pdf", $options = array())
    {
        if (headers_sent()) {
            die("Unable to stream pdf: headers already sent");
        }

        if (!isset($options["compress"])) $options["compress"] = true;
        if (!isset($options["Attachment"])) $options["Attachment"] = true;

        $this->_add_page_text();

        $debug = !$options['compress'];
        $tmp = ltrim($this->_pdf->output($debug));

        header("Cache-Control: private");
        header("Content-Type: application/pdf");
        header("Content-Length: " . mb_strlen($tmp, "8bit"));

        $filename = str_replace(array("\n", "'"), "", basename($filename, ".pdf")) . ".pdf";
        $attachment = $options["Attachment"] ? "attachment" : "inline";
        header(Helpers::buildContentDispositionHeader($attachment, $filename));

        echo $tmp;
        flush();
    }
695362
public function HTMLToPDF($html, GrabzItPDFOptions $options = null)
	{
		if ($options == null)
		{
			$options = new GrabzItPDFOptions();			
		}

		$this->request = new GrabzItRequest($this->getRootUrl(true) . GrabzItClient::TakePDF, true, $options, $html);
	}
484810
public function renderSectionHeader(string $sectionName) : void
    {
        if ($this->isSilent()) {
            return;
        }

        fwrite($this->file, '  ' . $this->formatter->formatPropertyName($sectionName) . ': ');
    }
1022724
public function sendToBrowserInline($filename)
    {
        ReportRenderer::sendToBrowser(
            $filename,
            ReportRenderer::CSV_FORMAT,
            "application/" . ReportRenderer::CSV_FORMAT,
            $this->getRenderedReport()
        );
    }
1368068
public function enableShardingForDbByDocumentName($documentName)
    {
        $dbName = $this->dm->getDocumentDatabase($documentName)->getName();
        $adminDb = $this->dm->getConnection()->selectDatabase('admin');
        $result = $adminDb->command(array('enableSharding' => $dbName));

        if ($result['ok'] != 1 && $result['errmsg'] !== 'already enabled') {
            throw MongoDBException::failedToEnableSharding($dbName, $result['errmsg']);
        }
    }
111665
function render({ document }) {
  console.debug("rendering");
  document.querySelectorAll(".replace-with-pubcontrol").forEach(el => {
    el.innerHTML = `
    <div>
      <h2>pubcontrol default export</h2>
      <pre>${JSON.stringify(objectSchema(PubControl), null, 2)}</pre>
    </div>
    `;
  });
}
935448
public function getHtml() : string
    {
        $head = (new HeadGenerator($this))->render();
        $body = (new BodyGenerator($this))->render();
        return "<!doctype html><html>$head$body</html>";
    }
728597
protected function render($viewName, $params = [])
    {
        $params['model'] = $this->model;
        return parent::render($viewName, $params);
    }
777736
protected static function renderNode($node, $document)
    {
        if (static::isTag($node)) {
            # Strip the leading "#"
            $tagName    = substr(array_shift($node), 1);
            $attributes = array();

            if (sizeof($node) > 2) {
                throw new \UnexpectedValueException(
                    "Tags must not consist of more than three elements"
                );
            }

            foreach ($node as $argv) {
                # Is the argument an associative array of attributes?
                if (is_array($argv) and count(array_filter(array_keys($argv), "is_string")) > 0) {
                    $attributes = $argv;
                } else {
                    $content = $argv;
                }
            }

            $el = $document->createElement($tagName);

            foreach ($attributes as $attr => $value) {
                if (is_array($value)) $value = join(" ", $value);

                $el->setAttribute($attr, (string) $value);
            }

            if (isset($content)) {
                $el->appendChild(static::renderNode($content, $document));
            }
        } else if (is_array($node)) {
            $el = $document->createDocumentFragment();

            foreach ($node as $child) {
                $el->appendChild(static::renderNode($child, $document));
            }
        } else {
            $node = (string) $node;
            if (!empty($node)) $node .= "\n";
            $el = $document->createTextNode($node);
        }

        return $el;
    }
104838
protected function render()
    {
        $this->display('* Rendering documents');
        foreach ($this->documents as $file => &$document) {
            $this->display(' -> Rendering '.$file.'...');
            $target = $this->getTargetOf($file);

            $directory = dirname($target);
            if (!is_dir($directory)) {
                mkdir($directory, 0755, true);
            }

            file_put_contents($target, $document->renderDocument());
        }
    }
690609
function generateHTML(fileName) {
  return new Promise( resolve => {
    const location = fileName === 'index.html' ? '/' : `/${fileName}`;
    match({routes, location}, (error, redirectLocation, renderProps) => {
      let html = ReactDOMServer.renderToString(
        <RouterContext {...renderProps} />
      );
      html = '<!doctype html>' + html;
      let write = fsp.writeFile(path.join(docsBuilt, fileName), html);
      resolve(write);
    });
  });
}
1100389
public function render($FileName)
    {
        if ($this->TransparentBackground) {
            imagealphablending($this->Picture, false);
            imagesavealpha($this->Picture, true);
        }
        imagepng($this->Picture, $FileName);
    }
90510
public function clear($documentName = null)
    {
        if ($documentName === null) {
            $this->identityMap =
            $this->documentIdentifiers =
            $this->originalDocumentData =
            $this->documentChangeSets =
            $this->documentStates =
            $this->scheduledForDirtyCheck =
            $this->documentInsertions =
            $this->documentUpserts =
            $this->documentUpdates =
            $this->documentDeletions =
            $this->extraUpdates =
            $this->collectionUpdates =
            $this->collectionDeletions =
            $this->parentAssociations =
            $this->orphanRemovals = array();

            if ($this->commitOrderCalculator !== null) {
                $this->commitOrderCalculator->clear();
            }
        } else {
            $visited = array();
            foreach ($this->identityMap as $className => $documents) {
                if ($className === $documentName) {
                    foreach ($documents as $document) {
                        $this->doDetach($document, $visited, true);
                    }
                }
            }
        }

        if ($this->evm->hasListeners(Events::onClear)) {
            $this->evm->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this->dm, $documentName));
        }
    }
495825
protected function _render($Pdf, $DomPDF)
    {
        $DomPDF->loadHtml($Pdf->html());
        $DomPDF->render();

        return $DomPDF;
    }
888569
public function render_view($html, $data = array())
    {
        $this->last_selector = null;

        if (is_array($html)) {
            $html = join("\n", $html);
        }

        return $this->cmd(5, array(
            $this->typecast($html, true, true),
            $data
        ));
    }