-
-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
Currently the PDF write API only supports a single page content stream, while the read API supports an arbitrary number of streams, as supported by the PDF format.
Proposed API:
extern pdfio_obj_t *pdfioFileCreatePageObj(pdfio_file_t *pdf, pdfio_dict_t *dict) _PDFIO_PUBLIC;
extern pdfio_stream_t *pdfioPageCreateStream(pdfio_obj_t *page, pdfio_filter_t compression) _PDFIO_PUBLIC;
Usage:
pdfio_file_t *pdf; // PDF file
pdfio_obj_t *page; // Page object
pdfio_dict_t *dict; // Page dictionary
page = pdfioFileCreatePageObj(pdf, dict);
pdfio_stream_t *st1, *st2;
st1 = pdfioPageCreateStream(page, PDFIO_FILTER_FLATE);
// write some page content commands to the stream
pdfioStreamClose(st1);
st2 = pdfioPageCreateStream(page, PDFIO_FILTER_NONE);
// write some page content commands to the stream
pdfioStreamClose(st2);
// Close the page object to write it out...
pdfioObjClose(page);