/* Post-process the example document.
972340
function postprocess(value, logs, options) {
  var tokens = []
  var start = 0
  var match
  var content
  var info
  var parameters
  var end
  var markdown

  EXPRESSION_LOG.lastIndex = 0
  match = EXPRESSION_LOG.exec(value)

  while (match) {
    end = EXPRESSION_LOG.lastIndex

    content = value.slice(start, end - match[0].length)

    parameters = match[2].split(/\s*,\s*/)

    info = parameters[0]
    info = unquote(info.trim())
    info = logs[info]

    if (info && info.value) {
      tokens = tokens.concat(script(content, options), log(info))
    } else {
      parameters = parameters.slice(1).join(', ')

      tokens = tokens.concat(
        script(content + match[1] + parameters + match[3], options)
      )
    }

    start = end
    match = EXPRESSION_LOG.exec(value)
  }

  if (start < value.length) {
    tokens = tokens.concat(script(value.slice(start), options))
  }

  markdown = []

  tokens.forEach(each)

  markdown = markdown.filter(filter)

  return markdown

  function each(token) {
    var prev
    var lang

    if (token.type === 'markdown') {
      markdown = markdown.concat(parse(token.value))
    } else {
      prev = markdown[markdown.length - 1]
      lang = 'lang' in token ? token.lang : token.type

      if (prev && prev.type === 'code' && prev.lang === lang) {
        prev.value += token.value ? '\n' + token.value : ''
      } else {
        markdown.push({
          type: 'code',
          lang: lang,
          value: token.value
        })
      }
    }
  }

  function filter(token) {
    if ('value' in token) {
      token.value = trimTrailingLines(token.value)

      return token.value !== ''
    }

    return true
  }
}
513994
function postProcess(state) {
    var i,
        foundStart = false,
        foundEnd = false,
        delim,
        token,
        delimiters = state.delimiters,
        max = state.delimiters.length;

    for (i = 0; i < max; i++) {
      delim = delimiters[i];
      if (delim.marker === '->') {
        foundStart = true;
      } else if (delim.marker === '<-') {
        foundEnd = true;
      }
    }
    if (foundStart && foundEnd) {
      for (i = 0; i < max; i++) {
        delim = delimiters[i];

        if (delim.marker === '->') {
          foundStart = true;
          token         = state.tokens[delim.token];
          token.type    = 'centertext_open';
          token.tag     = 'div';
          token.nesting = 1;
          token.markup  = '->';
          token.content = '';
          token.attrs = [ [ 'class', 'text-align-center' ] ];
        } else if (delim.marker === '<-') {
          if (foundStart) {
            token         = state.tokens[delim.token];
            token.type    = 'centertext_close';
            token.tag     = 'div';
            token.nesting = -1;
            token.markup  = '<-';
            token.content = '';
          }
        }
      }
    }
  }
1353464
private void processSchemaComment() {
        // Removing DOCTYPE:
        burnCharacters(syntax.getDocumentTypeOpening().length());
        int tagsOpened = 1;
        while (templateReader.hasNextCharacter()) {
            final char character = templateReader.nextCharacter();
            // Schema comment can define new entities, see http://www.w3schools.com/xml/xml_dtd.asp
            if (character == syntax.getTagOpening()) {
                tagsOpened++;
            } else if (character == syntax.getTagClosing()) {
                if (--tagsOpened == 0) {
                    break;
                }
            }
        }
    }
837627
function documentReady(callback) {
  document.readyState === "interactive" || document.readyState === "complete" ? callback() : document.addEventListener("DOMContentLoaded", callback);
}
204007
public function examplesAction()
    {
        $kernelRootDir = $this->container->getParameter('kernel.root_dir');
        
        $propablyPhpPdfExamplesFilePaths = array($kernelRootDir.'/../vendor/PHPPdf/examples/index.php', $kernelRootDir.'/../vendor/psliwa/php-pdf/examples/index.php');

        foreach($propablyPhpPdfExamplesFilePaths as $propablyPhpPdfExamplesFilePath)
        {
            if(file_exists($propablyPhpPdfExamplesFilePath))
            {
                require $propablyPhpPdfExamplesFilePath;
                exit();
            }
        }

        throw new NotFoundHttpException('File with PHPPdf examples not found.');
    }
935544
public function process()
    {
        // {{{ defines the xhtml template

        static $xhtml_template = '';

        if ($xhtml_template == '') {
            $doctype =
                '<!DOCTYPE html PUBLIC ' .
                '"-//W3C//DTD XHTML 1.0 Strict//EN" ' .
                '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' .
                "\n";

            $xhtml_template =
                $doctype .
                <<<XHTML
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<title>SwatXHTMLTextarea Content</title>
	</head>
	<body>
		<div>
		%s
		</div>
	</body>
</html>

XHTML;
        }

        // }}}

        parent::process();

        $ignore_validation_errors =
            $this->allow_ignore_validation_errors &&
            $this->ignore_errors_checkbox->value;

        $xhtml_content = sprintf($xhtml_template, $this->getXHTMLContent());

        $errors = libxml_use_internal_errors(true);

        $document = new DOMDocument();
        $document->loadXML(
            $xhtml_content,
            LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID
        );

        $xml_errors = libxml_get_errors();
        libxml_clear_errors();
        libxml_use_internal_errors($errors);

        if (count($xml_errors) > 0 && !$ignore_validation_errors) {
            $this->addMessage($this->getValidationErrorMessage($xml_errors));
            $this->has_validation_errors = true;
        }
    }
566381
public function postProcess()
    {
        foreach ($this->info as $key => $v) {
            if (count((array) $v) == 1) {
                $this->info[$key] = $v->type;
            } elseif (count((array) $v) == 2 && isset($v->allow_null)) {
                $this->info[$key] = -$v->type;
            }
        }
    }
11896
function after (el, newEl) {
  if (typeof newEl === 'string') {
    return el.insertAdjacentHTML('afterend', newEl)
  } else {
    var next = el.nextSibling
    if (next) {
      return el.parentNode.insertBefore(newEl, next)
    } else {
      return el.parentNode.appendChild(newEl)
    }
  }
}
579198
public void postProcess(DirContext ctx) throws NamingException {
        for (DirContextProcessor processor : dirContextProcessors) {
            processor.postProcess(ctx);
        }
    }
806683
function postToSource()
			{
				// clear unnecessary tags when editor view empty
				var sourceStrings = editor.text()=="" && editor.html().length<12 ? "" : editor.html();
				
				thisElement.val(extractToText(sourceStrings));
			}
539058
private void prepare() throws IOException, DocumentException, PrintingException {
		if (baos == null) {
			baos = new ByteArrayOutputStream(); // let it grow as much as needed
		}
		baos.reset();
		boolean resize = false;
		if (page.getConstraint().getWidth() == 0 || page.getConstraint().getHeight() == 0) {
			resize = true;
		}
		// Create a document in the requested ISO scale.
		Document document = new Document(page.getBounds(), 0, 0, 0, 0);
		PdfWriter writer;
		writer = PdfWriter.getInstance(document, baos);

		// Render in correct colors for transparent rasters
		writer.setRgbTransparencyBlending(true);

		// The mapView is not scaled to the document, we assume the mapView
		// has the right ratio.

		// Write document title and metadata
		document.open();
		PdfContext context = new PdfContext(writer);
		context.initSize(page.getBounds());
		// first pass of all children to calculate size
		page.calculateSize(context);
		if (resize) {
			// we now know the bounds of the document
			// round 'm up and restart with a new document
			int width = (int) Math.ceil(page.getBounds().getWidth());
			int height = (int) Math.ceil(page.getBounds().getHeight());
			page.getConstraint().setWidth(width);
			page.getConstraint().setHeight(height);

			document = new Document(new Rectangle(width, height), 0, 0, 0, 0);
			writer = PdfWriter.getInstance(document, baos);
			// Render in correct colors for transparent rasters
			writer.setRgbTransparencyBlending(true);

			document.open();
			baos.reset();
			context = new PdfContext(writer);
			context.initSize(page.getBounds());
		}
		// int compressionLevel = writer.getCompressionLevel(); // For testing
		// writer.setCompressionLevel(0);

		// Actual drawing
		document.addTitle("Geomajas");
		// second pass to layout
		page.layout(context);
		// finally render (uses baos)
		page.render(context);

		document.add(context.getImage());
		// Now close the document
		document.close();
	}
885357
def post_process(relations, opts)
      Process::CircularDeps.new(relations).process_all!
      Process::InheritDoc.new(relations).process_all!
      Process::Versions.new(relations, opts).process_all!
      Process::ReturnValues.new(relations).process_all!
      Process::Fires.new(relations).process_all!
      Process::Components.new(relations).process_all!
      Process::Lint.new(relations).process_all!
      Process::NoDoc.new(relations).process_all!
      relations
    end
996790
def regenerateToOutputFile(outFile, checkNoChanges = false)
      executeRubyComponents
      @pageObject.process
      writeRegeneratedFile(outFile, checkNoChanges, checkNoChanges)
    end
312215
def post_document(self, data):
    
    data.update({ 'client' : CLIENT })
    return self._call('POST', self._generate_url_path('documents'), data)
742135
function processNodeContentWithPosthtml(node, options) {
	return function (content) {
		return processWithPostHtml(options.plugins, path.join(path.dirname(options.from), node.attrs.href), content, [function (tree) {
			// remove <content> tags and replace them with node's content
			return tree.match(match('content'), function () {
				return node.content || '';
			});
		}]);
	};
}
625387
function(pages, callback) {
      // Use eachSeries to make sure that conversion has done page by page
      async.eachSeries(pages, function(page, callbackmap) {
        var inputStream = fs.createReadStream(input);
        var outputFile = options.outputdir + options.outputname + '_' + page + '.' + options.type;

        convertPdf2Img(inputStream, outputFile, parseInt(page), function(error, result) {
          if (error) {
            return callbackmap(error);
          }

          stdout.push(result);
          return callbackmap(error, result);
        });
      }, function(e) {
        if (e) callback(e);

        return callback(null, {
          result: 'success',
          message: stdout
        });
      });
    }
874816
function Example() {

  var oMX = new MergeXML(); /* instantiate the class */
  var fls = [];             /* output files info */

  /**
   * get element object
   * @param {string} id
   */
  var $ = function(id) {
    return document.getElementById(id);
  };

  /**
   * add event handler
   * @param {string} evt
   * @param {string} id
   * @param {function} fnc
   */
  var AddEvent = function(evt, id, fnc) {
    var elem = $(id);
    if (elem.addEventListener)  // W3C DOM
      elem.addEventListener(evt, fnc, false);
    else if (elem.attachEvent) { // IE DOM
      elem.attachEvent('on' + evt, fnc);
    }
    else { // No much to do
      elem[evt] = fnc;
    }
  };

  /**
   * FileList objects handler
   * @param {object} evt
   */
  var FileSelect = function(evt) {
    $('output').innerHTML = '';
    $('result').innerHTML = '';
    oMX.Init(); /* begin with new objects */
    fls = [];
    var cnt = 0;
    var files = evt.target.files; /* FileList object */
    for (var i = 0; i < files.length; i++) { /* loop the selected files */
      var reader = new FileReader();
      reader.onload = function(file) {
        fls[cnt + 1] = oMX.AddFile(file) ? true : false;  /* get a file */
        var c = $('result').innerHTML;
        if (c !== '') {
          c += ', ';
        }
        $('result').innerHTML = c + fls[cnt];
        cnt += 2;
      };
      fls.push(files[i].name, null);
      reader.readAsText(files[i]);
    }
  };

  /**
   * Check results
   * @return {mixed} array -- files list
   *                 string -- error
   *                 null -- loading yet
   */
  var FileCheck = function() {
    var r = [];
    for (var i = 0; i < fls.length; i += 2) {
      if (fls[i + 1]) {
        r.push(fls[i]);
      } else {
        r = fls[i + 1] === false ? fls[i] : null;
        break;
      }
    }
    return r;
  };

  /**
   * Show results
   */
  var FileMerge = function() {
    var err = '';
    var r = FileCheck();
    if (typeof r === 'string') {
      err = oMX.error.text + ': ' + r;
    } else if (r === null) {
      err = 'Files are not loaded yet';
    } else if (oMX.count < 2) {
      err = 'Minimum 2 files are required';
    }
    $('output').innerHTML = err ? err : oMX.Get(2);
  };

  if (oMX.error.code !== '') {
    $('output').innerHTML = oMX.error.text; /* no DOM support */
  } else if (!window.File || !window.FileList || !window.FileReader) {
    $('output').innerHTML = 'Sorry, the demo needs a browser supporting FileReader API';
  } else {
    AddEvent('change', 'files', FileSelect);
    AddEvent('click', 'merge', FileMerge);
  }

}