aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDF.hh22
-rw-r--r--include/qpdf/QPDFJob.hh4
-rw-r--r--include/qpdf/auto_job_c_main.hh1
3 files changed, 27 insertions, 0 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh
index bbbb896e..5cba93a8 100644
--- a/include/qpdf/QPDF.hh
+++ b/include/qpdf/QPDF.hh
@@ -110,6 +110,28 @@ class QPDF
void
processInputSource(std::shared_ptr<InputSource>, char const* password = 0);
+ // Create a PDF from an input source that contains JSON as written
+ // by qpdf --json (version 2 or higher). The JSON must be a
+ // complete representation of a PDF. See "QPDF JSON Format" in the
+ // manual for details.
+ QPDF_DLL
+ void
+ createFromJSON(std::string const& json_file);
+ QPDF_DLL
+ void
+ createFromJSON(std::shared_ptr<InputSource>);
+
+ // Update a PDF from an input source that contains JSON in the
+ // same format as is written by qpdf --json (version 2 or higher).
+ // Objects in the PDF and not in the JSON are not modified. See
+ // "QPDF JSON Format" in the manual for details.
+ QPDF_DLL
+ void
+ updateFromJSON(std::string const& json_file);
+ QPDF_DLL
+ void
+ updateFromJSON(std::shared_ptr<InputSource>);
+
// Close or otherwise release the input source. Once this has been
// called, no other methods of qpdf can be called safely except
// for getWarnings and anyWarnings(). After this has been called,
diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh
index da8d3fcb..a7d86337 100644
--- a/include/qpdf/QPDFJob.hh
+++ b/include/qpdf/QPDFJob.hh
@@ -323,6 +323,8 @@ class QPDFJob
Config* outputFile(std::string const& filename);
QPDF_DLL
Config* replaceInput();
+ QPDF_DLL
+ Config* createFromJson(std::string const& filename);
QPDF_DLL
std::shared_ptr<CopyAttConfig> copyAttachmentsFrom();
@@ -674,6 +676,8 @@ class QPDFJob
bool check_requires_password;
std::shared_ptr<char> infilename;
std::shared_ptr<char> outfilename;
+ std::string create_from_json;
+ std::string update_from_json;
};
std::shared_ptr<Members> m;
};
diff --git a/include/qpdf/auto_job_c_main.hh b/include/qpdf/auto_job_c_main.hh
index 42e30a70..cc1bf469 100644
--- a/include/qpdf/auto_job_c_main.hh
+++ b/include/qpdf/auto_job_c_main.hh
@@ -68,6 +68,7 @@ QPDF_DLL Config* rotate(std::string const& parameter);
QPDF_DLL Config* showAttachment(std::string const& parameter);
QPDF_DLL Config* showObject(std::string const& parameter);
QPDF_DLL Config* jsonStreamPrefix(std::string const& parameter);
+QPDF_DLL Config* updateFromJson(std::string const& parameter);
QPDF_DLL Config* collate(std::string const& parameter);
QPDF_DLL Config* collate();
QPDF_DLL Config* splitPages(std::string const& parameter);