From 8e361d98f0bb23d58cbc773367ba76dffced7bdb Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 18 Jun 2022 14:16:56 -0400 Subject: Add examples for output capture (fixes #691) --- include/qpdf/QPDFLogger.hh | 11 +++++++++++ include/qpdf/qpdflogger-c.h | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/qpdf/QPDFLogger.hh b/include/qpdf/QPDFLogger.hh index 54ab7efe..655da668 100644 --- a/include/qpdf/QPDFLogger.hh +++ b/include/qpdf/QPDFLogger.hh @@ -56,6 +56,10 @@ class QPDFLogger // error -- standard error // save -- undefined unless set // + // "info" is used for diagnostic messages, verbose messages, and + // progress messages. "warn" is used for warnings. "error" is used + // for errors. "save" is used for saving output -- see below. + // // On deletion, finish() is called for the standard output and // standard error pipelines, which flushes output. If you supply // any custom pipelines, you must call finish() on them yourself. @@ -64,6 +68,13 @@ class QPDFLogger // // NOTES ABOUT THE SAVE PIPELINE // + // The save pipeline is used by QPDFJob when some kind of binary + // output is being saved. This includes saving attachments and + // stream data and also includes when the output file is standard + // output. If you want to grab that output, you can call setSave. + // See examples/qpdfjob-save-attachment.cc and + // examples/qpdfjob-c-save-attachment.c. + // // You should never set the save pipeline to the same destination // as something else. Doing so will corrupt your save output. If // you want to save to standard output, use the method diff --git a/include/qpdf/qpdflogger-c.h b/include/qpdf/qpdflogger-c.h index 9d31f79c..10ab5bb0 100644 --- a/include/qpdf/qpdflogger-c.h +++ b/include/qpdf/qpdflogger-c.h @@ -25,7 +25,8 @@ /* * This file provides a C API for QPDFLogger. See QPDFLogger.hh for - * information about the logger. + * information about the logger and + * examples/qpdfjob-c-save-attachment.c for an example. */ #include -- cgit v1.2.3-70-g09d2