xpdfSpliceOpenOutputMem

Open an output PDF file, in memory.
XpdfSpliceOutputHandle xpdfSpliceOpenOutputMem(const char *fileNameData, int fileNameDataLen, double pdfVersion)
This function opens an output PDF file that will be buffered in memory.

fileNameDataLen bytes from fileNameData will be used only when generating the file ID for encryption. If no file name information is available, pass NULL for fileNameData and 0 for fileNameDataLen.

The xpdfSpliceOpenOutputMem function returns an XpdfSpliceOutputHandle if successful, and otherwise returns NULL.

The PDF version in the output file will be set to pdfVersion. XpdfSplice does not check that the content conforms to the specified version. Typically, it should be set to the highest version used in any of your input files.

The xpdfSpliceCloseOutputMem must be used to retrieve the memory buffer.

C:
XpdfSpliceOutputHandle out; char *pdfData; int pdfDataLength; out = xpdfSpliceOpenOutputMem("test123.pdf", 11, 1.6); if (!out) { /* handle the error */ } ... pdfData = xpdfSpliceCloseOutputMem(out, &pdfDataLength); /* ... use pdfDataLength bytes at pdfData ... */ xpdfSpliceFreeMemory(pdfData);
xpdfSpliceOpenOutput
xpdfSpliceCloseOutputMem