Maxim Postnikov
Maxim Postnikov

Reputation: 109

Convert binary streamse use ghostscript api

How do I convert a binary blob pdf located in memory, in the same place jpeg located. Uses pure ghostscript api interface. Example, gsdll32.dll.

The proposed interface uses the default files on the disk.

args = [
 "-dFirstPage=10",
 "-dLastPage=10",
 "-sDEVICE=jpeg",
"-r300",
"-sOutputFile=book.jpg",
"-dNOPAUSE",
"test2.pdf"
]

Upvotes: 0

Views: 217

Answers (1)

KenS
KenS

Reputation: 31199

Basically, you can't. The Ghostscript PDF interpreter assumes that its dealing with a file on disk (see for example the definitions of runpdf and runpdfbegin in pdf_main.ps). Possibly you could convert that into a stream and pass that but it looks like a lot of work to me, all in PostScript.

You definitely can't have the JPEG output written to the same memory location.

Upvotes: 1

Related Questions