pipe - PhantomJS: exported PDF to stdout -


Is there a way to trigger the PDF export feature in the pdf extension without specifying the output file with the PDF extension? We want to use the stdout to output the pdf.

As told by Niko to give you an image buffer, Code> renderBase64 () and return the result as base64-encoded string.
But now it is only PNG, JPEG and GIF

Use only the file system API to write some stdout from a phaptem script.

I use something like this for images: var base64image = page.renderBase64 ('PNG'); Var FS = Requirement ("FS"); Fs.write ("/ dev / stdout", base64image, "w");

I do not know if the

PDF format for Renderbase 64 () will be in the future version of Phantom, but with some of these lines, The job may be that you:

  page.reader (output); Var FS = Requirement ("FS"); Var pdf = fs.read (output); Fs.write ("/ dev / stdout", pdf, "w"); Fs.remove (production);   

Where is the output path to the PDF file.

Comments